You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [1]: from astroML.classification import GMMBayes
In [2]: GMMBayes()
Out[2]: GMMBayes(n_components=array([1]))
As the comment suggest in your deprecated decorator, overriding __new__ in the class decorator indeed solves this issue.
In [4]: from astroML.classification import GMMBayes
In [5]: GMMBayes()
/Users/bsipocz/munka/devel/scikit-learn/sklearn/utils/deprecation.py:73: FutureWarning: Class BaseNB is deprecated; BaseNB is deprecated in version 0.22 and will be removed in version 0.24.
warnings.warn(msg, category=FutureWarning)
Out[5]: GMMBayes(n_components=array([1]))
I'm happy to open a PR with the fix.
Also, relatedly, I wonder whether you would be interested in using a generic deprecation package instead. Basically we have the same functionality in astropy (I feel it's actually has more features e.g. this works there out of the box, it helps with arg renames/removals, etc.), there is also a deprecated decorator in matplotlib, and also a very basic one in numpy. I feel that having one for the wider ecosystem would be beneficial instead of the current system where we all roll our own.
At the numfocus summit I recall some interest from the mpl side, so I'm happy to get the ball rolling in this quoter if it's a thumb up from multiple projects.
Uh oh!
There was an error while loading. Please reload this page.
FutureWarning is not issued when using
BaseNB
as a baseclass but its__init__()
is not called in the subclass, here: https://github.com/astroML/astroML/blob/master/astroML/classification/gmm_bayes.py#L15As the comment suggest in your
deprecated
decorator, overriding__new__
in the class decorator indeed solves this issue.I'm happy to open a PR with the fix.
Also, relatedly, I wonder whether you would be interested in using a generic deprecation package instead. Basically we have the same functionality in astropy (I feel it's actually has more features e.g. this works there out of the box, it helps with arg renames/removals, etc.), there is also a deprecated decorator in matplotlib, and also a very basic one in numpy. I feel that having one for the wider ecosystem would be beneficial instead of the current system where we all roll our own.
At the numfocus summit I recall some interest from the mpl side, so I'm happy to get the ball rolling in this quoter if it's a thumb up from multiple projects.
Darwin-17.7.0-x86_64-i386-64bit
Python 3.7.5 (default, Nov 1 2019, 02:16:38)
[Clang 10.0.0 (clang-1000.11.45.5)]
NumPy 1.19.0.dev0+63ef78b
SciPy 1.4.1
Scikit-Learn 0.23.dev0
The text was updated successfully, but these errors were encountered: