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

Raise ValueError on ambiguous boolean conversion and add pending NumPy functions/ufuncs from issue tracker #965

Merged
merged 2 commits into from
Dec 30, 2019

Conversation

jthielen
Copy link
Contributor

There were a few follow-up issues from #905 that were missing fairly simple implementations, so this PR takes care of them in preparation for the upcoming release.

Part of this was resolving #866 by raising a ValueError due to ambiguity when casting Quantities with offset units to boolean, which is technically a breaking change (although I would argue that the previous behavior was incorrect as discussed in #866).

Also, @keewis, this implements np.any and np.all, which are two of the functions you had mentioned were needed by xarray. I think now the only one still missing is np.prod (#867) which will likely have to wait since there hasn't been a good solution yet.

@hgrecco
Copy link
Owner

hgrecco commented Dec 30, 2019

Awesome. Great work

@hgrecco hgrecco closed this Dec 30, 2019
@jthielen
Copy link
Contributor Author

jthielen commented Dec 30, 2019

Awesome. Great work

@hgrecco Thanks! Although, is there a reason you closed this instead of bors r+?

@hgrecco
Copy link
Owner

hgrecco commented Dec 30, 2019

bors r+

@bors
Copy link
Contributor

bors bot commented Dec 30, 2019

Already running a review

@hgrecco
Copy link
Owner

hgrecco commented Dec 30, 2019

@hgrecco is there a reason you closed this instead of bors r+?

my mistake!

@hgrecco
Copy link
Owner

hgrecco commented Dec 30, 2019

bors r+

@bors
Copy link
Contributor

bors bot commented Dec 30, 2019

Already running a review

@hgrecco hgrecco reopened this Dec 30, 2019
@hgrecco
Copy link
Owner

hgrecco commented Dec 30, 2019

bors r+

bors bot added a commit that referenced this pull request Dec 30, 2019
965: Raise ValueError on ambiguous boolean conversion and add pending NumPy functions/ufuncs from issue tracker r=hgrecco a=jthielen

There were a few follow-up issues from #905 that were missing fairly simple implementations, so this PR takes care of them in preparation for the upcoming release.

Part of this was resolving #866 by raising a `ValueError` due to ambiguity when casting Quantities with offset units to boolean, which is technically a breaking change (although I would argue that the previous behavior was incorrect as discussed in #866).

Also, @keewis, this implements `np.any` and `np.all`, which are two of the functions you had mentioned were needed by xarray. I think now the only one still missing is `np.prod` (#867) which will likely have to wait since there hasn't been a good solution yet.

- [x] Closes #419; Closes #470; Closes #807; Closes #866
- [x] Executed ``black -t py36 . && isort -rc . && flake8`` with no errors
- [x] The change is fully covered by automated unit tests
- [x] Documented in docs/ as appropriate
- [x] Added an entry to the CHANGES file


Co-authored-by: Jon Thielen <[email protected]>
@bors
Copy link
Contributor

bors bot commented Dec 30, 2019

Build succeeded

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