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

Method _resolve_inherit

xarray/core/datatree.py:598–611  ·  view source on GitHub ↗

Resolve the inherit parameter to (coord_vars, indexes).

(
        self, inherit: bool | Literal["all_coords", "indexes"]
    )

Source from the content-addressed store, hash-verified

596 )
597
598 def _resolve_inherit(
599 self, inherit: bool | Literal["all_coords", "indexes"]
600 ) -> tuple[Mapping[Hashable, Variable], dict[Hashable, Index]]:
601 """Resolve the inherit parameter to (coord_vars, indexes)."""
602 if inherit is False:
603 return self._node_coord_variables, dict(self._node_indexes)
604 if inherit is True or inherit == "indexes":
605 return self._coord_variables, dict(self._indexes)
606 if inherit == "all_coords":
607 return self._coord_variables_all, dict(self._indexes)
608 raise ValueError(
609 f"Invalid value for inherit: {inherit!r}. "
610 "Expected True, False, 'indexes', or 'all'."
611 )
612
613 @property
614 def _dims(self) -> ChainMap[Hashable, int]:

Callers 2

_to_dataset_viewMethod · 0.95
to_datasetMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected