8000 Merge branch 'dfsg' into debian · yarikoptic/scikit-learn@82c41fb · GitHub
[go: up one dir, main page]

Skip to content

Commit 82c41fb

Browse files
committed
Merge branch 'dfsg' into debian
* dfsg: (29 commits) Release 0.17.1 MAINT remove non-existing cache folder in 0.17.X branch FIX cythonize TSNE MAINT simplify freeing logic for Barnes-Hut SNE memory leak fix Fix memory leak in Barnes-Hut SNE FIX check_build_doc.py false positive detections MAINT more informative output to circle/check_build_doc.py FIX fetch_california_housing FIX in randomized_svd flip sign Updated examples and tests that use scipy's lena DOC whats_new entry for scikit-learn#6258 fix joblib error in LatentDirichletAllocation MAINT fix / speedup travis on 0.17.X MAINT Upgrade pip in appveyor and display version DOC missing changelog entry for scikit-learn#5857 DOC add fix for scikit-learn#6147 to the changelog FIX 6147: ensure that AUC is always a float TST non-regression test for scikit-learn#6147, roc_auc on memmap data Added changelog entry about scikit-learn#6196 Fix reading of bunch pickles ...
2 parents 3c546fd + 1452704 commit 82c41fb

File tree

36 files changed

+1735
-1258
lines changed

36 files changed

+1735
-1258
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ addons:
99
- libatlas-dev
1010
- python-scipy
1111
env:
12+
global:
13+
- OMP_NUM_THREADS=4
14+
- OPENBLAS_NUM_THREADS=4
1215
matrix:
1316
# This environment tests that scikit-learn can be built against
1417
# versions of numpy, scipy with ATLAS that comes with Ubuntu Precise 12.04
@@ -18,7 +21,7 @@ env:
1821
NUMPY_VERSION="1.6.2" SCIPY_VERSION="0.11.0"
1922
# This environment tests the newest supported anaconda env
2023
- DISTRIB="conda" PYTHON_VERSION="3.5" INSTALL_MKL="true"
21-
NUMPY_VERSION="1.10.1" SCIPY_VERSION="0.16.0"
24+
NUMPY_VERSION="1.10.2" SCIPY_VERSION="0.16.1"
2225
install: source continuous_integration/install.sh
2326
script: bash continuous_integration/test_script.sh
2427
after_success:

appveyor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ install:
4848
# not already installed.
4949
- "powershell ./continuous_integration/appveyor/install.ps1"
5050
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
51+
- "python -m pip install -U pip"
5152

5253
# Check that we have the expected version and architecture for Python
5354
- "python --version"
5455
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
56+
- "pip --version"
5557

5658
# Install the build and runtime dependencies of the project.
5759
- "%CMD_IN_ENV% pip install --timeout=60 --trusted-host 28daf2247a33ed269873-7b1aad3fab3cc330e1fd9d109892382a.r6.cf2.rackcdn.com -r continuous_integration/appveyor/requirements.txt"

