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

Method _replace_vars_and_dims

xarray/core/dataset.py:941–958  ·  view source on GitHub ↗

Deprecated version of _replace_with_new_dims(). Unlike _replace_with_new_dims(), this method always recalculates indexes from variables.

(
        self,
        variables: dict[Hashable, Variable],
        coord_names: set | None = None,
        dims: dict[Hashable, int] | None = None,
        attrs: dict[Hashable, Any] | Default | None = _default,
        inplace: bool = False,
    )

Source from the content-addressed store, hash-verified

939 )
940
941 def _replace_vars_and_dims(
942 self,
943 variables: dict[Hashable, Variable],
944 coord_names: set | None = None,
945 dims: dict[Hashable, int] | None = None,
946 attrs: dict[Hashable, Any] | Default | None = _default,
947 inplace: bool = False,
948 ) -> Self:
949 """Deprecated version of _replace_with_new_dims().
950
951 Unlike _replace_with_new_dims(), this method always recalculates
952 indexes from variables.
953 """
954 if dims is None:
955 dims = calculate_dimensions(variables)
956 return self._replace(
957 variables, coord_names, dims, attrs, indexes=None, inplace=inplace
958 )
959
960 def _overwrite_indexes(
961 self,

Callers

nothing calls this directly

Calls 2

_replaceMethod · 0.95
calculate_dimensionsFunction · 0.90

Tested by

no test coverage detected