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

Method __init__

xarray/core/indexing.py:487–503  ·  view source on GitHub ↗
(self, key: tuple[BasicIndexerType, ...])

Source from the content-addressed store, hash-verified

485 __slots__ = ()
486
487 def __init__(self, key: tuple[BasicIndexerType, ...]):
488 if not isinstance(key, tuple):
489 raise TypeError(f"key must be a tuple: {key!r}")
490
491 new_key = []
492 for k in key:
493 if isinstance(k, integer_types):
494 k = int(k)
495 elif isinstance(k, slice):
496 k = as_integer_slice(k)
497 else:
498 raise TypeError(
499 f"unexpected indexer type for {type(self).__name__}: {k!r}"
500 )
501 new_key.append(k)
502
503 super().__init__(tuple(new_key))
504
505
506class OuterIndexer(ExplicitIndexer):

Callers 3

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 2

as_integer_sliceFunction · 0.85
typeFunction · 0.85

Tested by

no test coverage detected