MCPcopy Index your code
hub / github.com/pydata/xarray / _check_dimension_depth_tile_ids

Function _check_dimension_depth_tile_ids

xarray/structure/combine.py:184–199  ·  view source on GitHub ↗

Check all tuples are the same length, i.e. check that all lists are nested to the same depth.

(combined_tile_ids)

Source from the content-addressed store, hash-verified

182
183
184def _check_dimension_depth_tile_ids(combined_tile_ids):
185 """
186 Check all tuples are the same length, i.e. check that all lists are
187 nested to the same depth.
188 """
189 tile_ids = combined_tile_ids.keys()
190 nesting_depths = [len(tile_id) for tile_id in tile_ids]
191 if not nesting_depths:
192 nesting_depths = [0]
193 if set(nesting_depths) != {nesting_depths[0]}:
194 raise ValueError(
195 "The supplied objects do not form a hypercube because"
196 " sub-lists do not have consistent depths"
197 )
198 # return these just to be reused in _check_shape_tile_ids
199 return tile_ids, nesting_depths
200
201
202def _check_shape_tile_ids(combined_tile_ids):

Callers 2

_check_shape_tile_idsFunction · 0.85

Calls 1

keysMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…