Skip to content

Commit

Permalink
Fix polyval overloads (#7315)
Browse files Browse the repository at this point in the history
* fix polyval overloads

* add to whatsnew
  • Loading branch information
headtr1ck authored Nov 26, 2022
1 parent fb42ef9 commit 4e9535a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ Bug fixes

- Import ``nc_time_axis`` when needed (:issue:`7275`, :pull:`7276`).
By `Michael Niklas <https://github.com/headtr1ck>`_.
- Fix static typing of :py:meth:`xr.polyval` (:issue:`7312`, :pull:`7315`).
By `Michael Niklas <https://github.com/headtr1ck>`_.

Documentation
~~~~~~~~~~~~~
Expand Down
16 changes: 12 additions & 4 deletions xarray/core/computation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1876,22 +1876,30 @@ def where(cond, x, y, keep_attrs=None):


@overload
def polyval(coord: DataArray, coeffs: DataArray, degree_dim: Hashable) -> DataArray:
def polyval(
coord: DataArray, coeffs: DataArray, degree_dim: Hashable = "degree"
) -> DataArray:
...


@overload
def polyval(coord: DataArray, coeffs: Dataset, degree_dim: Hashable) -> Dataset:
def polyval(
coord: DataArray, coeffs: Dataset, degree_dim: Hashable = "degree"
) -> Dataset:
...


@overload
def polyval(coord: Dataset, coeffs: DataArray, degree_dim: Hashable) -> Dataset:
def polyval(
coord: Dataset, coeffs: DataArray, degree_dim: Hashable = "degree"
) -> Dataset:
...


@overload
def polyval(coord: Dataset, coeffs: Dataset, degree_dim: Hashable) -> Dataset:
def polyval(
coord: Dataset, coeffs: Dataset, degree_dim: Hashable = "degree"
) -> Dataset:
...


Expand Down

0 comments on commit 4e9535a

Please sign in to comment.