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

Method _replace_with_new_dims

xarray/core/dataset.py:927–939  ·  view source on GitHub ↗

Replace variables with recalculated dimensions.

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

Source from the content-addressed store, hash-verified

925 return obj
926
927 def _replace_with_new_dims(
928 self,
929 variables: dict[Hashable, Variable],
930 coord_names: set | None = None,
931 attrs: dict[Hashable, Any] | Default | None = _default,
932 indexes: dict[Hashable, Index] | None = None,
933 inplace: bool = False,
934 ) -> Self:
935 """Replace variables with recalculated dimensions."""
936 dims = calculate_dimensions(variables)
937 return self._replace(
938 variables, coord_names, dims, attrs, indexes, inplace=inplace
939 )
940
941 def _replace_vars_and_dims(
942 self,

Callers 15

_isel_fancyMethod · 0.95
_reindex_callbackMethod · 0.95
interpMethod · 0.95
swap_dimsMethod · 0.95
expand_dimsMethod · 0.95
set_indexMethod · 0.95
reset_indexMethod · 0.95
_stack_onceMethod · 0.95
_unstack_onceMethod · 0.95
_unstack_full_reindexMethod · 0.95
drop_varsMethod · 0.95
reduceMethod · 0.95

Calls 2

_replaceMethod · 0.95
calculate_dimensionsFunction · 0.90

Tested by

no test coverage detected