DEP: remove deprecated 'full' and 'economic' modes from numpy.linalg.qr#31387
Conversation
|
Please fill in the AI disclosure from the PR template that you ignored |
|
Updated the PR description with the AI disclosure. Thanks for the heads up! |
seberg
left a comment
There was a problem hiding this comment.
Thanks! Please try to avoid those style changes and the linter is failing right now (long line).
I also think we should just not mention the old path, since it is deprecated for many many years.
If this was still used a lot, the path would be a VisibleDeprecationWarning, but hopefully we can get away with this since Python got better at showing DeprecationWarning's.
|
|
||
| """ | ||
| def test_qr_mode_full_removed(): | ||
| """Check mode='full' and mode='economic' raise ValueError after removal in NumPy 2.5.""" |
| backward compatibility can be maintained by letting `mode` default. | ||
| NumPy 1.8.0 and the old option 'full' was made an alias of 'reduced'. | ||
| The deprecated 'full' and 'economic' modes were removed in NumPy 2.5. | ||
| Use 'reduced' instead of 'full', and 'raw' instead of 'economic'. |
There was a problem hiding this comment.
I think we should just remove the whole note about any changes. 1.8 is too long ago to bother about things being "new" and the error is already plenty as an assistance for anyone who didn't act on the deprecation warning.
|
Addressed the review, removed the historical note from the docstring, fixed the long line, and restored the original test file formatting. Thanks for the feedback! |
seberg
left a comment
There was a problem hiding this comment.
Thanks, let's give this a shot.
If anyone runs into this in real-world code or things the old modes are still used a lot, please let us know and we could go back to a VisibleDeprecationWarning.
PR summary
Closes gh-11521 (partial)
The
'full','f','economic', and'e'modes ofnumpy.linalg.qrwere deprecated in NumPy 1.8.0 (2013-04-01). This PR removes them now
that we are at v2.5.0.dev0.
Changes:
DeprecationWarningbranches for'full'/'f'and'economic'/'e'ValueErrorfor these modes insteadmode == 'economic'return branchimport warningstest_deprecations.pyto expectValueErrorinstead ofDeprecationWarningdoc/release/upcoming_changes/First time committer introduction
Hi! I'm Ashutosh, a Data Scientist working on ML systems (XGBoost, LSTM)
for credit risk modeling. I contribute to open source ML libraries in my
spare time.
AI Disclosure
I used Claude (AI assistant) to help navigate the codebase and understand
where the deprecated code lived. The actual changes, removing the warning
branches, updating the docstring, fixing the tests, and adding the release
note were performed/reviewed and understood by me before submitting.