MCPcopy
hub / github.com/pydata/xarray / _check_shape_tile_ids

Function _check_shape_tile_ids

xarray/structure/combine.py:202–213  ·  view source on GitHub ↗

Check all lists along one dimension are same length.

(combined_tile_ids)

Source from the content-addressed store, hash-verified

200
201
202def _check_shape_tile_ids(combined_tile_ids):
203 """Check all lists along one dimension are same length."""
204 tile_ids, nesting_depths = _check_dimension_depth_tile_ids(combined_tile_ids)
205 for dim in range(nesting_depths[0]):
206 indices_along_dim = [tile_id[dim] for tile_id in tile_ids]
207 occurrences = Counter(indices_along_dim)
208 if len(set(occurrences.values())) != 1:
209 raise ValueError(
210 "The supplied objects do not form a hypercube "
211 "because sub-lists do not have consistent "
212 f"lengths along dimension {dim}"
213 )
214
215
216def _combine_nd(

Callers 4

test_check_depthsMethod · 0.90
test_check_lengthsMethod · 0.90
_nested_combineFunction · 0.85

Calls 2

valuesMethod · 0.45

Tested by 2

test_check_depthsMethod · 0.72
test_check_lengthsMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…