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

Method _dataset_indexer

xarray/core/common.py:1231–1236  ·  view source on GitHub ↗
(dim: Hashable)

Source from the content-addressed store, hash-verified

1229 return cond.any(dim=(d for d in cond.dims if d != dim))
1230
1231 def _dataset_indexer(dim: Hashable) -> DataArray:
1232 cond_wdim = cond.drop_vars(
1233 var for var in cond if dim not in cond[var].dims
1234 )
1235 keepany = cond_wdim.any(dim=(d for d in cond.dims if d != dim))
1236 return keepany.to_dataarray().any("variable")
1237
1238 _get_indexer = (
1239 _dataarray_indexer if isinstance(cond, DataArray) else _dataset_indexer

Callers

nothing calls this directly

Calls 3

drop_varsMethod · 0.45
anyMethod · 0.45
to_dataarrayMethod · 0.45

Tested by

no test coverage detected