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
DEP: linalg: improve deprecation of private modules named without underscore prefix #19035
Conversation
@@ -14,7 +14,7 @@ def __getattr__(name): | |||
if name not in __all__: | |||
raise AttributeError( | |||
"scipy.linalg.flinalg is deprecated and has no attribute " | |||
f"{name}. Try looking in scipy.linalg instead.") | |||
f"{name}.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't sure about the best course of action here. Everything in the __all__
of this module doesn't appear in scipy.linalg
. This means if _sub_module_deprecation
was used then they would all be stated for removal from __all__
in 1.13.0 but then there would be nothing left in the module. However, the module isn't due to be removed until 2.0.0 hence why I just modified the message directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't remove it just to stay out of your deprecation efforts, but indeed it is empty. So we can remove it since det
and lu
was living in here. And they are already available under linalg namespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it strange that we're keeping around an empty module, but the warning has already promised that'd we'd only remove it for 2.0.0, so 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess nobody anticipated that we would touch Fortran code. But I think that promise is void now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #19072
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! :)
@@ -14,7 +14,7 @@ def __getattr__(name): | |||
if name not in __all__: | |||
raise AttributeError( | |||
"scipy.linalg.flinalg is deprecated and has no attribute " | |||
f"{name}. Try looking in scipy.linalg instead.") | |||
f"{name}.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it strange that we're keeping around an empty module, but the warning has already promised that'd we'd only remove it for 2.0.0, so 🤷
Everyone happy if we hit the button? |
Actually, this now needs to take into account the changes from #19067, e.g. we need to remove the
|
updated |
Thanks @j-bowhay! :) |
Reference issue
toward #18279
What does this implement/fix?
Currently some of the deprecation warnings for private modules named without underscore prefix are misleading. For example:
Before this pr:
After:
This also reduces code duplication and strengthens testing.
Additional information