-
-
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
provide a error summary for assert_allclose #3847
Conversation
Looks great! |
the failures should be a bug in |
Let's mark those as xfail then? |
now only the |
to me the failing tests on the Also, where should I put the |
Our minimum versions policy allows us to bump dask. So let's do that?
New features? It is public API and is a very nice enhancement. |
unfortunately, we need |
The issue is with how I really lack experience with |
5df4d33
to
0220f45
Compare
@pydata/xarray, this is really close but I'm not familiar enough with Once we get the Edit: there seem to be a few failing tests related to |
I'm confused here. What did you change to trigger this error? ALL WRONG: xarray/xarray/core/duck_array_ops.py Lines 203 to 204 in 69548df
EDIT: ignore this. We can't compute because it might blow memory. |
example failure:
|
Unfortunately, simply replacing Would it make sense to wait until we can bump the dask version to |
Sounds good to me. It's only 1.5 months away |
I needed to use |
How about we call This compute was happening in previous versions anyway (because |
let's see if that works |
This was intentional, I think. |
hmm... using @shoyer: I'm confused, I thought that Line 124 in e5cc19c
Lines 132 to 135 in e5cc19c
where the .values always convert to numpy
|
Right, it explicitly supports duck arrays -- by always converting them into NumPy! |
then it seems that this PR removes this intentional restriction. I'm not sure it is still needed, though: we don't use xarray/xarray/core/duck_array_ops.py Line 204 in e5cc19c
which should allow dispatching |
anyway, with this the tests finally pass 🎉 so this should be ready for review and merging. |
gentle ping, @shoyer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks @keewis
@@ -1413,6 +1428,13 @@ def example_1d_objects(self): | |||
]: | |||
yield (self.cls("x", data), data) | |||
|
|||
# TODO: remove once pint==0.12 has been released | |||
@pytest.mark.xfail( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like pint 0.12 is out. Shall we remove these xfails now or do you want to do that later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think something went wrong with the release of 0.12
so I'd like to wait until I got a response from the maintainer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Sounds good. IMO we should merge this.
unless there are any objections (@shoyer?) I'm going to merge this tomorrow. |
Do you need to add a note to what's new that the dask version is bumped? |
I think we could bump the version even further (at least to |
…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) ...
right now, unlike
assert_identical
andassert_equals
,assert_allclose
simply prints the mismatching data without providing a summary about what failed. This tries to fix that by allowing thecompat
parameter toformatting.diff_array_repr
andformatting.diff_dataset_repr
to be a callable and by rewritingassert_allclose
to only have one assert statement per type.isort -rc . && black . && mypy . && flake8
whats-new.rst
for all changes andapi.rst
for new APIThere are still more tests to write but I would like to get early feedback about this approach vs. adding a
"allclose"
compat type in addition to the existing"equals"
and"identical"
to the formatting functions.