-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
pint support for Dataset #3975
pint support for Dataset #3975
Conversation
it still does not check the content of the repr, though
This also adds tests for units in indexes, which are by default stripped.
this test is marked as skipped because the unit registry always returns numpy.array objects which are not hashable, so the initial dataset with units cannot be constructed (the result of to_stacked_array wouldn't be correct either because IndexVariable doesn't support units)
it seems Edit: Also, because it casted to |
since the feedstock seems to take a while
Thanks for working on this @keewis . Since there are no changes outside |
I just found another issue: I don't really understand the purpose of For now, I think we can merge this PR on green and I'll add that issue to the list in #3594. |
Looks like an incompatibility with latest pandas
|
yeah, I don't know how to only filter for Edit: |
…o-combine * 'master' of github.com:pydata/xarray: (81 commits) use builtin python types instead of the numpy alias (pydata#4170) Revise pull request template (pydata#4039) pint support for Dataset (pydata#3975) drop eccodes in docs (pydata#4162) Update issue templates inspired/based on dask (pydata#4154) Fix failing upstream-dev build & remove docs build (pydata#4160) Improve typehints of xr.Dataset.__getitem__ (pydata#4144) provide a error summary for assert_allclose (pydata#3847) built-in accessor documentation (pydata#3988) Recommend installing cftime when time decoding fails. (pydata#4134) parameter documentation for DataArray.sel (pydata#4150) speed up map_blocks (pydata#4149) Remove outdated note from datetime accessor docstring (pydata#4148) Fix the upstream-dev pandas build failure (pydata#4138) map_blocks: Allow passing dask-backed objects in args (pydata#3818) keep attrs in reset_index (pydata#4103) Fix open_rasterio() for WarpedVRT with specified src_crs (pydata#4104) Allow non-unique and non-monotonic coordinates in get_clean_interp_index and polyfit (pydata#4099) update numpy's intersphinx url (pydata#4117) xr.infer_freq (pydata#4033) ...
* upstream/master: (21 commits) fix typo in error message in plot.py (pydata#4188) Support multiple dimensions in DataArray.argmin() and DataArray.argmax() methods (pydata#3936) Show data by default in HTML repr for DataArray (pydata#4182) Blackdoc (pydata#4177) Add CONTRIBUTING.md for the benefit of GitHub Correct dask handling for 1D idxmax/min on ND data (pydata#4135) use assert_allclose in the aggregation-with-units tests (pydata#4174) Remove old auto combine (pydata#3926) Fix 4009 (pydata#4173) Limit length of dataarray reprs (pydata#3905) Remove <pre> from nested HTML repr (pydata#4171) Proposal for better error message about in-place operation (pydata#3976) use builtin python types instead of the numpy alias (pydata#4170) Revise pull request template (pydata#4039) pint support for Dataset (pydata#3975) drop eccodes in docs (pydata#4162) Update issue templates inspired/based on dask (pydata#4154) Fix failing upstream-dev build & remove docs build (pydata#4160) Improve typehints of xr.Dataset.__getitem__ (pydata#4144) provide a error summary for assert_allclose (pydata#3847) ...
This is part of the effort to add support for
pint
(see #3594) toDataset
objects (although it will probably be a test-only PR, just like #3643).isort -rc . && black . && mypy . && flake8
whats-new.rst
for all changes andapi.rst
for new APIThe list of failing tests from #3594:
__init__
: Needs unit support in IndexVariable, and merge does not work yet (test bug is also possible)xarray
does not implement__array_function__
(see running numpy functions on xarray objects #3917)rank
: depends onbottleneck
and thus only works withnumpy.array
ffill
,bfill
: usesbottleneck
interpolate_na
: usesnumpy.vectorize
, which does not support NEP-18, yetequals
,identical
: works (but no units / unit checking inIndexVariable
)broadcast_like
: works (but no units / unit checking inIndexVariable
)to_stacked_array
: no units inIndexVariable
sel
,loc
: no units inIndexVariable
interp
,reindex
: partially blocked byIndexVariable
.reindex
works with units indata
, butinterp
usesscipy
interp_like
,reindex_like
: same asinterp
/reindex
quantile
: works, but needspint
>= 0.12groupby_bins
: needspint
>= 0.12 (forisclose
)rolling
: usesnumpy.lib.stride_tricks.as_strided
rolling_exp
: usesnumbagg
(supports NEP-18, butpint
doesn't support its functions)