xarray
xarray copied to clipboard
update numpy version requirement
What happened?
in the latest xarray version 2022.06.0, xarray.DataArray.quantile supports 9 methods: https://docs.xarray.dev/en/latest/generated/xarray.DataArray.quantile.html
however, those methods are only implemented starting from numpy 1.22.0 https://numpy.org/doc/stable/reference/generated/numpy.quantile.html
whereas the current numpy requirement is only numpy >= 1.19
What did you expect to happen?
that the numpy requirement is updated to numpy >= 1.22
Minimal Complete Verifiable Example
No response
MVCE confirmation
- [ ] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
- [ ] Complete example — the example is self-contained, including all data and the text of any traceback.
- [ ] Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
- [ ] New issue — a search of GitHub Issues suggests this is not a duplicate.
Relevant log output
No response
Anything else we need to know?
No response
Environment
What exactly is the problem? As clearly stated in the documentation that you linked the supported methods depend on your installed numpy version.
The oldest numpys version that will be supported is at least 18 month old, so 1.19 is still correct.
we could probably have a nicer error message, the one from numpy
might be a bit confusing:
ValueError: interpolation can only be 'linear', 'lower' 'higher', 'midpoint', or 'nearest'
Maybe something like this?
ValueError: interpolation method '{method}' requires numpy >= 1.22
Edit: while we're at it, we could also make that caveat in the docstring a bit easier to see by moving it to its own paragraph within the the parameter description, and actually add a literal *
somewhere
As clearly stated in the documentation that you linked the supported methods depend on your installed numpy version.
indeed, I should have read the docs more carefully.
it's a bit annoying though: from the requirements I expected that numpy 1.19 would provide full support for all methods that xarray provides. maybe you could add a comment to the setup.cfg file along the lines of "recommended numpy version >= 1.22" to better indicate this?
I am not a direct user of this package, I just install it for our HPC users, but your suggestions to improve the error message and docs seem good to me.
maybe you could add a comment to the setup.cfg file along the lines of "recommended numpy version >= 1.22" to better indicate this?
Do people really look into the setup.cfg
file when installing a package? I would assume >99% of the people simply do pip/conda install xarray
But I guess a comment does not hurt anyone.
Do people really look into the
setup.cfg
file when installing a package?
yes, especially people like me who do central software installations in a HPC cluster (for example with EasyBuild) and who want to have full control over the package versions that are installed (which is essential for scientific reproducibility). this is indeed a small minority, but note that a lot of people are using our centrally installed packages.