-
-
Notifications
You must be signed in to change notification settings - Fork 26.2k
[MRG] Replace absolute imports with relative ones #13653
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] Replace absolute imports with relative ones #13653
Conversation
I will squash commits once this passes |
you don't need to squash commits, and it's nice if you would avoid a force push. We squash the commits before merge anyway. |
Tests are failing @aditya1702. let us know if you need help. |
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.
Be careful with the diff. You should not change in docstrings for example
sklearn/exceptions.py
Outdated
@@ -33,23 +33,23 @@ class NotFittedError(ValueError, AttributeError): | |||
NotFittedError('This LinearSVC instance is not fitted yet'...) | |||
|
|||
.. versionchanged:: 0.18 | |||
Moved from sklearn.utils.validation. |
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.
Revert
sklearn/exceptions.py
Outdated
""" | ||
|
||
|
||
class ChangedBehaviorWarning(UserWarning): | ||
"""Warning class used to notify the user of any change in the behavior. | ||
|
||
.. versionchanged:: 0.18 | ||
Moved from sklearn.base. | ||
Moved from .base. |
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.
Revert
@adrinjalali Got it. I dont force push commits :) |
sklearn/externals/copy_joblib.sh
Outdated
@@ -18,7 +18,7 @@ rm -rf $INSTALL_FOLDER | |||
# Needed to rewrite the doctests | |||
# Note: BSD sed -i needs an argument unders OSX | |||
# so first renaming to .bak and then deleting backup files | |||
find joblib -name "*.py" | xargs sed -i.bak "s/from joblib/from sklearn.externals.joblib/" | |||
find joblib -name "*.py" | xargs sed -i.bak "s/from joblib/from .joblib/" |
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.
to revert I think
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 think this should be okay, and despite @NicolasHug's comment, the changes in sklearn/externals/joblib are consistent with this
@@ -2,7 +2,7 @@ | |||
from functools import partial | |||
|
|||
try: | |||
from sklearn.externals.joblib.externals.cloudpickle import dumps, loads | |||
from ..cloudpickle import dumps, loads |
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.
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.
anything joblib related can be ignored since we're unvendoring #13531
sklearn/linear_model/logistic.py
Outdated
@@ -1304,7 +1304,7 @@ class LogisticRegression(BaseEstimator, LinearClassifierMixin, | |||
|
|||
Note that 'sag' and 'saga' fast convergence is only guaranteed on | |||
features with approximately the same scale. You can | |||
preprocess the data with a scaler from sklearn.preprocessing. | |||
.preprocess the data with a scaler from sklearn.preprocessing. |
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.
revert
sklearn/linear_model/logistic.py
Outdated
@@ -1758,7 +1758,7 @@ class LogisticRegressionCV(LogisticRegression, BaseEstimator, | |||
|
|||
Note that 'sag' and 'saga' fast convergence is only guaranteed on | |||
features with approximately the same scale. You can preprocess the data | |||
with a scaler from sklearn.preprocessing. | |||
with a scaler from ..preprocessing. |
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.
revert
sklearn/model_selection/_split.py
Outdated
@@ -2056,7 +2056,7 @@ def check_cv(cv='warn', y=None, classifier=False): | |||
if not hasattr(cv, 'split') or isinstance(cv, str): | |||
if not isinstance(cv, Iterable) or isinstance(cv, str): | |||
raise ValueError("Expected cv as an integer, cross-validation " | |||
"object (from sklearn.model_selection) " | |||
"object (from .) " |
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.
revert
sklearn/setup.py
Outdated
@@ -1,6 +1,6 @@ | |||
import os | |||
|
|||
from sklearn._build_utils import maybe_cythonize_extensions | |||
from _build_utils import maybe_cythonize_extensions |
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.
revert
sklearn/utils/estimator_checks.py
Outdated
@@ -274,7 +274,7 @@ def check_estimator(Estimator): | |||
shapes, etc. | |||
Additional tests for classifiers, regressors, clustering or transformers | |||
will be run if the Estimator class inherits from the corresponding mixin | |||
from sklearn.base. | |||
from ..base. |
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.
revert
That looks good for the most part, but please revert the changes related to
(also please merge master to sort out the merge conflict with |
sklearn/externals/copy_joblib.sh
Outdated
@@ -18,7 +18,7 @@ rm -rf $INSTALL_FOLDER | |||
# Needed to rewrite the doctests | |||
# Note: BSD sed -i needs an argument unders OSX | |||
# so first renaming to .bak and then deleting backup files | |||
find joblib -name "*.py" | xargs sed -i.bak "s/from joblib/from sklearn.externals.joblib/" | |||
find joblib -name "*.py" | xargs sed -i.bak "s/from joblib/from .joblib/" |
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 think this should be okay, and despite @NicolasHug's comment, the changes in sklearn/externals/joblib are consistent with this
@NicolasHug Resolved the conflicts |
Thanks @aditya1702 ! |
…learn#13653)" This reverts commit 348aa65.
…learn#13653)" This reverts commit 348aa65.
Reference Issues/PRs
Fixes #13629
What does this implement/fix? Explain your changes.
Replaces absolute imports with relative imports
Any other comments?