Skip to content

Commit c8f7dc6

Browse files
authored
Upgrade mypy to 1.15 (#10041)
Seems easy locally; maybe too easy and something will break in CI...
1 parent 1873874 commit c8f7dc6

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

.github/workflows/ci-additional.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
python xarray/util/print_versions.py
117117
- name: Install mypy
118118
run: |
119-
python -m pip install "mypy==1.13" --force-reinstall
119+
python -m pip install "mypy==1.15" --force-reinstall
120120
121121
- name: Run mypy
122122
run: |
@@ -167,7 +167,7 @@ jobs:
167167
python xarray/util/print_versions.py
168168
- name: Install mypy
169169
run: |
170-
python -m pip install "mypy==1.13" --force-reinstall
170+
python -m pip install "mypy==1.15" --force-reinstall
171171
172172
- name: Run mypy
173173
run: |

xarray/core/groupby.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,8 +1606,7 @@ def reduce_array(ar: DataArray) -> DataArray:
16061606
return self.map(reduce_array, shortcut=shortcut)
16071607

16081608

1609-
# https://github.com/python/mypy/issues/9031
1610-
class DataArrayGroupBy( # type: ignore[misc]
1609+
class DataArrayGroupBy(
16111610
DataArrayGroupByBase,
16121611
DataArrayGroupByAggregations,
16131612
ImplementsArrayReduce,
@@ -1774,8 +1773,7 @@ def assign(self, **kwargs: Any) -> Dataset:
17741773
return self.map(lambda ds: ds.assign(**kwargs))
17751774

17761775

1777-
# https://github.com/python/mypy/issues/9031
1778-
class DatasetGroupBy( # type: ignore[misc]
1776+
class DatasetGroupBy(
17791777
DatasetGroupByBase,
17801778
DatasetGroupByAggregations,
17811779
ImplementsDatasetReduce,

xarray/core/indexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ def __init__(self, key: tuple[slice | np.ndarray[Any, np.dtype[np.generic]], ...
480480
)
481481
if ndim is None:
482482
ndim = k.ndim # type: ignore[union-attr]
483-
elif ndim != k.ndim:
483+
elif ndim != k.ndim: # type: ignore[union-attr]
484484
ndims = [k.ndim for k in key if isinstance(k, np.ndarray)]
485485
raise ValueError(
486486
"invalid indexer key: ndarray arguments "

xarray/core/resample.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,7 @@ def _interpolate(self, kind="linear", **kwargs) -> T_Xarray:
232232
)
233233

234234

235-
# https://github.com/python/mypy/issues/9031
236-
class DataArrayResample( # type: ignore[misc]
235+
class DataArrayResample(
237236
Resample["DataArray"], DataArrayGroupByBase, DataArrayResampleAggregations
238237
):
239238
"""DataArrayGroupBy object specialized to time resampling operations over a
@@ -375,8 +374,7 @@ def asfreq(self) -> DataArray:
375374
return self.mean(None if self._dim is None else [self._dim])
376375

377376

378-
# https://github.com/python/mypy/issues/9031
379-
class DatasetResample( # type: ignore[misc]
377+
class DatasetResample(
380378
Resample["Dataset"], DatasetGroupByBase, DatasetResampleAggregations
381379
):
382380
"""DatasetGroupBy object specialized to resampling a specified dimension"""

0 commit comments

Comments
 (0)