8000 MNT Make modules private in inspection (#15334) · jeremiedbb/scikit-learn@f86e852 · GitHub
[go: up one dir, main page]

Skip to content

Commit f86e852

Browse files
thomasjpfanglemaitre
authored andcommitted
MNT Make modules private in inspection (scikit-learn#15334)
1 parent ecbc207 commit f86e852

File tree

11 files changed

+32
-12
lines changed

11 files changed

+32
-12
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ sklearn/svm/libsvm.py
130130
sklearn/svm/libsvm_sparse.py
131131
sklearn/svm/liblinear.py
132132

133+
sklearn/inspection/partial_dependence.py
134+
sklearn/inspection/permutation_importance.py
135+
133136
sklearn/neighbors/ball_tree.py
134137
sklearn/neighbors/base.py
135138
sklearn/neighbors/classification.py

build_tools/azure/install.cmd

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@ IF "%PYTHON_ARCH%"=="64" (
1111
call deactivate
1212
@rem Clean up any left-over from a previous build
1313
conda remove --all -q -y -n %VIRTUALENV%
14-
conda create -n %VIRTUALENV% -q -y python=%PYTHON_VERSION% numpy scipy cython matplotlib pytest=%PYTEST_VERSION% wheel pillow joblib
14+
conda create -n %VIRTUALENV% -q -y python=%PYTHON_VERSION% numpy scipy cython matplotlib wheel pillow joblib
1515

1616
call activate %VIRTUALENV%
17+
18+
IF "%PYTEST_VERSION%"=="*" (
19+
pip install pytest
20+
) else (
21+
pip install pytest==%PYTEST_VERSION%
22+
)
1723
pip install pytest-xdist
1824
) else (
1925
pip install numpy scipy cython pytest wheel pillow joblib

build_tools/azure/install.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ version_ge() {
2020

2121
if [[ "$DISTRIB" == "conda" ]]; then
2222

23-
TO_INSTALL="python=$PYTHON_VERSION pip pytest=$PYTEST_VERSION \
24-
pytest-cov numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION \
23+
TO_INSTALL="python=$PYTHON_VERSION pip \
24+
numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION \
2525
cython=$CYTHON_VERSION joblib=$JOBLIB_VERSION"
2626

2727
if [[ "$INSTALL_MKL" == "true" ]]; then
@@ -60,6 +60,12 @@ if [[ "$DISTRIB" == "conda" ]]; then
6060
conda config --set restore_free_channel true
6161
fi
6262

63+
if [[ "$PYTEST_VERSION" == "*" ]]; then
64+
pip install pytest
65+
else
66+
pip install pytest=="$PYTEST_VERSION"
67+
fi
68+
6369
make_conda $TO_INSTALL
6470
if [[ "$PYTHON_VERSION" == "*" ]]; then
6571
pip install pytest-xdist
@@ -88,7 +94,7 @@ elif [[ "$DISTRIB" == "conda-pip-latest" ]]; then
8894
fi
8995

9096
if [[ "$COVERAGE" == "true" ]]; then
91-
python -m pip install coverage codecov
97+
python -m pip install coverage codecov pytest-cov
9298
fi
9399

94100
if [[ "$TEST_DOCSTRINGS" == "true" ]]; then

build_tools/azure/posix-32.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
TEST_DIR: '$(Agent.WorkFolder)/tmp_folder'
1212
JUNITXML: 'test-data.xml'
1313
OMP_NUM_THREADS: '4'
14-
PYTEST_VERSION: '3.8.1'
14+
PYTEST_VERSION: '5.2.1'
1515
OPENBLAS_NUM_THREADS: '4'
1616
SKLEARN_SKIP_NETWORK_TESTS: '1'
1717
strategy:

build_tools/azure/posix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
TEST_DIR: '$(Agent.WorkFolder)/tmp_folder'
1212
VIRTUALENV: 'testvenv'
1313
JUNITXML: 'test-data.xml'
14-
PYTEST_VERSION: '3.8.1'
14+
PYTEST_VERSION: '5.2.1'
1515
OMP_NUM_THREADS: '4'
1616
OPENBLAS_NUM_THREADS: '4'
1717
SKLEARN_SKIP_NETWORK_TESTS: '1'

build_tools/azure/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
VIRTUALENV: 'testvenv'
1313
JUNITXML: 'test-data.xml'
1414
SKLEARN_SKIP_NETWORK_TESTS: '1'
15-
PYTEST_VERSION: '3.8.1'
15+
PYTEST_VERSION: '5.2.1'
1616
TMP_FOLDER: '$(Agent.WorkFolder)\tmp_folder'
1717
strategy:
1818
matrix:

sklearn/_build_utils/deprecated_modules.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@
8686
'set_verbosity_wrap'),
8787
('_liblinear', 'sklearn.svm.liblinear', 'sklearn.svm', 'train_wrap'),
8888

89+
('_partial_dependence', 'sklearn.inspection.partial_dependence',
90+
'sklearn.inspection', 'partial_dependence'),
91+
('_permutation_importance', 'sklearn.inspection.permutation_importance',
92+
'sklearn.inspection', 'permutation_importance'),
93+
8994
('_ball_tree', 'sklearn.neighbors.ball_tree', 'sklearn.neighbors',
9095
'BallTree'),
9196
('_base', 'sklearn.neighbors.base', 'sklearn.neighbors',

sklearn/inspection/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""The :mod:`sklearn.inspection` module includes tools for model inspection."""
2-
from .partial_dependence import partial_dependence
3-
from .partial_dependence import plot_partial_dependence
4-
from .partial_dependence import PartialDependenceDisplay
5-
from .permutation_importance import permutation_importance
2+
from ._partial_dependence import partial_dependence
3+
from ._partial_dependence import plot_partial_dependence
4+
from ._partial_dependence import PartialDependenceDisplay
5+
from ._permutation_importance import permutation_importance
66

77
__all__ = [
88
'partial_dependence',

sklearn/inspection/tests/test_partial_dependence.py

Lines chang 708B ed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import sklearn
99
from sklearn.inspection import partial_dependence
10-
from sklearn.inspection.partial_dependence import (
10+
from sklearn.inspection._partial_dependence import (
1111
_grid_from_X,
1212
_partial_dependence_brute,
1313
_partial_dependence_recursion

0 commit comments

Comments
 (0)
0