From f958953fab088a4a4e33782d8b0a39770625fe3b Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Sun, 5 May 2024 18:48:21 -0400 Subject: [PATCH] mypy --- xarray/core/indexes.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xarray/core/indexes.py b/xarray/core/indexes.py index 2cc62ba14c2..fe0f7a7da87 100644 --- a/xarray/core/indexes.py +++ b/xarray/core/indexes.py @@ -161,7 +161,7 @@ def unstack(self) -> tuple[dict[Hashable, Index], pd.MultiIndex]: raise NotImplementedError() def create_variables( - self, variables: Mapping[Any, Variable] | None = None + self, variables: Mapping[Any, Variable] | None = None, *, fastpath=False, ) -> IndexVars: """Maybe create new coordinate variables from this index. @@ -1132,7 +1132,7 @@ def reorder_levels( return self._replace(index, level_coords_dtype=level_coords_dtype) def create_variables( - self, variables: Mapping[Any, Variable] | None = None + self, variables: Mapping[Any, Variable] | None = None, *, fastpath=False ) -> IndexVars: from xarray.core.variable import IndexVariable @@ -1787,11 +1787,11 @@ def _apply_indexes_fast(indexes: Indexes[Index], args: Mapping[Any, Any], func: # which is really slow when repeatidly iterating through # an array. However, it fails to return the correct ID for # multi-index arrays - indexes, coords = indexes._indexes, indexes._variables + indexes_fast, coords = indexes._indexes, indexes._variables - new_indexes: dict[Hashable, Index] = {k: v for k, v in indexes.items()} + new_indexes: dict[Hashable, Index] = {k: v for k, v in indexes_fast.items()} new_index_variables: dict[Hashable, Variable] = {} - for name, index in indexes.items(): + for name, index in indexes_fast.items(): coord = coords[name] if hasattr(coord, "_indexes"): index_vars = {n: coords[n] for n in coord._indexes}