circle.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1+
dependencies:
2+
cache_directories:
3+
- "~/scikit_learn_data"
4+
- "~/download"
5+
# Check whether the doc build is required, install build dependencies and
6+
# run sphinx to build the doc.
7+
override:
8+
- ./continuous_integration/circle/build_doc.sh
9+
test:
10+
# Grep error on the documentation
11+
override:
12+
- cat ~/log.txt && if grep -q "Traceback (most recent call last):" ~/log.txt; then false; else true; fi
113
general:
2-
# Restric the build to the branch master only
3-
branches:
4-
only:
5-
- master
14+
# Open the doc to the API
15+
artifacts:
16+
- "doc/_build/html"
17+
- "~/log.txt"
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
set -x
2+
set -e
3+
4+
# Introspect the commit to know whether or not we should skip building the
5+
# documentation: a pull request that does not change any file in doc/ or
6+
# examples/ folder should be skipped unless the "[doc: build]" is found the
7+
# commit message.
8+
BUILD_DOC=`python continuous_integration/circle/check_build_doc.py`
9+
echo -e $BUILD_DOC
10+
if [[ $BUILD_DOC == "SKIP:"* ]]; then
11+
touch ~/log.txt # the "test" segment needs that file
12+
exit 0
13+
fi
14+
15+
# Installing required system packages to support the rendering of match
16+
# notation in the HTML documentation
17+
sudo -E apt-get -yq update
18+
sudo -E apt-get -yq remove texlive-binaries --purge
19+
sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes \
20+
install dvipng texlive-latex-base texlive-latex-extra
21+
22+
# deactivate circleci virtualenv and setup a miniconda env instead
23+
if [[ `type -t deactivate` ]]; then
24+
deactivate
25+
fi
26+
27+
# Install dependencies with miniconda
28+
pushd .
29+
cd
30+
mkdir -p download
31+
cd download
32+
echo "Cached in $HOME/download :"
33+
ls -l
34+
if [[ ! -f miniconda.sh ]]
35+
then
36+
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh \
37+
-O miniconda.sh
38+
fi
39+
chmod +x miniconda.sh && ./miniconda.sh -b -p $HOME/miniconda
40+
cd ..
41+
export PATH="$HOME/miniconda/bin:$PATH"
42+
conda update --yes --quiet conda
43+
popd
44+
45+
# Configure the conda environment and put it in the path using the
46+
# provided versions
47+
conda create -n testenv --yes --quiet python numpy scipy \
48+
cython nose coverage matplotlib sphinx pillow
49+
source /home/ubuntu/miniconda/envs/testenv/bin/activate testenv
50+
51+
# Build and install scikit-learn in dev mode
52+
python setup.py develop
53+
54+
# The pipefail is requested to propagate exit code
55+
set -o pipefail && cd doc && make html 2>&1 | tee ~/log.txt
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
"""Check whether we or not we should build the documentation
2+
3+
If the last commit message has a "[doc skip]" marker, do not build
4+
the doc. On the contrary if a "[doc build]" marker is found, build the doc
5+
instead of relying on the subsequent rules.
6+
7+
We always build the documentation for jobs that are not related to a specific
8+
PR (e.g. a merge to master or a maintenance branch).
9+
10+
If this is a PR, check that if there are some files in this PR that are under
11+
the "doc/" or "examples/" folders, otherwise skip.
12+
13+
If the introspection of the current commit fails for any reason, the default
14+
behavior is to build the documentation.
15+
16+
"""
17+
import sys
18+
import os
19+
from subprocess import check_output, CalledProcessError
20+
21+
22+
def exit(msg="", skip=False):
23+
print("%s: %s" % ("SKIP" if skip else "BUILD", msg))
24+
sys.exit(0)
25+
26+
# Introspect the message for the commit that triggered the build
27+
commit = os.environ.get('CIRCLE_SHA1')
28+
if not commit:
29+
exit("undefined CIRCLE_SHA1 variable")
30+
try:
31+
commit_msg = check_output("git log --format=%B -n 1".split() + [commit])
32+
commit_msg = commit_msg.decode('utf-8')
33+
except CalledProcessError:
34+
exit("failed to introspect commit message for %s" % commit)
35+
36+
if "[doc skip]" in commit_msg:
37+
exit("[doc skip] marker found", skip=True)
38+
elif "[doc build]" in commit_msg:
39+
exit("[doc build] marker found")
40+
41+
# Check whether this commit is part of a pull request or not
42+
pr_url = os.environ.get('CI_PULL_REQUEST')
43+
if not pr_url:
44+
# The documentation should be always built when executed from one of the
45+
# main branches
46+
exit("not a pull request")
47+
48+
# Introspect the list of files changed by all the commits in this PR.
49+
# Hardcode the assumption that this is a PR to origin/master of this repo
50+
# as apparently there is way to reliably get the target of a PR with circle
51+
# ci
52+
git_range = "origin/master...%s" % commit
53+
try:
54+
check_output("git fetch origin master".split())
55+
filenames = check_output("git diff --name-only".split() + [git_range])
56+
except CalledProcessError:
57+
exit("git introspection failed.")
58+
filenames = filenames.decode('utf-8').split()
59+
for filename in filenames:
60+
if filename.startswith(u'doc/') or filename.startswith(u'examples/'):
61+
exit("detected doc impacting file modified by PR in range %s: %s"
62+
% (git_range, filename))
63+
64+
# This PR does not seem to have any documentation related file changed.
65+
msg = "no doc impacting files detected:\n" + u"\n".join(filenames)
66+
exit(msg, skip=True)

continuous_integration/install.sh

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,16 @@ if [[ "$DISTRIB" == "conda" ]]; then
2929

3030
# Configure the conda environment and put it in the path using the
3131
# provided versions
32-
conda create -n testenv --yes python=$PYTHON_VERSION pip nose \
33-
numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION
34-
source activate testenv
35-
3632
if [[ "$INSTALL_MKL" == "true" ]]; then
37-
# Make sure that MKL is used
38-
conda install --yes mkl
33+
conda create -n testenv --yes python=$PYTHON_VERSION pip nose \
34+
numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION numpy scipy \
35+
libgfortran mkl
3936
else
40-
# Make sure that MKL is not used
41-
conda remove --yes --features mkl || echo "MKL not installed"
37+
conda create -n testenv --yes python=$PYTHON_VERSION pip nose \
38+
numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION libgfortran
4239
fi
40+
source activate testenv
41+
4342

4443
elif [[ "$DISTRIB" == "ubuntu" ]]; then
4544
# At the time of writing numpy 1.9.1 is included in the travis

