(
datasets,
concat_dims,
compat,
data_vars,
coords,
ids,
fill_value,
join: JoinOptions | CombineKwargDefault,
combine_attrs: CombineAttrsOptions,
)
| 367 | |
| 368 | |
| 369 | def _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. |
no test coverage detected
searching dependent graphs…