From 468c3f40577da8d7b3699400ad86f36e5bb5ab60 Mon Sep 17 00:00:00 2001 From: Adrin Jalali Date: Fri, 22 Jan 2021 15:19:48 +0100 Subject: [PATCH] MNT replace master with main (#19237) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * replace master with main * fix imbalanced-learn Co-authored-by: Guillaume Lemaitre * asv default branch is `master` Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com> Co-authored-by: Guillaume Lemaitre Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com> --- .circleci/config.yml | 4 +- .codecov.yml | 2 +- .github/workflows/twitter.yml | 4 +- .github/workflows/wheels.yml | 4 +- .travis.yml | 4 +- CONTRIBUTING.md | 2 +- Makefile | 2 +- PULL_REQUEST_TEMPLATE.md | 2 +- README.rst | 12 +-- asv_benchmarks/asv.conf.json | 6 +- azure-pipelines.yml | 2 +- build_tools/circle/build_doc.sh | 16 ++-- build_tools/circle/checkout_merge_commit.sh | 8 +- build_tools/circle/linting.sh | 22 ++--- build_tools/circle/push_doc.sh | 10 +- build_tools/travis/install.sh | 2 +- .../{install_master.sh => install_main.sh} | 2 +- doc/about.rst | 2 +- doc/computing/computational_performance.rst | 2 +- doc/conf.py | 6 +- doc/developers/advanced_installation.rst | 4 +- doc/developers/contributing.rst | 28 +++--- doc/developers/maintainer.rst | 36 ++++---- doc/developers/tips.rst | 4 +- doc/faq.rst | 18 ++-- doc/themes/scikit-learn/layout.html | 2 +- .../static/img/scikit-learn-logo.svg | 91 +++++++++---------- .../text_analytics/working_with_text_data.rst | 2 +- maint_tools/whats_missing.sh | 2 +- 29 files changed, 150 insertions(+), 151 deletions(-) rename build_tools/travis/{install_master.sh => install_main.sh} (98%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 48d48810f0014..4ca26a110f28c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -132,7 +132,7 @@ jobs: - run: ls -ltrh doc/_build/html/stable - deploy: command: | - if [[ "${CIRCLE_BRANCH}" =~ ^master$|^[0-9]+\.[0-9]+\.X$ ]]; then + if [[ "${CIRCLE_BRANCH}" =~ ^main$|^[0-9]+\.[0-9]+\.X$ ]]; then bash build_tools/circle/push_doc.sh doc/_build/html/stable fi @@ -162,6 +162,6 @@ workflows: filters: branches: only: - - master + - main jobs: - pypy3 diff --git a/.codecov.yml b/.codecov.yml index a2557a5a21079..d430925ea7508 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -4,7 +4,7 @@ coverage: status: project: default: - # Commits pushed to master should not make the overall + # Commits pushed to main should not make the overall # project coverage decrease by more than 1%: target: auto threshold: 1% diff --git a/.github/workflows/twitter.yml b/.github/workflows/twitter.yml index ac2f037246257..7c219b13ec28c 100644 --- a/.github/workflows/twitter.yml +++ b/.github/workflows/twitter.yml @@ -1,12 +1,12 @@ # Tweet the URL of a commit on @sklearn_commits whenever a push event -# happens on the master branch +# happens on the main branch name: Twitter Push Notification on: push: branches: - - master + - main jobs: diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 17726ec9a112b..dc7afc711a2a7 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -7,12 +7,12 @@ on: - cron: "42 3 */1 * *" push: branches: - - master + - main # Release branches - "[0-9]+.[0-9]+.X" pull_request: branches: - - master + - main - "[0-9]+.[0-9]+.X" # Manual run workflow_dispatch: diff --git a/.travis.yml b/.travis.yml index 3c995f35253ae..72a9e3993444a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ jobs: if: type = cron OR commit_message =~ /\[icc-build\]/ # Manual trigger of linux/arm64 tests in PR without triggering the full - # wheel building process for all the Python versions. + # wheel building process for all the Python versions. - python: 3.9 os: linux arch: arm64 @@ -48,7 +48,7 @@ jobs: # Linux environments to build the scikit-learn wheels for the ARM64 # architecture and Python 3.6 and newer. This is used both at release time # with the manual trigger in the commit message in the release branch and as - # a scheduled task to build the weekly dev build on the master branch. The + # a scheduled task to build the weekly dev build on the main branch. The # weekly frequency is meant to avoid depleting the Travis CI credits too # fast. - python: 3.6 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5091becaa5ba6..f6f65883c65b2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,7 +13,7 @@ documentation is no less important than improving the library itself. If you find a typo in the documentation, or have made improvements, do not hesitate to send an email to the mailing list or preferably submit a GitHub pull request. Documentation can be found under the -[doc/](https://github.com/scikit-learn/scikit-learn/tree/master/doc) directory. +[doc/](https://github.com/scikit-learn/scikit-learn/tree/main/doc) directory. But there are many other ways to help. In particular answering queries on the [issue tracker](https://github.com/scikit-learn/scikit-learn/issues), diff --git a/Makefile b/Makefile index cba46ecf7c1a1..112b1e68188a0 100644 --- a/Makefile +++ b/Makefile @@ -65,4 +65,4 @@ code-analysis: pylint -E -i y sklearn/ -d E1103,E0611,E1101 flake8-diff: - git diff upstream/master -u -- "*.py" | flake8 --diff + git diff upstream/main -u -- "*.py" | flake8 --diff diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index 82720e2af1d64..8528d5386b58a 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,6 @@ #### Reference Issues/PRs diff --git a/README.rst b/README.rst index 9eb62647a7de6..68f9ffee17d03 100644 --- a/README.rst +++ b/README.rst @@ -2,16 +2,16 @@ |Azure|_ |Travis|_ |Codecov|_ |CircleCI|_ |Nightly wheels|_ |PythonVersion|_ |PyPi|_ |DOI|_ -.. |Azure| image:: https://dev.azure.com/scikit-learn/scikit-learn/_apis/build/status/scikit-learn.scikit-learn?branchName=master -.. _Azure: https://dev.azure.com/scikit-learn/scikit-learn/_build/latest?definitionId=1&branchName=master +.. |Azure| image:: https://dev.azure.com/scikit-learn/scikit-learn/_apis/build/status/scikit-learn.scikit-learn?branchName=main +.. _Azure: https://dev.azure.com/scikit-learn/scikit-learn/_build/latest?definitionId=1&branchName=main -.. |Travis| image:: https://api.travis-ci.com/scikit-learn/scikit-learn.svg?branch=master +.. |Travis| image:: https://api.travis-ci.com/scikit-learn/scikit-learn.svg?branch=main .. _Travis: https://travis-ci.com/scikit-learn/scikit-learn -.. |Codecov| image:: https://codecov.io/github/scikit-learn/scikit-learn/badge.svg?branch=master&service=github -.. _Codecov: https://codecov.io/github/scikit-learn/scikit-learn?branch=master +.. |Codecov| image:: https://codecov.io/github/scikit-learn/scikit-learn/badge.svg?branch=main&service=github +.. _Codecov: https://codecov.io/github/scikit-learn/scikit-learn?branch=main -.. |CircleCI| image:: https://circleci.com/gh/scikit-learn/scikit-learn/tree/master.svg?style=shield&circle-token=:circle-token +.. |CircleCI| image:: https://circleci.com/gh/scikit-learn/scikit-learn/tree/main.svg?style=shield&circle-token=:circle-token .. _CircleCI: https://circleci.com/gh/scikit-learn/scikit-learn .. |Nightly wheels| image:: https://github.com/scikit-learn/scikit-learn/workflows/Wheel%20builder/badge.svg?event=schedule diff --git a/asv_benchmarks/asv.conf.json b/asv_benchmarks/asv.conf.json index 7e839a1ecb175..59d9f862f0f97 100644 --- a/asv_benchmarks/asv.conf.json +++ b/asv_benchmarks/asv.conf.json @@ -12,7 +12,7 @@ // The URL or local path of the source code repository for the // project being benchmarked "repo": "..", - + // The Python project's subdirectory in your repo. If missing or // the empty string, the project is assumed to be located at the root // of the repository. @@ -28,9 +28,9 @@ // "PIP_NO_BUILD_ISOLATION=false python -mpip wheel --no-deps --no-index -w {build_cache_dir} {build_dir}" // ], - // List of branches to benchmark. If not provided, defaults to "master" + // List of branches to benchmark. If not provided, defaults to "master // (for git) or "default" (for mercurial). - // "branches": ["master"], // for git + // "branches": ["main"], // for git // "branches": ["default"], // for mercurial // The DVCS being used. If not set, it will be automatically diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 870c5f0e1d313..1b861a6eaef5f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,7 +4,7 @@ schedules: displayName: Run nightly build branches: include: - - master + - main always: true jobs: diff --git a/build_tools/circle/build_doc.sh b/build_tools/circle/build_doc.sh index 691006bd2dab0..37afb1841d368 100755 --- a/build_tools/circle/build_doc.sh +++ b/build_tools/circle/build_doc.sh @@ -9,7 +9,7 @@ set -e # instead of relying on the subsequent rules. # # We always build the documentation for jobs that are not related to a specific -# PR (e.g. a merge to master or a maintenance branch). +# PR (e.g. a merge to main or a maintenance branch). # # If this is a PR, do a full build if there are some files in this PR that are # under the "doc/" or "examples/" folders, otherwise perform a quick build. @@ -49,8 +49,8 @@ get_build_type() { echo BUILD: not a pull request return fi - git_range="origin/master...$CIRCLE_SHA1" - git fetch origin master >&2 || (echo QUICK BUILD: failed to get changed filenames for $git_range; return) + git_range="origin/main...$CIRCLE_SHA1" + git fetch origin main >&2 || (echo QUICK BUILD: failed to get changed filenames for $git_range; return) filenames=$(git diff --name-only $git_range) if [ -z "$filenames" ] then @@ -114,7 +114,7 @@ then exit 0 fi -if [[ "$CIRCLE_BRANCH" =~ ^master$|^[0-9]+\.[0-9]+\.X$ && -z "$CI_PULL_REQUEST" ]] +if [[ "$CIRCLE_BRANCH" =~ ^main$|^[0-9]+\.[0-9]+\.X$ && -z "$CI_PULL_REQUEST" ]] then # ZIP linked into HTML make_args=dist @@ -188,9 +188,9 @@ python setup.py develop export OMP_NUM_THREADS=1 -if [[ "$CIRCLE_BRANCH" =~ ^master$ && -z "$CI_PULL_REQUEST" ]] +if [[ "$CIRCLE_BRANCH" =~ ^main$ && -z "$CI_PULL_REQUEST" ]] then - # List available documentation versions if on master + # List available documentation versions if on main python build_tools/circle/list_versions.py > doc/versions.rst fi @@ -205,7 +205,7 @@ cd - set +o pipefail affected_doc_paths() { - files=$(git diff --name-only origin/master...$CIRCLE_SHA1) + files=$(git diff --name-only origin/main...$CIRCLE_SHA1) echo "$files" | grep ^doc/.*\.rst | sed 's/^doc\/\(.*\)\.rst$/\1.html/' echo "$files" | grep ^examples/.*.py | sed 's/^\(.*\)\.py$/auto_\1.html/' sklearn_files=$(echo "$files" | grep '^sklearn/') @@ -216,7 +216,7 @@ affected_doc_paths() { } affected_doc_warnings() { - files=$(git diff --name-only origin/master...$CIRCLE_SHA1) + files=$(git diff --name-only origin/main...$CIRCLE_SHA1) # Look for sphinx warnings only in files affected by the PR if [ -n "$files" ] then diff --git a/build_tools/circle/checkout_merge_commit.sh b/build_tools/circle/checkout_merge_commit.sh index 010a6a0b55e6d..d9860b0ab5277 100755 --- a/build_tools/circle/checkout_merge_commit.sh +++ b/build_tools/circle/checkout_merge_commit.sh @@ -1,9 +1,9 @@ #!/bin/bash -# Add `master` branch to the update list. +# Add `main` branch to the update list. # Otherwise CircleCI will give us a cached one. -FETCH_REFS="+master:master" +FETCH_REFS="+main:main" # Update PR refs for testing. if [[ -n "${CIRCLE_PR_NUMBER}" ]] @@ -20,13 +20,13 @@ if [[ -n "${CIRCLE_PR_NUMBER}" ]] then git checkout -qf "pr/${CIRCLE_PR_NUMBER}/merge" || ( echo Could not fetch merge commit. >&2 - echo There may be conflicts in merging PR \#${CIRCLE_PR_NUMBER} with master. >&2; + echo There may be conflicts in merging PR \#${CIRCLE_PR_NUMBER} with main. >&2; exit 1) fi # Check for merge conflicts. if [[ -n "${CIRCLE_PR_NUMBER}" ]] then - git branch --merged | grep master > /dev/null + git branch --merged | grep main > /dev/null git branch --merged | grep "pr/${CIRCLE_PR_NUMBER}/head" > /dev/null fi diff --git a/build_tools/circle/linting.sh b/build_tools/circle/linting.sh index 2dd446c9ddc1c..aebe42dfecc70 100755 --- a/build_tools/circle/linting.sh +++ b/build_tools/circle/linting.sh @@ -38,7 +38,7 @@ git remote --verbose # Travis does the git clone with a limited depth (50 at the time of # writing). This may not be enough to find the common ancestor with -# $REMOTE/master so we unshallow the git checkout +# $REMOTE/main so we unshallow the git checkout if [[ -a .git/shallow ]]; then echo -e '\nTrying to unshallow the repo:' echo '--------------------------------------------------------------------------------' @@ -59,7 +59,7 @@ if [[ "$TRAVIS" == "true" ]]; then fi else # We want to fetch the code as it is in the PR branch and not - # the result of the merge into master. This way line numbers + # the result of the merge into main. This way line numbers # reported by Travis will match with the local code. LOCAL_BRANCH_REF=travis_pr_$TRAVIS_PULL_REQUEST # In Travis the PR target is always origin @@ -68,7 +68,7 @@ if [[ "$TRAVIS" == "true" ]]; then fi # If not using the commit range from Travis we need to find the common -# ancestor between $LOCAL_BRANCH_REF and $REMOTE/master +# ancestor between $LOCAL_BRANCH_REF and $REMOTE/main if [[ -z "$COMMIT_RANGE" ]]; then if [[ -z "$LOCAL_BRANCH_REF" ]]; then LOCAL_BRANCH_REF=$(git rev-parse --abbrev-ref HEAD) @@ -77,16 +77,16 @@ if [[ -z "$COMMIT_RANGE" ]]; then echo '--------------------------------------------------------------------------------' git --no-pager log -2 $LOCAL_BRANCH_REF - REMOTE_MASTER_REF="$REMOTE/master" - # Make sure that $REMOTE_MASTER_REF is a valid reference - echo -e "\nFetching $REMOTE_MASTER_REF" + REMOTE_MAIN_REF="$REMOTE/main" + # Make sure that $REMOTE_MAIN_REF is a valid reference + echo -e "\nFetching $REMOTE_MAIN_REF" echo '--------------------------------------------------------------------------------' - git fetch $REMOTE master:refs/remotes/$REMOTE_MASTER_REF + git fetch $REMOTE main:refs/remotes/$REMOTE_MAIN_REF LOCAL_BRANCH_SHORT_HASH=$(git rev-parse --short $LOCAL_BRANCH_REF) - REMOTE_MASTER_SHORT_HASH=$(git rev-parse --short $REMOTE_MASTER_REF) + REMOTE_MAIN_SHORT_HASH=$(git rev-parse --short $REMOTE_MAIN_REF) - COMMIT=$(git merge-base $LOCAL_BRANCH_REF $REMOTE_MASTER_REF) || \ - echo "No common ancestor found for $(git show $LOCAL_BRANCH_REF -q) and $(git show $REMOTE_MASTER_REF -q)" + COMMIT=$(git merge-base $LOCAL_BRANCH_REF $REMOTE_MAIN_REF) || \ + echo "No common ancestor found for $(git show $LOCAL_BRANCH_REF -q) and $(git show $REMOTE_MAIN_REF -q)" if [ -z "$COMMIT" ]; then exit 1 @@ -95,7 +95,7 @@ if [[ -z "$COMMIT_RANGE" ]]; then COMMIT_SHORT_HASH=$(git rev-parse --short $COMMIT) echo -e "\nCommon ancestor between $LOCAL_BRANCH_REF ($LOCAL_BRANCH_SHORT_HASH)"\ - "and $REMOTE_MASTER_REF ($REMOTE_MASTER_SHORT_HASH) is $COMMIT_SHORT_HASH:" + "and $REMOTE_MAIN_REF ($REMOTE_MAIN_SHORT_HASH) is $COMMIT_SHORT_HASH:" echo '--------------------------------------------------------------------------------' git --no-pager show --no-patch $COMMIT_SHORT_HASH diff --git a/build_tools/circle/push_doc.sh b/build_tools/circle/push_doc.sh index cb87a84548b84..5b94211e4e30e 100755 --- a/build_tools/circle/push_doc.sh +++ b/build_tools/circle/push_doc.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This script is meant to be called in the "deploy" step defined in +# This script is meant to be called in the "deploy" step defined in # circle.yml. See https://circleci.com/docs/ for more details. # The behavior of the script is controlled by environment variable defined # in the circle.yml in the top level folder of the project. @@ -23,7 +23,7 @@ fi # Absolute path needed because we use cd further down in this script GENERATED_DOC_DIR=$(readlink -f $GENERATED_DOC_DIR) -if [ "$CIRCLE_BRANCH" = "master" ] +if [ "$CIRCLE_BRANCH" = "main" ] then dir=dev else @@ -49,8 +49,8 @@ then touch $dir/index.html git add $dir fi -git checkout master -git reset --hard origin/master +git checkout main +git reset --hard origin/main if [ -d $dir ] then git rm -rf $dir/ && rm -rf $dir/ @@ -62,4 +62,4 @@ git config push.default matching git add -f $dir/ git commit -m "$MSG" $dir git push -echo $MSG +echo $MSG diff --git a/build_tools/travis/install.sh b/build_tools/travis/install.sh index e466e3da89a82..1e8e2963711ef 100644 --- a/build_tools/travis/install.sh +++ b/build_tools/travis/install.sh @@ -9,5 +9,5 @@ set -e if [[ $BUILD_WHEEL == true ]]; then source build_tools/travis/install_wheels.sh else - source build_tools/travis/install_master.sh + source build_tools/travis/install_main.sh fi diff --git a/build_tools/travis/install_master.sh b/build_tools/travis/install_main.sh similarity index 98% rename from build_tools/travis/install_master.sh rename to build_tools/travis/install_main.sh index e2e0534216c7c..423835df25d11 100755 --- a/build_tools/travis/install_master.sh +++ b/build_tools/travis/install_main.sh @@ -55,7 +55,7 @@ pip install joblib threadpoolctl pip install $(get_dep pytest $PYTEST_VERSION) pytest-xdist -# Build scikit-learn in this script to collapse the +# Build scikit-learn in this script to collapse the # verbose build output in the Travis output when it # succeeds python --version diff --git a/doc/about.rst b/doc/about.rst index 7df56fdd608a2..fdfe8241b8aec 100644 --- a/doc/about.rst +++ b/doc/about.rst @@ -107,7 +107,7 @@ Artwork ------- High quality PNG and SVG logos are available in the `doc/logos/ -`_ +`_ source directory. .. image:: images/scikit-learn-logo-notext.png diff --git a/doc/computing/computational_performance.rst b/doc/computing/computational_performance.rst index d47ac6f614183..32a485e21a2a5 100644 --- a/doc/computing/computational_performance.rst +++ b/doc/computing/computational_performance.rst @@ -336,7 +336,7 @@ compromise between model compactness and prediction power. One can also further tune the ``l1_ratio`` parameter (in combination with the regularization strength ``alpha``) to control this tradeoff. -A typical `benchmark `_ +A typical `benchmark `_ on synthetic data yields a >30% decrease in latency when both the model and input are sparse (with 0.000024 and 0.027400 non-zero coefficients ratio respectively). Your mileage may vary depending on the sparsity and size of diff --git a/doc/conf.py b/doc/conf.py index dc97f1fd5be75..adf12d9e88e82 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -78,8 +78,8 @@ # The encoding of source files. #source_encoding = 'utf-8' -# The master toctree document. -master_doc = 'contents' +# The main toctree document. +main_doc = 'contents' # General information about the project. project = 'scikit-learn' @@ -283,7 +283,7 @@ 'PEP440'.format(version)) if v.is_devrelease: - binder_branch = 'master' + binder_branch = 'main' else: major, minor = v.release[:2] binder_branch = '{}.{}.X'.format(major, minor) diff --git a/doc/developers/advanced_installation.rst b/doc/developers/advanced_installation.rst index 7fbceeeab4c47..37cb597776934 100644 --- a/doc/developers/advanced_installation.rst +++ b/doc/developers/advanced_installation.rst @@ -7,7 +7,7 @@ Installing the development version of scikit-learn ================================================== -This section introduces how to install the **master branch** of scikit-learn. +This section introduces how to install the **main branch** of scikit-learn. This can be done by either installing a nightly build or building from source. .. _install_nightly_builds: @@ -22,7 +22,7 @@ basis. Installing a nightly build is the quickest way to: - try a new feature that will be shipped in the next release (that is, a - feature from a pull-request that was recently merged to the master branch); + feature from a pull-request that was recently merged to the main branch); - check whether a bug you encountered has been fixed since the last release. diff --git a/doc/developers/contributing.rst b/doc/developers/contributing.rst index fb2c0aa997fe5..7f3aeb9537413 100644 --- a/doc/developers/contributing.rst +++ b/doc/developers/contributing.rst @@ -274,12 +274,12 @@ You should now have a working installation of scikit-learn, and your git repository properly configured. The next steps now describe the process of modifying code and submitting a PR: -7. Synchronize your master branch with the upstream master branch: +7. Synchronize your main branch with the upstream main branch: .. prompt:: bash $ - git checkout master - git pull upstream master + git checkout main + git pull upstream main 8. Create a feature branch to hold your development changes: @@ -288,7 +288,7 @@ modifying code and submitting a PR: git checkout -b my_feature and start making changes. Always use a feature branch. It's good - practice to never work on the ``master`` branch! + practice to never work on the ``main`` branch! 9. (**Optional**) Install `pre-commit `_ to run code style checks before each commit: @@ -341,7 +341,7 @@ latest changes of the main scikit-learn repository: .. prompt:: bash $ git fetch upstream - git merge upstream/master + git merge upstream/main Subsequently, you might need to solve the conflicts. You can refer to the `Git documentation related to resolving merge conflict using the command @@ -416,7 +416,7 @@ complies with the following rules before marking a PR as ``[MRG]``. The verify the correct behavior of the fix or feature. In this manner, further modifications on the code base are granted to be consistent with the desired behavior. In the case of bug fixes, at the time of the PR, the - non-regression tests should fail for the code base in the master branch + non-regression tests should fail for the code base in the main branch and pass for the PR code. 5. **Make sure that your PR does not add PEP8 violations**. To check the @@ -425,7 +425,7 @@ complies with the following rules before marking a PR as ``[MRG]``. The .. prompt:: bash $ - git diff upstream/master -u -- "*.py" | flake8 --diff + git diff upstream/main -u -- "*.py" | flake8 --diff or `make flake8-diff` which should work on unix-like system. @@ -450,7 +450,7 @@ complies with the following rules before marking a PR as ``[MRG]``. The performance and efficiency (see :ref:`monitoring_performances`) or through examples of usage. Examples also illustrate the features and intricacies of the library to users. Have a look at other examples in the `examples/ - `_ + `_ directory for reference. Examples should demonstrate why the new functionality is useful in practice and, if possible, compare it to other methods available in scikit-learn. @@ -931,24 +931,24 @@ scikit-learn. Make sure it is up to date: In the benchmark suite, the benchmarks are organized following the same structure as scikit-learn. For example, you can compare the performance of a -specific estimator between upstream/master and the branch you are working on: +specific estimator between upstream/main and the branch you are working on: .. prompt:: bash $ - asv continuous -b LogisticRegression upstream/master HEAD + asv continuous -b LogisticRegression upstream/main HEAD The command uses conda by default for creating the benchmark environments. If you want to use virtualenv instead, use the `-E` flag: .. prompt:: bash $ - asv continuous -E virtualenv -b LogisticRegression upstream/master HEAD + asv continuous -E virtualenv -b LogisticRegression upstream/main HEAD You can also specify a whole module to benchmark: .. prompt:: bash $ - asv continuous -b linear_model upstream/master HEAD + asv continuous -b linear_model upstream/main HEAD You can replace `HEAD` by any local branch. By default it will only report the benchmarks that have change by at least 10%. You can control this ratio with @@ -958,7 +958,7 @@ To run the full benchmark suite, simply remove the `-b` flag : .. prompt:: bash $ - asv continuous upstream/master HEAD + asv continuous upstream/main HEAD However this can take up to two hours. The `-b` flag also accepts a regular expression for a more complex subset of benchmarks to run. @@ -1254,7 +1254,7 @@ Reading the existing code base ============================== Reading and digesting an existing code base is always a difficult exercise -that takes time and experience to master. Even though we try to write simple +that takes time and experience to main. Even though we try to write simple code in general, understanding the code can seem overwhelming at first, given the sheer size of the project. Here is a list of tips that may help make this task easier and faster (in no particular order). diff --git a/doc/developers/maintainer.rst b/doc/developers/maintainer.rst index 9770a0a570e8b..e4115e87025c7 100644 --- a/doc/developers/maintainer.rst +++ b/doc/developers/maintainer.rst @@ -48,8 +48,8 @@ permissions given to maintainers, which includes: - *maintainer* role on ``scikit-learn`` projects on ``pypi.org`` and ``test.pypi.org``, separately. -- become a member of the *scikit-learn* team on conda-forge by editing the - ``recipe/meta.yaml`` file on +- become a member of the *scikit-learn* team on conda-forge by editing the + ``recipe/meta.yaml`` file on ``https://github.com/conda-forge/scikit-learn-feedstock`` .. _preparing_a_release_pr: @@ -77,8 +77,8 @@ branch: .. prompt:: bash $ # Assuming upstream is an alias for the main scikit-learn repo: - git fetch upstream master - git checkout upstream/master + git fetch upstream main + git checkout upstream/main git checkout -b 0.99.X git push --set-upstream upstream 0.99.X @@ -98,11 +98,11 @@ in the description of the Pull Request to track progress. This PR will be used to push commits related to the release as explained in :ref:`making_a_release`. -You can also create a second PR from master and targeting master to increment +You can also create a second PR from main and targeting main to increment the ``__version__`` variable in `sklearn/__init__.py` to increment the dev version. This means while we're in the release candidate period, the latest -stable is two versions behind the master branch, instead of one. In this PR -targeting master you should also include a new file for the matching version +stable is two versions behind the main branch, instead of one. In this PR +targeting main you should also include a new file for the matching version under the ``doc/whats_new/`` folder so PRs that target the next version can contribute their changelog entries to this file in parallel to the release process. @@ -118,11 +118,11 @@ First, create a branch, **on your own fork** (to release e.g. `0.99.3`): .. prompt:: bash $ - # assuming master and upstream/master are the same - git checkout -b release-0.99.3 master + # assuming main and upstream/main are the same + git checkout -b release-0.99.3 main Then, create a PR **to the** `scikit-learn/0.99.X` **branch** (not to -master!) with all the desired changes: +main!) with all the desired changes: .. prompt:: bash $ @@ -145,7 +145,7 @@ Making a release in :ref:`preparing_a_release_pr` above. 1. Update docs. Note that this is for the final release, not necessarily for - the RC releases. These changes should be made in master and cherry-picked + the RC releases. These changes should be made in main and cherry-picked into the release branch, only before the final release. - Edit the ``doc/whats_new/v0.99.rst`` file to add release title and list of @@ -173,7 +173,7 @@ Making a release 3. Trigger the wheel builder with the ``[cd build]`` commit marker using the command: - + .. prompt:: bash $ git commit --allow-empty -m "Trigger wheel builder workflow: [cd build]" @@ -288,7 +288,7 @@ Release checklist The following GitHub checklist might be helpful in a release PR:: * [ ] update news and what's new date in release branch - * [ ] update news and what's new date and sklearn dev0 version in master branch + * [ ] update news and what's new date and sklearn dev0 version in main branch * [ ] check that the for the release wheels can be built successfully * [ ] merge the PR with `[cd build]` commit message to upload wheels to the staging repo * [ ] upload the wheels and source tarball to https://test.pypi.org @@ -363,10 +363,10 @@ deprecation cycle. To create an experimental module, you can just copy and modify the content of `enable_hist_gradient_boosting.py -`_, +`_, or `enable_iterative_imputer.py -`_. +`_. Note that the public import path must be to a public subpackage (like ``sklearn/ensemble`` or ``sklearn/impute``), not just a ``.py`` module. @@ -379,14 +379,14 @@ in the future when the features aren't experimental anymore. To avoid type checker (e.g. mypy) errors a direct import of experimental estimators should be done in the parent module, protected by the ``if typing.TYPE_CHECKING`` check. See `sklearn/ensemble/__init__.py -`_, +`_, or `sklearn/impute/__init__.py -`_ +`_ for an example. Please also write basic tests following those in `test_enable_hist_gradient_boosting.py -`_. +`_. Make sure every user-facing code you write explicitly mentions that the feature is experimental, and add a ``# noqa`` comment to avoid pep8-related warnings:: diff --git a/doc/developers/tips.rst b/doc/developers/tips.rst index 06b0e966f1569..8cf5bd5b5d094 100644 --- a/doc/developers/tips.rst +++ b/doc/developers/tips.rst @@ -79,7 +79,7 @@ When a unit test fails, the following tricks can make debugging easier: 2. The argument ``pytest --pdb`` drops into the Python debugger on failure. To instead drop into the rich IPython debugger ``ipdb``, you may set up a shell alias to: - + .. prompt:: bash $ pytest --pdbcls=IPython.terminal.debugger:TerminalPdb --capture no @@ -200,7 +200,7 @@ PR-WIP: What's needed before merge? PR-WIP: Regression test needed :: - Please add a [non-regression test](https://en.wikipedia.org/wiki/Non-regression_testing) that would fail at master but pass in this PR. + Please add a [non-regression test](https://en.wikipedia.org/wiki/Non-regression_testing) that would fail at main but pass in this PR. PR-WIP: PEP8 :: diff --git a/doc/faq.rst b/doc/faq.rst index 070ecff38be9e..0ebd4df759125 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -261,7 +261,7 @@ state in the child process is corrupted: the thread pool believes it has many threads while only the main thread state has been forked. It is possible to change the libraries to make them detect when a fork happens and reinitialize the thread pool in that case: we did that for OpenBLAS (merged upstream in -master since 0.2.10) and we contributed a `patch +main since 0.2.10) and we contributed a `patch `_ to GCC's OpenMP runtime (not yet reviewed). @@ -379,8 +379,8 @@ data structures. Do you plan to implement transform for target y in a pipeline? ---------------------------------------------------------------------------- -Currently transform only works for features X in a pipeline. -There's a long-standing discussion about +Currently transform only works for features X in a pipeline. +There's a long-standing discussion about not being able to transform y in a pipeline. Follow on github issue `#4143 `_. @@ -388,11 +388,11 @@ Meanwhile check out :class:`~compose.TransformedTargetRegressor`, `pipegraph `_, `imbalanced-learn `_. -Note that Scikit-learn solved for the case where y -has an invertible transformation applied before training +Note that Scikit-learn solved for the case where y +has an invertible transformation applied before training and inverted after prediction. Scikit-learn intends to solve for -use cases where y should be transformed at training time -and not at test time, for resampling and similar uses, -like at imbalanced learn. -In general, these use cases can be solved +use cases where y should be transformed at training time +and not at test time, for resampling and similar uses, +like at `imbalanced-learn`. +In general, these use cases can be solved with a custom meta estimator rather than a Pipeline diff --git a/doc/themes/scikit-learn/layout.html b/doc/themes/scikit-learn/layout.html index 7259cd40ee368..41f4215c3b2e7 100644 --- a/doc/themes/scikit-learn/layout.html +++ b/doc/themes/scikit-learn/layout.html @@ -66,7 +66,7 @@
{%- if logo %} - diff --git a/doc/themes/scikit-learn/static/img/scikit-learn-logo.svg b/doc/themes/scikit-learn/static/img/scikit-learn-logo.svg index 47ee0c75d5661..a4beb202d0967 100644 --- a/doc/themes/scikit-learn/static/img/scikit-learn-logo.svg +++ b/doc/themes/scikit-learn/static/img/scikit-learn-logo.svg @@ -6,7 +6,7 @@ - scikit-learn/doc/logos/scikit-learn-logo.svg at master · scikit-learn/scikit-learn + scikit-learn/doc/logos/scikit-learn-logo.svg at main · scikit-learn/scikit-learn @@ -18,8 +18,8 @@ - - + + @@ -27,8 +27,8 @@ - - + + @@ -36,12 +36,12 @@ - + - + @@ -55,7 +55,7 @@ - + @@ -63,9 +63,9 @@
- - - + + +
@@ -87,10 +87,10 @@
@@ -136,9 +136,9 @@
- - + +
- - + +
- +
- +
    @@ -297,7 +297,7 @@
  • - +
    Unstar @@ -342,7 +342,7 @@
    - +
    @@ -411,9 +411,9 @@
    - - + +
    - +
    - +
    @@ -474,7 +474,7 @@
    - + @@ -482,19 +482,19 @@ -Show File Finder +Show File Finder
    - +
    + data-main-branch="main" + data-ref="main"> branch: - master + main
    @@ -568,7 +568,7 @@
    - master + main
    @@ -576,10 +576,10 @@

    Create branch:

    - from ‘master’ + from ‘main’
    - + @@ -803,12 +803,12 @@
    -
    +
    Fetching contributors…
    @@ -829,14 +829,14 @@
    Delete @@ -1044,7 +1044,6 @@ Something went wrong with that request. Please try again.
    - + - diff --git a/doc/tutorial/text_analytics/working_with_text_data.rst b/doc/tutorial/text_analytics/working_with_text_data.rst index 817a5b1f547cc..26ff51b0cf3df 100644 --- a/doc/tutorial/text_analytics/working_with_text_data.rst +++ b/doc/tutorial/text_analytics/working_with_text_data.rst @@ -34,7 +34,7 @@ The source of this tutorial can be found within your scikit-learn folder:: scikit-learn/doc/tutorial/text_analytics/ The source can also be found `on Github -`_. +`_. The tutorial folder should contain the following sub-folders: diff --git a/maint_tools/whats_missing.sh b/maint_tools/whats_missing.sh index 5b2d6b8fd8a01..6627778d8d346 100755 --- a/maint_tools/whats_missing.sh +++ b/maint_tools/whats_missing.sh @@ -11,7 +11,7 @@ from_branch=$1 to_file=$2 logged_prs() { - git log --oneline $from_branch..master sklearn/ | + git log --oneline $from_branch..main sklearn/ | grep -wv -e CLN -e TST -e CI -e DOC -e doc -e MNT -e MAINT -e BLD -e COSMIT -e EXA -e examples -e example -e minor -e STY -e Style -e docstring | grep -o '(#[0-9][0-9]\+)$' | grep -o '[0-9]\+'