Skip to content

Commit b3f2904

Browse files
authored
Merge branch 'scikit-learn:main' into main
2 parents 9966bd0 + 6e22281 commit b3f2904

File tree

1,814 files changed

+303621
-156623
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,814 files changed

+303621
-156623
lines changed

.binder/postBuild

100644100755
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ set -e
66
# inside a git checkout of the scikit-learn/scikit-learn repo. This script is
77
# generating notebooks from the scikit-learn python examples.
88

9-
if [[ ! -f /.dockerenv ]]; then
10-
echo "This script was written for repo2docker and is supposed to run inside a docker container."
11-
echo "Exiting because this script can delete data if run outside of a docker container."
9+
if [[ -z "${REPO_DIR}" ]]; then
10+
echo "This script was written for repo2docker and the REPO_DIR environment variable is supposed to be set."
11+
echo "Exiting because this script can delete data if run outside of a repo2docker context."
1212
exit 1
1313
fi
1414

@@ -23,7 +23,7 @@ find . -delete
2323
GENERATED_NOTEBOOKS_DIR=.generated-notebooks
2424
cp -r $TMP_CONTENT_DIR/examples $GENERATED_NOTEBOOKS_DIR
2525

26-
find $GENERATED_NOTEBOOKS_DIR -name '*.py' -exec sphx_glr_python_to_jupyter.py '{}' +
26+
find $GENERATED_NOTEBOOKS_DIR -name '*.py' -exec sphinx_gallery_py2jupyter '{}' +
2727
NON_NOTEBOOKS=$(find $GENERATED_NOTEBOOKS_DIR -type f | grep -v '\.ipynb')
2828
rm -f $NON_NOTEBOOKS
2929

.binder/requirements.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
--extra-index https://pypi.anaconda.org/scipy-wheels-nightly/simple scikit-learn
1+
--find-links https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/scikit-learn
22
--pre
33
matplotlib
44
scikit-image
55
pandas
6+
seaborn
7+
Pillow
68
sphinx-gallery
79
scikit-learn
8-
10+
polars

.binder/runtime.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python-3.12

.circleci/artifact_path

Lines changed: 0 additions & 1 deletion
This file was deleted.

.circleci/config.yml

Lines changed: 35 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,38 @@
1-
version: 2
1+
version: 2.1
22

33
jobs:
4+
lint:
5+
docker:
6+
- image: cimg/python:3.10.16
7+
steps:
8+
- checkout
9+
- run:
10+
name: dependencies
11+
command: |
12+
source build_tools/shared.sh
13+
# Include pytest compatibility with mypy
14+
pip install pytest $(get_dep ruff min) $(get_dep mypy min) cython-lint
15+
- run:
16+
name: linting
17+
command: ./build_tools/linting.sh
18+
419
doc-min-dependencies:
520
docker:
6-
- image: circleci/python:3.7.3-stretch
21+
- image: cimg/base:current-22.04
722
environment:
8-
- OMP_NUM_THREADS: 2
923
- MKL_NUM_THREADS: 2
24+
- OPENBLAS_NUM_THREADS: 2
1025
- CONDA_ENV_NAME: testenv
11-
- PYTHON_VERSION: 3.6
12-
- NUMPY_VERSION: 'min'
13-
- SCIPY_VERSION: 'min'
14-
- MATPLOTLIB_VERSION: 'min'
15-
- CYTHON_VERSION: 'min'
16-
- SCIKIT_IMAGE_VERSION: 'min'
17-
- SPHINX_VERSION: 'min'
18-
- PANDAS_VERSION: 'min'
19-
- SPHINX_GALLERY_VERSION: 'min'
20-
- NUMPYDOC_VERSION: 'min'
21-
- SPHINX_PROMPT_VERSION: 'min'
26+
- LOCK_FILE: build_tools/circle/doc_min_dependencies_linux-64_conda.lock
27+
# Do not fail if the documentation build generates warnings with minimum
28+
# dependencies as long as we can avoid raising warnings with more recent
29+
# versions of the same dependencies.
30+
- SKLEARN_WARNINGS_AS_ERRORS: '0'
2231
steps:
2332
- checkout
2433
- run: ./build_tools/circle/checkout_merge_commit.sh
2534
- restore_cache:
26-
key: v1-datasets-{{ .Branch }}
35+
key: v1-doc-min-deps-datasets-{{ .Branch }}
2736
- restore_cache:
2837
keys:
2938
- doc-min-deps-ccache-{{ .Branch }}
@@ -35,7 +44,7 @@ jobs:
3544
- ~/.ccache
3645
- ~/.cache/pip
3746
- save_cache:
38-
key: v1-datasets-{{ .Branch }}
47+
key: v1-doc-min-deps-datasets-{{ .Branch }}
3948
paths:
4049
- ~/scikit_learn_data
4150
- store_artifacts:
@@ -47,27 +56,20 @@ jobs:
4756

