Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from pydata:main #590

Merged
merged 3 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report

- name: Upload mypy coverage to Codecov
uses: codecov/[email protected].2
uses: codecov/[email protected].7
with:
file: mypy_report/cobertura.xml
flags: mypy
Expand Down Expand Up @@ -174,7 +174,7 @@ jobs:
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report

- name: Upload mypy coverage to Codecov
uses: codecov/[email protected].2
uses: codecov/[email protected].7
with:
file: mypy_report/cobertura.xml
flags: mypy-min
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:
python -m pyright xarray/

- name: Upload pyright coverage to Codecov
uses: codecov/[email protected].2
uses: codecov/[email protected].7
with:
file: pyright_report/cobertura.xml
flags: pyright
Expand Down Expand Up @@ -286,7 +286,7 @@ jobs:
python -m pyright xarray/

- name: Upload pyright coverage to Codecov
uses: codecov/[email protected].2
uses: codecov/[email protected].7
with:
file: pyright_report/cobertura.xml
flags: pyright39
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ jobs:
path: pytest.xml

- name: Upload code coverage to Codecov
uses: codecov/[email protected].2
uses: codecov/[email protected].7
with:
file: ./coverage.xml
flags: unittests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upstream-dev-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
run: |
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
- name: Upload mypy coverage to Codecov
uses: codecov/[email protected].2
uses: codecov/[email protected].7
with:
file: mypy_report/cobertura.xml
flags: mypy
Expand Down
2 changes: 2 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Deprecations

Bug fixes
~~~~~~~~~
- Fix type annotations for ``get_axis_num``. (:issue:`9822`, :pull:`9827`).
By `Bruce Merry <https://github.com/bmerry>`_.
- Fix unintended load on datasets when calling :py:meth:`DataArray.plot.scatter` (:pull:`9818`).
By `Jimmy Westling <https://github.com/illviljan>`_.

Expand Down
3 changes: 3 additions & 0 deletions xarray/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ def __iter__(self: Any) -> Iterator[Any]:
raise TypeError("iteration over a 0-d array")
return self._iter()

@overload
def get_axis_num(self, dim: str) -> int: ... # type: ignore [overload-overlap]

@overload
def get_axis_num(self, dim: Iterable[Hashable]) -> tuple[int, ...]: ...

Expand Down
3 changes: 2 additions & 1 deletion xarray/core/dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -7081,7 +7081,8 @@ def rolling(
(otherwise result is NA). The default, None, is equivalent to
setting min_periods equal to the size of the window.
center : bool or Mapping to int, default: False
Set the labels at the center of the window.
Set the labels at the center of the window. The default, False,
sets the labels at the right edge of the window.
**window_kwargs : optional
The keyword arguments form of ``dim``.
One of dim or window_kwargs must be provided.
Expand Down
3 changes: 2 additions & 1 deletion xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -10728,7 +10728,8 @@ def rolling(
(otherwise result is NA). The default, None, is equivalent to
setting min_periods equal to the size of the window.
center : bool or Mapping to int, default: False
Set the labels at the center of the window.
Set the labels at the center of the window. The default, False,
sets the labels at the right edge of the window.
**window_kwargs : optional
The keyword arguments form of ``dim``.
One of dim or window_kwargs must be provided.
Expand Down
6 changes: 4 additions & 2 deletions xarray/core/rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ def __init__(
(otherwise result is NA). The default, None, is equivalent to
setting min_periods equal to the size of the window.
center : bool, default: False
Set the labels at the center of the window.
Set the labels at the center of the window. The default, False,
sets the labels at the right edge of the window.

Returns
-------
Expand Down Expand Up @@ -793,7 +794,8 @@ def __init__(
(otherwise result is NA). The default, None, is equivalent to
setting min_periods equal to the size of the window.
center : bool or mapping of hashable to bool, default: False
Set the labels at the center of the window.
Set the labels at the center of the window. The default, False,
sets the labels at the right edge of the window.

Returns
-------
Expand Down
3 changes: 3 additions & 0 deletions xarray/namedarray/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,9 @@ def _dask_finalize(
data = array_func(results, *args, **kwargs)
return type(self)(self._dims, data, attrs=self._attrs)

@overload
def get_axis_num(self, dim: str) -> int: ... # type: ignore [overload-overlap]

@overload
def get_axis_num(self, dim: Iterable[Hashable]) -> tuple[int, ...]: ...

Expand Down
Loading