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

Function get_indexes

xarray/structure/concat.py:737–746  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

735 # TODO: (benbovy - explicit indexes): check index types and/or coordinates
736 # of all datasets?
737 def get_indexes(name):
738 for ds in datasets:
739 if name in ds._indexes:
740 yield ds._indexes[name]
741 elif name == dim_name:
742 var = ds._variables[name]
743 if not var.dims:
744 data = var.set_dims(dim_name).values
745 if create_index_for_new_dim:
746 yield PandasIndex(data, dim_name, coord_dtype=var.dtype)
747
748 # create concatenation index, needed for later reindexing
749 # use np.cumulative_sum(concat_dim_lengths, include_initial=True) when we support numpy>=2

Callers 1

_dataset_concatFunction · 0.85

Calls 2

PandasIndexClass · 0.90
set_dimsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…