From b36a049aa468bb376b5efb536d8b4be29bdb841f Mon Sep 17 00:00:00 2001 From: Kevin Squire Date: Tue, 20 Jul 2021 15:50:17 -0700 Subject: [PATCH] Update type of _get_output_dim_selector --- xarray/core/rolling.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xarray/core/rolling.py b/xarray/core/rolling.py index d9eee306ec5..98c25142929 100644 --- a/xarray/core/rolling.py +++ b/xarray/core/rolling.py @@ -1,7 +1,7 @@ import functools import itertools import warnings -from typing import Any, Callable, Dict +from typing import Any, Callable, Dict, Hashable import numpy as np @@ -208,7 +208,7 @@ def _get_keep_attrs(self, keep_attrs): return keep_attrs - def _get_output_dim_selector(self) -> Dict[str, Any]: + def _get_output_dim_selector(self) -> Dict[Hashable, Any]: """Get output dimension selector, taking into account window size, window, centering, and padding. If any of the dimensions are not padded, the output size can be shorter than the input size @@ -229,7 +229,7 @@ def offsets_to_slice(start_offset: int, end_offset: int) -> slice: offset = [not p for p in self.pad] offsets = utils.get_pads(self.dim, self.window, self.center, offset) - selector: Dict[str, slice] = { + selector: Dict[Hashable, slice] = { dim: offsets_to_slice(start_offset, end_offset) for dim, (start_offset, end_offset) in offsets.items() }