doc/documentation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Documentation of scikit-learn 0.17
2828
<!-- doc versions -->
2929
<h2>Other Versions</h2>
3030
<ul>
31-
<li><a href="http://scikit-learn.org/stable/documentation.html">scikit-learn 0.18 (development)</a></li>
31+
<li><a href="http://scikit-learn.org/dev/documentation.html">scikit-learn 0.18 (development)</a></li>
3232
<li>scikit-learn 0.17 (stable)</li>
3333
<li><a href="http://scikit-learn.org/0.17/documentation.html">scikit-learn 0.16</a></li>
3434
<li><a href="http://scikit-learn.org/0.15/documentation.html">scikit-learn 0.15</a></li>

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@
236236
<ul>
237237
<li><em>About us</em> See <a href="about.html#people">authors</a></li>
238238
<li><em>More Machine Learning</em> Find <a href="related_projects.html">related projects</a></li>
239-
<li><em>Questions?</em> See <a href="faq/">FAQ</a> and <a href="http://stackoverflow.com/questions/tagged/scikit-learn">stackoverflow</a></li>
239+
<li><em>Questions?</em> See <a href="faq.html">FAQ</a> and <a href="http://stackoverflow.com/questions/tagged/scikit-learn">stackoverflow</a></li>
240240
<li><em>Mailing list:</em> <a href="https://lists.sourceforge.net/lists/listinfo/scikit-learn-general">scikit-learn-general@lists.sourceforge.net</a></li>
241241
<li><em>IRC:</em> #scikit-learn @ <a href="http://webchat.freenode.net/">freenode</a></li>
242242
</ul>

doc/modules/clustering.rst

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -464,15 +464,15 @@ function of the gradient of the image.
464464
* :ref:`example_cluster_plot_segmentation_toy.py`: Segmenting objects
465465
from a noisy background using spectral clustering.
466466

467-
* :ref:`example_cluster_plot_lena_segmentation.py`: Spectral clustering
468-
to split the image of lena in regions.
467+
* :ref:`example_cluster_plot_face_segmentation.py`: Spectral clustering
468+
to split the image of the raccoon face in regions.
469469

470-
.. |lena_kmeans| image:: ../auto_examples/cluster/images/plot_lena_segmentation_001.png
471-
:target: ../auto_examples/cluster/plot_lena_segmentation.html
470+
.. |face_kmeans| image:: ../auto_examples/cluster/images/plot_face_segmentation_001.png
471+
:target: ../auto_examples/cluster/plot_face_segmentation.html
472472
:scale: 65
473473

474-
.. |lena_discretize| image:: ../auto_examples/cluster/images/plot_lena_segmentation_002.png
475-
:target: ../auto_examples/cluster/plot_lena_segmentation.html
474+
.. |face_discretize| image:: ../auto_examples/cluster/images/plot_face_segmentation_002.png
475+
:target: ../auto_examples/cluster/plot_face_segmentation.html
476476
:scale: 65
477477

478478
Different label assignment strategies
@@ -490,7 +490,7 @@ geometrical shape.
490490
===================================== =====================================
491491
``assign_labels="kmeans"`` ``assign_labels="discretize"``
492492
===================================== =====================================
493-
|lena_kmeans| |lena_discretize|
493+
|face_kmeans| |face_discretize|
494494
===================================== =====================================
495495

496496

@@ -619,12 +619,12 @@ merging to nearest neighbors as in :ref:`this example
619619
<example_cluster_plot_agglomerative_clustering.py>`, or
620620
using :func:`sklearn.feature_extraction.image.grid_to_graph` to
621621
enable only merging of neighboring pixels on an image, as in the
622-
:ref:`Lena <example_cluster_plot_lena_ward_segmentation.py>` example.
622+
:ref:`raccoon face <example_cluster_plot_face_ward_segmentation.py>` example.
623623

624624
.. topic:: Examples:
625625

626-
* :ref:`example_cluster_plot_lena_ward_segmentation.py`: Ward clustering
627-
to split the image of lena in regions.
626+
* :ref:`example_cluster_plot_face_ward_segmentation.py`: Ward clustering
627+
to split the image of a raccoon face in regions.
628628

629629
* :ref:`example_cluster_plot_ward_structured_vs_unstructured.py`: Example of
630630
Ward algorithm on a swiss-roll, comparison of structured approaches
@@ -1401,5 +1401,3 @@ Drawbacks
14011401

14021402
* :ref:`example_cluster_plot_kmeans_silhouette_analysis.py` : In this example
14031403
the silhouette analysis is used to choose an optimal value for n_clusters.
1404-
1405-

doc/modules/decomposition.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ sparse coding step that shares the same implementation with all dictionary
451451
learning objects (see :ref:`SparseCoder`).
452452

453453
The following image shows how a dictionary learned from 4x4 pixel image patches
454-
extracted from part of the image of Lena looks like.
454+
extracted from part of the image of a raccoon face looks like.
455455

456456

457457
.. figure:: ../auto_examples/decomposition/images/plot_image_denoising_001.png

0 commit comments

Comments
 (0)
0