Quantity updates for numpy dev - #3860
Merged
Merged
Conversation
mhvk
force-pushed
the
quantity-updates-for-numpy-dev
branch
from
June 17, 2015 23:51
e5fdb14 to
82415ef
Compare
Contributor
Author
|
Note: the numpy-dev travis build still fails because of numpy/numpy#5962. I checked locally, though, that with that PR it passes. |
Contributor
Author
Contributor
Author
In numpy-dev, the __index__ can no longer be used to multiply lists; for discussion about why, really, this was always broken & wrong, see numpy/numpy#5864.
mhvk
force-pushed
the
quantity-updates-for-numpy-dev
branch
from
June 24, 2015 23:04
82415ef to
c36ce6f
Compare
Contributor
Author
|
With #3871 resolved, appveyor is now happy too. Ready for final review! |
Member
|
Makes sense, thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WIth numpy/numpy#5964 (for more discussion, see numpy/numpy#5864), a lot of
NotImplementedhandling is removed from the ufuncs. As a result,np.ufuncdoes not returnNotImplementedany more. This makes much more sense, but brought an inconsistency in our usage to the front, where inQuantity.__mul__we callednp.multiplydirectly, rather than lettingndarray.__mul__take care (which can returnNotImplemented). This PR corrects that oversight. (I wrote the original myself and am slightly worried there was a reason -- but travis will hopefully tell).In addition, the above numpy PRs broke the use of
a * list, where ifawas integer it would be used to make multiple versions of the list. It was actually rather surprising this ever worked (see numpy PR discussion), and so it was decided not to continue to support that in numpy. Since there seems to be no reason really to support that inQuantityeither, I changed the tests to more narrowly focus on whetherQuantity.__index__()does the right thing.