4857
doc:
4958
docker:
50-
- image: circleci/python:3.7.3-stretch
59+
- image: cimg/base:current-22.04
5160
environment:
52-
- OMP_NUM_THREADS: 2
5361
- MKL_NUM_THREADS: 2
62+
- OPENBLAS_NUM_THREADS: 2
5463
- CONDA_ENV_NAME: testenv
55-
- PYTHON_VERSION: 3
56-
- NUMPY_VERSION: 'latest'
57-
- SCIPY_VERSION: 'latest'
58-
- MATPLOTLIB_VERSION: 'latest'
59-
- CYTHON_VERSION: 'latest'
60-
- SCIKIT_IMAGE_VERSION: 'latest'
61-
- SPHINX_VERSION: 'min'
62-
- PANDAS_VERSION: 'latest'
63-
- SPHINX_GALLERY_VERSION: 'latest'
64-
- NUMPYDOC_VERSION: 'latest'
65-
- SPHINX_PROMPT_VERSION: 'latest'
64+
- LOCK_FILE: build_tools/circle/doc_linux-64_conda.lock
65+
# Make sure that we fail if the documentation build generates warnings with
66+
# recent versions of the dependencies.
67+
- SKLEARN_WARNINGS_AS_ERRORS: '1'
6668
steps:
6769
- checkout
6870
- run: ./build_tools/circle/checkout_merge_commit.sh
6971
- restore_cache:
70-
key: v1-datasets-{{ .Branch }}
72+
key: v1-doc-datasets-{{ .Branch }}
7173
- restore_cache:
7274
keys:
7375
- doc-ccache-{{ .Branch }}
@@ -79,7 +81,7 @@ jobs:
7981
- ~/.ccache
8082
- ~/.cache/pip
8183
- save_cache:
82-
key: v1-datasets-{{ .Branch }}
84+
key: v1-doc-datasets-{{ .Branch }}
8385
paths:
8486
- ~/scikit_learn_data
8587
- store_artifacts:
@@ -94,43 +96,9 @@ jobs:
9496
root: doc/_build/html
9597
paths: .
9698

97-
lint:
98-
docker:
99-
- image: circleci/python:3.6
100-
steps:
101-
- checkout
102-
- run: ./build_tools/circle/checkout_merge_commit.sh
103-
- run:
104-
name: dependencies
105-
command: sudo pip install flake8
106-
- run:
107-
name: linting
108-
command: ./build_tools/circle/linting.sh
109-
110-
pypy3:
111-
docker:
112-
- image: condaforge/miniforge3
113-
environment:
114-
# Avoid the interactive dialog when installing tzdata
115-
- DEBIAN_FRONTEND: noninteractive
116-
steps:
117-
- restore_cache:
118-
keys:
119-
- pypy3-ccache-{{ .Branch }}
120-
- pypy3-ccache
121-
- run: apt-get -yq update && apt-get -yq install git ssh
122-
- checkout
123-
- run: conda init bash && source ~/.bashrc
124-
- run: ./build_tools/circle/build_test_pypy.sh
125-
- save_cache:
126-
key: pypy3-ccache-{{ .Branch }}-{{ .BuildNum }}
127-
paths:
128-
- ~/.ccache
129-
- ~/.cache/pip
130-
13199
deploy:
132100
docker:
133-
- image: circleci/python:3.6
101+
- image: cimg/base:current-22.04
134102
steps:
135103
- checkout
136104
- run: ./build_tools/circle/checkout_merge_commit.sh
@@ -139,7 +107,7 @@ jobs:
139107
- attach_workspace:
140108
at: doc/_build/html
141109
- run: ls -ltrh doc/_build/html/stable
142-
- deploy:
110+
- run:
143111
command: |
144112
if [[ "${CIRCLE_BRANCH}" =~ ^main$|^[0-9]+\.[0-9]+\.X$ ]]; then
145113
bash build_tools/circle/push_doc.sh doc/_build/html/stable
@@ -156,21 +124,6 @@ workflows:
156124
- doc-min-dependencies:
157125
requires:
158126
- lint
159-
- pypy3:
160-
filters:
161-
branches:
162-
only:
163-
- 0.20.X
164127
- deploy:
165128
requires:
166129
- doc
167-
pypy:
168-
triggers:
169-
- schedule:
170-
cron: "0 0 * * *"
171-
filters:
172-
branches:
173-
only:
174-
- main
175-
jobs:
176-
- pypy3

.codecov.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ coverage:
1919

