@@ -167,7 +167,9 @@ def build_structure_collection(targets: list[io.io.OpenTarget], ignore_empty: bo
167
167
if link_sources ["galaxy_properties" ]:
168
168
galaxy_properties_target = link_sources ["galaxy_properties" ][0 ]
169
169
170
- input_link_targets = {}
170
+ input_link_targets : dict [str , dict [str , d .Dataset | sc .StructureCollection ]] = (
171
+ defaultdict (dict )
172
+ )
171
173
for source_type , source_targets in link_targets .items ():
172
174
if any (len (ts ) > 1 for ts in source_targets .values ()):
173
175
raise ValueError ("Found more than one linked file of a given type!" )
@@ -215,7 +217,7 @@ def __build_structure_collection(
215
217
link_targets : dict [str , dict [str , d .Dataset | sc .StructureCollection ]],
216
218
ignore_empty : bool ,
217
219
):
218
- if galaxy_properties_target is not None and link_targets [ "galaxy_targets" ] :
220
+ if galaxy_properties_target is not None and "galaxy_targets" in link_targets :
219
221
handlers = get_link_handlers (
220
222
galaxy_properties_target .group ,
221
223
list (link_targets ["galaxy_targets" ].keys ()),
@@ -242,7 +244,7 @@ def __build_structure_collection(
242
244
if (
243
245
halo_properties_target is not None
244
246
and galaxy_properties_target is not None
245
- and not link_targets [ "galaxy_targets" ]
247
+ and "galaxy_targets" not in link_targets
246
248
):
247
249
galaxy_properties = io .io .open_single_dataset (
248
250
galaxy_properties_target , bypass_lightcone = True
0 commit comments