DEP: Deprecate ufunc.outer with matrix inputs #16232
Merged
+109
−24
Conversation
|
LGTM, and I would even vote for putting it into 1.19. @charris - thoughts? |
|
To be fair: |
|
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.
|
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.
56c7539
into
numpy:master
20 checks passed
20 checks passed
azure-pipeline numpy.numpy (ComprehensiveTests Linux_PyPy3)
ComprehensiveTests Linux_PyPy3 succeeded
Details
azure-pipeline numpy.numpy (ComprehensiveTests Linux_Python_38_32bit_full_with_asserts)
ComprehensiveTests Linux_Python_38_32bit_full_with_asserts succeeded
Details
azure-pipeline numpy.numpy (ComprehensiveTests Linux_gcc48)
ComprehensiveTests Linux_gcc48 succeeded
Details
azure-pipeline numpy.numpy (ComprehensiveTests Windows Python36-64bit-full)
ComprehensiveTests Windows Python36-64bit-full succeeded
Details
azure-pipeline numpy.numpy (ComprehensiveTests Windows Python37-64bit-full)
ComprehensiveTests Windows Python37-64bit-full succeeded
Details
azure-pipeline numpy.numpy (ComprehensiveTests Windows Python38-32bit-fast)
ComprehensiveTests Windows Python38-32bit-fast succeeded
Details
azure-pipeline numpy.numpy (ComprehensiveTests Windows Python38-64bit-full)
ComprehensiveTests Windows Python38-64bit-full succeeded
Details
azure-pipeline numpy.numpy (ComprehensiveTests macOS Python36)
ComprehensiveTests macOS Python36 succeeded
Details
azure-pipeline numpy.numpy (ComprehensiveTests macOS Python36-ILP64)
ComprehensiveTests macOS Python36-ILP64 succeeded
Details
azure-pipeline numpy.numpy (InitialTests WindowsFast Python36-64bit-fast)
InitialTests WindowsFast Python36-64bit-fast succeeded
Details
|
Thanks @seberg. |
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.
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.