Skip to content
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

map_over_datasets: fix error message for wrong result type #10016

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mathause
Copy link
Collaborator

The error message did not indicate the name of the node which is fixed here.

It shows '.' for the root node while the repr uses / which is maybe confusing. This comes from using NodePath() - maybe this should be changed to NodePath("/")?

queue = collections.deque([(NodePath(), self)])

@mathause
Copy link
Collaborator Author

Ok, I also found it helpful to have the result on a new line.

before:

TypeError: the result of calling func on the node at position 'ssp126' is not a Dataset or None or a tuple of such types: <xarray.DataArray 'selected_ar_order' (member: 1)> Size: 8B
array([2.])
Coordinates:
  * member   (member) <U8 32B 'r1i1p1f1'

now:

TypeError: the result of calling func on the node at position 'ssp126' is not a Dataset or None or a tuple of such types:
<xarray.DataArray 'selected_ar_order' (member: 1)> Size: 8B
array([2.])
Coordinates:
  * member   (member) <U8 32B 'r1i1p1f1'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant