-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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: stats: deprecate function-specific versions of warnings #16266
Conversation
I understand the sentiment - raising a separate issue can appear noisy - but I think the results of #15765 do make a case for it IMO:
|
I agree and would add the part of the reason it has been so noisy is that so many previous deprecations have slipped through the net which means there has been a lot to catch up on. I think once everything has been tided it the amount of noise will decrease significantly. |
As discussed in the community meeting today: let's ensure to have a single issue per future release going forward, with the appropriate details of what must be done. Having many issues like we had for tackling the deprecations in 1.9.0 is not a problem; what is a problem is having many issues that aren't actually actionable. The single issue that is actionable next year can then be expanded into multiple when it becomes actionable (if desired). |
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 @mdhaber. This doesn't look quite right to me: the deprecation warning won't actually be triggered by the use of stats.F_onewayBadInputSizesWarning
or other classes.
The docstring edits don't appear it looks like, but I'd prefer not to have them there - nothing in f_oneway
itself is deprecated.
I believe a better way of doing this is to add a __getattr__
in stats/__init__.py
, and emitting a warning when using a class. And no docs changes other than in the release notes.
i.e. in the
What is this for? Would this raise upon import? That doesn't sound desirable. I don't think we do that for any other functions/classes that we deprecate.
True. I didn't imagine that users are instantiating these classes themselves; I covered the case in which they
Weird.
I agree that nothing in That said, I don't enjoy fighting with Sphinx, so if you don't think it's needed, I'll remove it. Update: done. |
No, because the way you use these warning objects means you never instantiate them (see for example the test cases you touch here). I really mean "if a user types
Just have a look at the many def __getattr__(name):
if name == 'F_onewayBadInputSizesWarning':
warnings.warn("F_onewayBadInputSizesWarning is deprecated, please use ...."
category=DeprecationWarning, stacklevel=2) |
I did write
So I think just rip it out then. There's no good way of doing this as far as I can tell without adopting lazy imports (as in https://scientific-python.org/specs/spec-0001/) fully. |
Weird. I tried adding: def __getattr__(name):
if name == "F_onewayConstantInputWarning":
warnings.warn("Deprecated", DeprecationWarning)
return __dict__[name] to |
Ah, and I see that GH turns The funny thing is that it actually replaced your double-underscores with asterisks, so I thought this was an intentional correction. |
The |
I see; must have forgotten this once. No problem! #16289 is the new attempt. |
Reference issue
Followup to gh-15923
What does this implement/fix?
gh-15923 consolidated stats warnings into a few superclasses. It was suggested to simplify further by removing the function-specific warnings. This begins the process of removing the function-specific warnings by deprecating them.
Additional information
After merge, this needs an entry in the release notes about the deprecation. Also, the warnings should be removed in 1.11.0, so something should be done as a reminder. (Personally, I think a note in gh-15765 is all that is needed, rather than a separate issue for every deprecation.)