-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[MRG] MNT make private the modules in sklearn.mixture #15166
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
[MRG] MNT make private the modules in sklearn.mixture #15166
Conversation
ping @adrinjalali @glemaitre @thomasjpfan for a hopefully easy review :) |
…xtures_dep_underscore
…xtures_dep_underscore
@@ -28,6 +28,10 @@ | |||
('sklearn.cluster.mean_shift_', 'MeanShift'), | |||
('sklearn.cluster.optics_', 'OPTICS'), | |||
('sklearn.cluster.spectral', 'SpectralClustering'), | |||
|
|||
('sklearn.mixture.base', 'BaseMixture'), |
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.
This was not in the __init__.py
, why are we having it then?
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.
because we still support importing from sklearn.mixture.base
for the next 2 versions
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.
does this mean that we cannot use them after the next 2 versions? it is because the security issue or something?
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.
it means you can still import them from sklearn.mixture._base
, but they're not a part of the public API and may change w/o a deprecation cycle. So your code may break between sklearn releases.
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.
Thank you very much!
@@ -24,6 +24,12 @@ | |||
('_mean_shift', 'sklearn.cluster.mean_shift_', 'sklearn.cluster'), | |||
('_optics', 'sklearn.cluster.optics_', 'sklearn.cluster'), | |||
('_spectral', 'sklearn.cluster.spectral', 'sklearn.cluster'), | |||
|
|||
('_base', 'sklearn.mixture.base', 'sklearn.mixture'), |
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.
do we need this?
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.
sklearn/mixture/base.py
was renamed into sklearn/mixture/_base.py
, so yes.
If a user tries to from sklearn.mixture.base import something
it will get a warning saying that it should instead import stuff from sklearn.mixture
, and if that doesn't work that means that what they were importing is now private and they should not use it.
…xtures_dep_underscore
Thanks!
Adrin Jalali <notifications@github.com> 于2020年7月10日周五 下午4:40写道:
… ***@***.**** commented on this pull request.
------------------------------
In sklearn/tests/test_import_deprecations.py
<#15166 (comment)>
:
> @@ -28,6 +28,10 @@
('sklearn.cluster.mean_shift_', 'MeanShift'),
('sklearn.cluster.optics_', 'OPTICS'),
('sklearn.cluster.spectral', 'SpectralClustering'),
+
+ ('sklearn.mixture.base', 'BaseMixture'),
it means you can still import them from sklearn.mixture._base, but
they're not a part of the public API and may change w/o a deprecation
cycle. So your code may break between sklearn releases.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#15166 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGDRXGKM5SUP6F7UOOMG2VTR23HZJANCNFSM4I7CAYXA>
.
|
Towards #9250