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

Method _getitem_coord

xarray/core/dataarray.py:877–886  ·  view source on GitHub ↗
(self, key: Any)

Source from the content-addressed store, hash-verified

875 return dict(zip(self.dims, key, strict=True))
876
877 def _getitem_coord(self, key: Any) -> Self:
878 from xarray.core.dataset_utils import _get_virtual_variable
879
880 try:
881 var = self._coords[key]
882 except KeyError:
883 dim_sizes = dict(zip(self.dims, self.shape, strict=True))
884 _, key, var = _get_virtual_variable(self._coords, key, dim_sizes)
885
886 return self._replace_maybe_drop_dims(var, name=key)
887
888 def __getitem__(self, key: Any) -> Self:
889 if isinstance(key, str):

Callers 2

__getitem__Method · 0.95
__getitem__Method · 0.80

Calls 2

_get_virtual_variableFunction · 0.90

Tested by

no test coverage detected