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

Method _construct_direct

xarray/core/dataarray.py:481–497  ·  view source on GitHub ↗

Shortcut around __init__ for internal use when we want to skip costly validation

(
        cls,
        variable: Variable,
        coords: dict[Any, Variable],
        name: Hashable,
        indexes: dict[Hashable, Index],
    )

Source from the content-addressed store, hash-verified

479
480 @classmethod
481 def _construct_direct(
482 cls,
483 variable: Variable,
484 coords: dict[Any, Variable],
485 name: Hashable,
486 indexes: dict[Hashable, Index],
487 ) -> Self:
488 """Shortcut around __init__ for internal use when we want to skip
489 costly validation
490 """
491 obj = object.__new__(cls)
492 obj._variable = variable
493 obj._coords = coords
494 obj._name = name
495 obj._indexes = indexes
496 obj._close = None
497 return obj
498
499 def _replace(
500 self,

Callers 2

_to_dataset_splitMethod · 0.45
_to_dataset_wholeMethod · 0.45

Calls 1

__new__Method · 0.45

Tested by

no test coverage detected