Uh oh!
There was an error while loading. Please reload this page.
make more args kw only (except 'dim') - #6403
Conversation
max-sixty
commented
Mar 23, 2022
mathause
commented
Mar 23, 2022
Sounds good - I'll add a deprecation. We might also want to do this for https://github.com/pydata/xarray/blob/main/xarray/core/_reductions.py |
1 similar comment
mathause
commented
Mar 23, 2022
Sounds good - I'll add a deprecation. We might also want to do this for https://github.com/pydata/xarray/blob/main/xarray/core/_reductions.py |
dcherian
commented
Mar 23, 2022
👍 I lost track of it given that PR was open for so long. IIRC one issue is that the order of args was different forr Dataset.reduce vs DatasetGroupBy.reduce (cc @Illviljan) |
mathause
commented
Mar 23, 2022
From #5950 (comment)
|
Yes, mypy found some issues with the ordering so moving to kwargs-only was my preferred solution. |
max-sixty
commented
Sep 30, 2023
I would vote to resurrect this! Deprecations are nice but I would vote to merge this without them given that it seems that we won't merge it with them... (We can do it on a minor release and announce it) What do folks think? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
mathause
commented
Oct 2, 2023
Happy to revive this PR. We do have a |
Uh oh!
There was an error while loading. Please reload this page.
mathause
commented
Oct 2, 2023
I think the failure is a fluke. Open/ close |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Michael Niklas <mick.niklas@gmail.com>
headtr1ck
left a comment
There was a problem hiding this comment.
Looks good now, thanks!
* upstream/main: (46 commits) xfail flaky test (pydata#8299) Most of mypy 1.6.0 passing (pydata#8296) Rename `reset_encoding` to `drop_encoding` (pydata#8287) Enable `.rolling_exp` to work on dask arrays (pydata#8284) Fix `GroupBy` import (pydata#8286) Ask bug reporters to confirm they're using a recent version of xarray (pydata#8283) Add pyright type checker (pydata#8279) Improved typing of align & broadcast (pydata#8234) Update ci-additional.yaml (pydata#8280) Fix time encoding regression (pydata#8272) Allow a function in `.sortby` method (pydata#8273) make more args kw only (except 'dim') (pydata#6403) Use duck array ops in more places (pydata#8267) Don't raise rename warning if it is a no operation (pydata#8266) Mandate kwargs on `to_zarr` (pydata#8257) copy the `dtypes` module to the `namedarray` package. (pydata#8250) Add xarray-regrid to ecosystem.rst (pydata#8270) Use strict type hinting for namedarray (pydata#8241) Update type annotation for center argument of dataaray_plot methods (pydata#8261) [pre-commit.ci] pre-commit autoupdate (pydata#8262) ...
whats-new.rstapi.rstThis makes many arguments keyword-only, except for
dimto avoidda.weighted(...).mean("lat", "lon")(i.e.da.weighted(...).mean(dim="lat", skipna="lon")) which silently does the wrong thing. I am sure I forgot some and for some I was unsure so I left them as is.Question: do we want an deprecation cycle? Currently it just errors for
da.weighted(...).mean("dim", True). Might be nice to do it, however, @dcherian if I am not mistaken you did this without a deprecation in #5950, e.g. forda.meanetc.?