-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Display data returned in apply_ufunc
error message
#8179
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
Conversation
This makes debugging much easier!
xarray/core/computation.py
Outdated
f"number of dimensions. Received {data.ndim} dimension(s) but " | ||
f"expected {len(dims)} dimensions with names: {dims!r}" | ||
f"expected {len(dims)} dimensions with names: {dims!r}. The data returned " | ||
f"was:\n\n{data!r}" |
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.
Another option would to log this sort of info. It's not a "full report" of the error, since there might be other data
s.
(I would vote to merge and then change in the future if it turns out to be confusing, but if someone has a different view I'm v happy to make changes)
for more information, see https://pre-commit.ci
apply_ufunc
error message
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.
Seems helpful! Thanks
+1 for typing improvements
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.
Very nice, I had one comment.
(sorry for the late review)
PS: It's great to have you back, Max!
Based on the correct observation in pydata#8179 (comment) (slightly adjusted message)
* Adjust ufunc error message Based on the correct observation in #8179 (comment) (slightly adjusted message) * Update xarray/core/computation.py Co-authored-by: Deepak Cherian <[email protected]> * Update xarray/core/computation.py --------- Co-authored-by: Deepak Cherian <[email protected]>
* Adjust ufunc error message Based on the correct observation in pydata#8179 (comment) (slightly adjusted message) * Update xarray/core/computation.py Co-authored-by: Deepak Cherian <[email protected]> * Update xarray/core/computation.py --------- Co-authored-by: Deepak Cherian <[email protected]>
This makes debugging much easier!