@@ -135,6 +135,9 @@ def build_structure_collection(targets: list[io.io.OpenTarget], ignore_empty: bo
135
135
len (link_sources ["halo_properties" ]) > 1
136
136
or len (link_sources ["galaxy_properties" ]) > 1
137
137
):
138
+ raise NotImplementedError (
139
+ "Opening structure collections that span multiple redshifts is not currently supported"
140
+ )
138
141
# Potentially a lightcone structure collection
139
142
collections = {}
140
143
sources_by_step , targets_by_step = __sort_by_step (link_sources , link_targets )
@@ -165,10 +168,12 @@ def build_structure_collection(targets: list[io.io.OpenTarget], ignore_empty: bo
165
168
galaxy_properties_target = link_sources ["galaxy_properties" ][0 ]
166
169
167
170
input_link_targets = {}
168
- for source_type , targets in link_targets .items ():
169
- if any (len (ts ) > 1 for ts in targets .values ()):
171
+ for source_type , source_targets in link_targets .items ():
172
+ if any (len (ts ) > 1 for ts in source_targets .values ()):
170
173
raise ValueError ("Found more than one linked file of a given type!" )
171
- input_link_targets [source_type ] = {key : t [0 ] for key , t in targets .items ()}
174
+ input_link_targets [source_type ] = {
175
+ key : t [0 ] for key , t in source_targets .items ()
176
+ }
172
177
173
178
return __build_structure_collection (
174
179
halo_properties_target ,
@@ -179,8 +184,8 @@ def build_structure_collection(targets: list[io.io.OpenTarget], ignore_empty: bo
179
184
180
185
181
186
def __sort_by_step (link_sources : dict [str , list [io .io .OpenTarget ]], link_targets ):
182
- sources_by_step : dict [str , io .io .OpenTarget ] = defaultdict (dict )
183
- targets_by_step : dict [str , dict [str , d .Dataset ]] = defaultdict (
187
+ sources_by_step : dict [int , dict [ str , io .io .OpenTarget ] ] = defaultdict (dict )
188
+ targets_by_step : dict [int , dict [ str , dict [str , d .Dataset ] ]] = defaultdict (
184
189
lambda : defaultdict (dict )
185
190
)
186
191
for source_name , sources in link_sources .items ():
0 commit comments