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

Function _nested_combine

xarray/structure/combine.py:369–407  ·  view source on GitHub ↗
(
    datasets,
    concat_dims,
    compat,
    data_vars,
    coords,
    ids,
    fill_value,
    join: JoinOptions | CombineKwargDefault,
    combine_attrs: CombineAttrsOptions,
)

Source from the content-addressed store, hash-verified

367
368
369def _nested_combine(
370 datasets,
371 concat_dims,
372 compat,
373 data_vars,
374 coords,
375 ids,
376 fill_value,
377 join: JoinOptions | CombineKwargDefault,
378 combine_attrs: CombineAttrsOptions,
379):
380 if len(datasets) == 0:
381 return Dataset()
382
383 # Arrange datasets for concatenation
384 # Use information from the shape of the user input
385 if not ids:
386 # Determine tile_IDs by structure of input in N-D
387 # (i.e. ordering in list-of-lists)
388 combined_ids = _infer_concat_order_from_positions(datasets)
389 else:
390 # Already sorted so just use the ids already passed
391 combined_ids = dict(zip(ids, datasets, strict=True))
392
393 # Check that the inferred shape is combinable
394 _check_shape_tile_ids(combined_ids)
395
396 # Apply series of concatenate or merge operations along each dimension
397 combined = _combine_nd(
398 combined_ids,
399 concat_dims=concat_dims,
400 compat=compat,
401 data_vars=data_vars,
402 coords=coords,
403 fill_value=fill_value,
404 join=join,
405 combine_attrs=combine_attrs,
406 )
407 return combined
408
409
410# Define types for arbitrarily-nested list of lists.

Callers 2

open_mfdatasetFunction · 0.90
combine_nestedFunction · 0.85

Calls 4

DatasetClass · 0.90
_check_shape_tile_idsFunction · 0.85
_combine_ndFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…