8000 [MRG] MAINT Python 3.6 fixes by ogrisel · Pull Request #8123 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[MRG] MAINT Python 3.6 fixes #8123

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

Merged
merged 3 commits into from
Dec 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump 8000 to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ env:
NUMPY_VERSION="1.6.2" SCIPY_VERSION="0.11.0" CYTHON_VERSION="0.23"
# This environment tests the newest supported anaconda env
# It also runs tests requiring Pandas.
- DISTRIB="conda" PYTHON_VERSION="3.5" INSTALL_MKL="true"
NUMPY_VERSION="1.10.4" SCIPY_VERSION="0.17.0" PANDAS_VERSION="0.18.0"
CYTHON_VERSION="0.23.4"
- DISTRIB="conda" PYTHON_VERSION="3.6" INSTALL_MKL="true"
NUMPY_VERSION="1.11.2" SCIPY_VERSION="0.18.1" PANDAS_VERSION="0.19.1"
CYTHON_VERSION="0.25.2"
# flake8 linting on diff wrt common ancestor with upstream/master
- RUN_FLAKE8="true" SKIP_TESTS="true"
DISTRIB="conda" PYTHON_VERSION="3.5" INSTALL_MKL="true"
Expand Down
6 changes: 3 additions & 3 deletions build_tools/travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ if [[ "$DISTRIB" == "conda" ]]; then
# provided versions
if [[ "$INSTALL_MKL" == "true" ]]; then
conda create -n testenv --yes python=$PYTHON_VERSION pip nose \
numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION numpy scipy \
mkl flake8 cython=$CYTHON_VERSION \
numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION \
mkl cython=$CYTHON_VERSION \
${PANDAS_VERSION+pandas=$PANDAS_VERSION}

else
Expand Down Expand Up @@ -118,5 +118,5 @@ except ImportError:
fi

if [[ "$RUN_FLAKE8" == "true" ]]; then
conda install flake8
conda install --yes flake8
fi
9 changes: 5 additions & 4 deletions sklearn/utils/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ def single_source_shortest_path_length(graph, source, cutoff=None):
... [ 1, 0, 1, 0],
... [ 0, 1, 0, 1],
... [ 0, 0, 1, 0]])
>>> single_source_shortest_path_length(graph, 0)
{0: 0, 1: 1, 2: 2, 3: 3}
>>> single_source_shortest_path_length(np.ones((6, 6)), 2)
{0: 1, 1: 1, 2: 0, 3: 1, 4: 1, 5: 1}
>>> list(sorted(single_source_shortest_path_length(graph, 0).items()))
[(0, 0), (1, 1), (2, 2), (3, 3)]
>>> graph = np.ones((6, 6))
>>> list(sorted(single_source_shortest_path_length(graph, 2).items()))
[(0, 1), (1, 1), (2, 0), (3, 1), (4, 1), (5, 1)]
"""
if sparse.isspmatrix(graph):
graph = graph.tolil()
Expand Down
3 changes: 1 addition & 2 deletions sklearn/utils/tests/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,7 @@ def test_check_array_accept_sparse_type_exception():
assert_raise_message(ValueError, msg.format(()),
check_array, X_csr, accept_sparse=())

msg = "'SVR' object"
assert_raise_message(TypeError, msg,
assert_raise_message(TypeError, "SVR",
check_array, X_csr, accept_sparse=[invalid_type])

# Test deprecation of 'None'
Expand Down
0