Skip to content

Raise an informative error message when converting Dataset -> np.ndarray #2032

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

Merged
merged 2 commits into from
Apr 3, 2018

Conversation

shoyer
Copy link
Member

@shoyer shoyer commented Mar 31, 2018

Makes np.asarray(dataset) issue an informative error. Currently,
np.asarray(xr.Dataset({'x': 0})) raises KeyError: 0, which makes no sense.

  • Tests added (for all bug fixes or enhancements)
  • Tests passed (for all non-documentation changes)
  • Fully documented, including whats-new.rst for all changes and api.rst for new API (remove if this change should not be visible to users, e.g., if it is an internal clean-up, or if this is part of a larger project that will be documented later)

Makes `np.asarray(dataset)` issue an informative error. Currently,
`np.asarray(xr.Dataset({'x': 0}))` raises `KeyError: 0`, which makes no sense.
@shoyer shoyer mentioned this pull request Mar 31, 2018
3 tasks
@shoyer shoyer merged commit a90a7c5 into pydata:master Apr 3, 2018
@shoyer shoyer deleted the asarray-raise branch April 3, 2018 00:44
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