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

Method _construct_direct

xarray/core/coordinates.py:358–373  ·  view source on GitHub ↗
(
        cls,
        coords: dict[Any, Variable],
        indexes: dict[Any, Index],
        dims: dict[Any, int] | None = None,
    )

Source from the content-addressed store, hash-verified

356
357 @classmethod
358 def _construct_direct(
359 cls,
360 coords: dict[Any, Variable],
361 indexes: dict[Any, Index],
362 dims: dict[Any, int] | None = None,
363 ) -> Self:
364 from xarray.core.dataset import Dataset
365
366 obj = object.__new__(cls)
367 obj._data = Dataset._construct_direct(
368 coord_names=set(coords),
369 variables=coords,
370 indexes=indexes,
371 dims=dims,
372 )
373 return obj
374
375 @classmethod
376 def from_xindex(cls, index: Index) -> Self:

Callers 7

__init__Method · 0.45
mergeMethod · 0.45
copyMethod · 0.45
_update_coordsMethod · 0.45
to_datasetMethod · 0.45
drop_indexed_coordsFunction · 0.45

Calls 1

__new__Method · 0.45

Tested by

no test coverage detected