DEP: Deprecate ufunc.outer with matrix inputs#16232
Merged
Merged
Conversation
2dece73 to
b7e5630
Compare
Member
|
LGTM, and I would even vote for putting it into 1.19. @charris - thoughts? |
Member
Author
|
To be fair: |
b7e5630 to
7b9ad80
Compare
Member
Author
|
Well, since its all branched, I updated the comments to say 1.20 (it was actually inconsistent before...) |
This simplifies the reshaping logic to use the NewShape function (this was previously impossible due to the split of umath and multiarray). It adds new errors if reshapes are bad, which currently is only possible for bad subclasses. However, `np.matrix` is the main bad subclass here, so this is in preparation of deprecating it.
7b9ad80 to
f68ba8d
Compare
Member
Author
|
Should we just put this in now? |
Previously we converted matrices to arrays for the user, since `np.outer` does not make sense for matrix. This deprecates that usage (which in almost all cases will result in an error). The main reason for this deprecation is to remove all direct references of matrix from the NumPy codebase, so that it is easier to move it out of NumPy eventually.
f68ba8d to
4e8e928
Compare
Member
|
Thanks @seberg. |
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.
Previously we converted matrices to arrays for the user, since
np.outerdoes not make sense for matrix. This deprecates thatusage (which in almost all cases will result in an error).
The main reason for this deprecation is to remove all direct
references of matrix from the NumPy codebase, so that it is
easier to move it out of NumPy eventually.
I can spin off the first maintenance commit if anyone feels the deprecation is trivial...
EDIT: xref gh-15105 which this closes, but I will remove the 1.19 milestone, since this doesn't really need to be in 1.19. It might just make the next steps to get rid of matrix a tiny bit simpler.
EDIT: For reviewers, the commits are probably best reviewed separately, just to disentangle things a bit. Both should be very straight forward.