2020
codecov:
2121
notify:
22-
# Prevent coverage status to upload multiple times for parallel and long
23-
# running CI pipelines. This configuration is particularly useful on PRs
24-
# to avoid confusion. Note that this value is set to the number of Azure
25-
# Pipeline jobs uploading coverage reports.
26-
after_n_builds: 6
22+
# Prevent codecov from calculating the coverage results before all expected uploads
23+
# are in. This value is set to the total number of jobs uploading coverage reports.
24+
after_n_builds: 7
2725

2826
ignore:
2927
- "sklearn/externals"
3028
- "sklearn/_build_utils"
31-
- "**/setup.py"
29+
- "sklearn/__check_build"
30+
- "sklearn/_min_dependencies.py"
31+
- "**/conftest.py"

.coveragerc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
[run]
2-
branch = True
2+
# Use statement coverage rather than branch coverage because
3+
# COVERAGE_CORE=sysmon can make branch coverage slower rather than faster. See
4+
# https://github.com/nedbat/coveragepy/issues/1812 for more details.
5+
branch = False
36
source = sklearn
47
parallel = True
58
omit =
69
*/sklearn/externals/*
710
*/sklearn/_build_utils/*
811
*/benchmarks/*
9-
**/setup.py

.devcontainer/devcontainer.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
// More info about Features: https://containers.dev/features
3+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
4+
"features": {},
5+
6+
"onCreateCommand": ".devcontainer/setup.sh",
7+
"postCreateCommand": "",
8+
9+
"customizations": {
10+
"vscode": {
11+
"extensions": [
12+
"ms-python.python"
13+
],
14+
"settings": {}
15+
}
16+
}
17+
}

.devcontainer/setup.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
"${SHELL}" <(curl -Ls micro.mamba.pm/install.sh) < /dev/null
6+
# .bashrc has been updated by the mamba install one-liner above.
7+
# 'source $HOME/.bashrc' sets up micromamba for later use
8+
source $HOME/.bashrc
9+
10+
micromamba env create -f build_tools/circle/doc_environment.yml -n sklearn-dev --yes
11+
# Auto-activate sklearn-dev in terminal
12+
echo "micromamba activate sklearn-dev" >> $HOME/.bashrc

.git-blame-ignore-revs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Since git version 2.23, git-blame has a feature to ignore
2+
# certain commits.
3+
#
4+
# This file contains a list of commits that are not likely what
5+
# you are looking for in `git blame`. You can set this file as
6+
# a default ignore file for blame by running the following
7+
# command.
8+
#
9+
# $ git config blame.ignoreRevsFile .git-blame-ignore-revs
10+
11+
# PR 18948: Migrate code style to Black
12+
82df48934eba1df9a1ed3be98aaace8eada59e6e
13+
14+
# PR 20294: Use target_version >= 3.7 in Black
15+
351ace7935a4ea685171cc6d174890f08facd561
16+
17+
# PR 20412: Use experimental_string_processing=true in Black
18+
3ae7c7615343bbd36acece57825d8b0d70fd9da4
19+
20+
# PR 20502: Runs Black on examples
21+
70a185ae59b4362633d18b0d0083abb1b6f7370c
22+
23+
# PR 22474: Update to Black 22.1.0
24+
1fc86b6aacd89da44a3b4e8abf7c3e2ba4336ffe
25+
26+
# PR 22983: Update to Black 22.3.0
27+
d4aad64b1eb2e42e76f49db2ccfbe4b4660d092b
28+
29+
# PR 26110: Update black to 23.3.0
30+
893d5accaf9d16f447645e704f85a216187564f7
31+
32+
# PR 26649: Add isort and ruff rules
33+
42173fdb34b5aded79664e045cada719dfbe39dc
34+
35+
# PR 28802: Update black to 24.3.0
36+
c4c546355667b070edd5c892b206aa4a97af9a0b
37+
38+
# PR 30694: Enforce ruff rules (RUF)
39+
fe7c4176828af5231f526e76683fb9bdb9ea0367
40+
41+
# PR 30695: Apply ruff/flake8-implicit-str-concat rules (ISC)
42+
5cdbbf15e3fade7cc2462ef66dc4ea0f37f390e3
43+
44+
# PR 31015: black -> ruff format
45+
ff78e258ccf11068e2b3a433c51517ae56234f88
46+
47+
# PR 31226: Enforce ruff/pygrep-hooks rules
48+
b98dc797c480b1b9495f918e201d45ee07f29feb
49+
50+
# PR 31817: Consistently use relative imports
51+
4abf564cb4ac58d61fbbe83552c28f764284a69d
52+
53+
# PR 31847 Switch to absolute imports enforced by ruff
54+
1fe659545c70d9f805c1c4097dd2fce9a6285a12

0 commit comments

Comments
 (0)