-
Notifications
You must be signed in to change notification settings - Fork 18
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
deprecate old-style functions #276
Comments
Moving this to the v0.10.0 milestone |
copied from #599 (comment) by @veni-vidi-vici-dormivi
|
I don't think so - or what did you have in mind? I thought along the lines of from functools import wraps
import warnings
def deprecate(func):
@wraps(func)
def wrapped(*args, **kwargs):
warnings.warn(
"This mesmer code path is deprecated. Please use the new api. See example"
" at XXX"
FutureWarning
)
func(*args, **kwargs)
return wrapped We could also take a look at https://github.com/matplotlib/matplotlib/blob/main/lib/matplotlib/_api/deprecation.py but that is probably overkill |
Ah I thought you meant https://deprecated.readthedocs.io/en/latest/introduction.html But your solution seems to do the same thing. |
Ah didn't know about this package. It seems to be a similar approach than what I suggested (a bit more fancy and also for classes and awaitable functions etc.). We can also just remove the old code path. Or remove the tests and exclude them from the coverage (e.g. in combination with #262). We could also just raise a Matlab also has a bunch of helper classes https://github.com/matplotlib/matplotlib/blob/main/lib/matplotlib/_api/deprecation.py where we could draw inspiration from (but probably also not necessary). |
So the only thing we changes is the switch from averaging standard deviations to averaging variances. I would prefer raising Deprecation Errors and only releasing once I think. I see how the patch of averaging the variances in the old code path would not be in any release... but it is in the new code path so I would say this is fine? |
We should raise deprecations warnings (well
FutureWarning
...) for the legacy functions. I am not 100% sure if already for 0.9 or only in 1.0. Also ensure the warnings are not raised 100 times...The text was updated successfully, but these errors were encountered: