Skip to content
forked from pydata/xarray

Commit

Permalink
Update to mypy1.7 (pydata#8501)
Browse files Browse the repository at this point in the history
* fix mypy1.7 errors

* pin mypy to <1.8

* add entry to whats-new
  • Loading branch information
headtr1ck authored Dec 1, 2023
1 parent 4550a01 commit abd2068
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
python xarray/util/print_versions.py
- name: Install mypy
run: |
python -m pip install "mypy<1.7" --force-reinstall
python -m pip install "mypy<1.8" --force-reinstall
- name: Run mypy
run: |
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
python xarray/util/print_versions.py
- name: Install mypy
run: |
python -m pip install "mypy<1.7" --force-reinstall
python -m pip install "mypy<1.8" --force-reinstall
- name: Run mypy
run: |
Expand Down
2 changes: 2 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ Internal Changes
- :py:meth:`DataArray.bfill` & :py:meth:`DataArray.ffill` now use numbagg by
default, which is up to 5x faster where parallelization is possible. (:pull:`8339`)
By `Maximilian Roos <https://github.com/max-sixty>`_.
- Update mypy version to 1.7 (:issue:`8448`, :pull:`8501`).
By `Michael Niklas <https://github.com/headtr1ck>`_.

.. _whats-new.2023.11.0:

Expand Down
4 changes: 2 additions & 2 deletions xarray/core/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ def align(
...


def align( # type: ignore[misc]
def align(
*objects: T_Alignable,
join: JoinOptions = "inner",
copy: bool = True,
Expand Down Expand Up @@ -1153,7 +1153,7 @@ def broadcast(
...


def broadcast( # type: ignore[misc]
def broadcast(
*args: T_Alignable, exclude: str | Iterable[Hashable] | None = None
) -> tuple[T_Alignable, ...]:
"""Explicitly broadcast any number of DataArray or Dataset objects against
Expand Down
4 changes: 2 additions & 2 deletions xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -7979,8 +7979,8 @@ def sortby(
variables = variables
arrays = [v if isinstance(v, DataArray) else self[v] for v in variables]
aligned_vars = align(self, *arrays, join="left")
aligned_self = aligned_vars[0]
aligned_other_vars: tuple[DataArray, ...] = aligned_vars[1:]
aligned_self = cast("Self", aligned_vars[0])
aligned_other_vars = cast(tuple[DataArray, ...], aligned_vars[1:])
vars_by_dim = defaultdict(list)
for data_array in aligned_other_vars:
if data_array.ndim != 1:
Expand Down

0 comments on commit abd2068

Please sign in to comment.