diff --git a/.circleci/config.yml b/.circleci/config.yml index 9324de943607..8cf18d809d86 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,9 +40,9 @@ jobs: name: create release notes command: | . venv/bin/activate - pip install git+https://github.com/hawkowl/towncrier.git@master + pip install towncrier VERSION=$(python -c "import setup; print(setup.VERSION)") - towncrier --version $VERSION --yes + towncrier build --version $VERSION --yes ./tools/ci/test_all_newsfragments_used.py - run: @@ -62,6 +62,7 @@ jobs: - run: name: build devdocs + no_output_timeout: 30m command: | . venv/bin/activate cd doc @@ -90,7 +91,7 @@ jobs: - run: name: deploy devdocs command: | - if [ "${CIRCLE_BRANCH}" == "master" ]; then + if [ "${CIRCLE_BRANCH}" == "main" ]; then touch doc/build/html/.nojekyll ./tools/ci/push_docs_to_repo.py doc/build/html \ @@ -100,7 +101,7 @@ jobs: --message "Docs build of $CIRCLE_SHA1" \ --force else - echo "Not on the master branch; skipping deployment" + echo "Not on the main branch; skipping deployment" fi - add_ssh_keys: @@ -119,7 +120,7 @@ jobs: - run: name: deploy neps command: | - if [ "${CIRCLE_BRANCH}" == "master" ]; then + if [ "${CIRCLE_BRANCH}" == "main" ]; then touch doc/neps/_build/html/.nojekyll ./tools/ci/push_docs_to_repo.py doc/neps/_build/html \ @@ -129,5 +130,5 @@ jobs: --message "Docs build of $CIRCLE_SHA1" \ --force else - echo "Not on the master branch; skipping deployment" + echo "Not on the main branch; skipping deployment" fi diff --git a/.codecov.yml b/.codecov.yml index 8c19f9e8ee58..165b3099df18 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -6,8 +6,9 @@ coverage: status: project: default: - # Require 1% coverage, i.e., always succeed - target: 1 - patch: true + informational: true + patch: + default: + informational: true changes: false comment: off diff --git a/.dependabot/config.yml b/.dependabot/config.yml deleted file mode 100644 index 160ec85cfa7f..000000000000 --- a/.dependabot/config.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: 1 -update_configs: - - package_manager: "python" - directory: "/" - update_schedule: "weekly" - commit_message: - prefix: "MAINT" - default_labels: - - "03 - Maintenance" diff --git a/.gitattributes b/.gitattributes index bce3dbe6daad..8723dd9dc95a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,21 +1,109 @@ -# Numerical data files -numpy/lib/tests/data/*.npy binary - -# Release notes, reduce number of conflicts. -doc/release/*.rst merge=union - # Highlight our custom templating language as C, since it's hopefully better # than nothing. This also affects repo statistics. -*.c.src linguist-language=C -*.inc.src linguist-language=C -*.h.src linguist-language=C +*.c.src text linguist-language=C +*.inc.src text linguist-language=C +*.h.src text linguist-language=C +*.pyx.in text linguist-language=Python +*.pxd.in text linguist-language=Python # Mark some files as vendored numpy/linalg/lapack_lite/f2c.c linguist-vendored numpy/linalg/lapack_lite/f2c.h linguist-vendored tools/npy_tempita/* linguist-vendored +numpy/core/include/numpy/libdivide/* linguist-vendored # Mark some files as generated numpy/linalg/lapack_lite/f2c_*.c linguist-generated numpy/linalg/lapack_lite/lapack_lite_names.h linguist-generated +numpy/_version.py export-subst + +# Configuration files +*.ini text +*.cfg text +./MANIFEST.in text +./numpy/core/npymath.ini.in text +./numpy/core/mlib.ini.in text +./site.cfg.example text + +# Python sources +*.py text diff=python +*.pxd text diff=python +*.pyx text diff=python +*.pyi text diff=python + +# C/C++ sources +*.c text diff=c +*.h text diff=c +*.cc text diff=cpp +*.cxx text diff=cpp +*.cpp text diff=cpp +*.hpp text diff=cpp +*.hh text diff=cpp + +# Fortran sources +*.f text diff=fortran +*.for text diff=fortran +*.f90 text diff=fortran +*.f95 text diff=fortran +*.f03 text diff=fortran + +# JavaScript +*.js text + +# F2py +./doc/source/f2py/*.pyf text +./doc/source/f2py/*.dat text +./numpy/f2py/tests/src/module_data/mod.mod binary + +# Documents +*.md text diff=markdown +*.txt text +*.rst text +*.pdf binary +*.css text diff=css +*.html text diff=html + +# Graphics +*.png binary +*.ico binary +*.dia binary +*.gif binary +*.odg binary +*.fig text +*.svg text +# SVG is treated as an asset (binary) by default. If you want +# to treat it as binary, use the following line instead. +# *.svg binary + +# Scripts +*.sh text eol=lf +*.sed text +# These are explicitly windows files and should use crlf +*.bat text eol=crlf +*.cmd text eol=crlf + +# Serialisation +*.json text +*.toml text +*.xml text +*.yaml text +*.yml text + +# Data files +*.csv text +*.pkl binary +*.fits binary +*.npy binary +*.npz binary + +# Misc. +*.swg text +*.patch text +./doc/neps/index.rst.tmpl text +./benchmarks/asv_compare.conf.json.tpl text +./tools/swig/test/*.i text +./tools/gitpod/gitpod.Dockerfile text +./doc/source/dev/gitwash/git_links.inc text +./doc/source/reference/simd/*.inc text +./numpy/core/src/_simd/*.inc text diff=c diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index da599095647a..8f16950f765e 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -8,7 +8,7 @@ also include a brief, self-contained code example that demonstrates the problem. If you are reporting a segfault please include a GDB traceback, which you can generate by following -[these instructions.](https://github.com/numpy/numpy/blob/master/doc/source/dev/development_environment.rst#debugging) +[these instructions.](https://github.com/numpy/numpy/blob/main/doc/source/dev/development_environment.rst#debugging) ## Contributing code diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index 78ffc1063eaf..6da1f7370d00 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -20,7 +20,7 @@ import numpy as np +https://github.com/numpy/numpy/blob/main/doc/source/dev/development_environment.rst#debugging --> diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md index 00c6f59c5faf..68872ec06caf 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -12,5 +12,5 @@ post your idea on the [numpy-discussion mailing list] (https://mail.python.org/mailman/listinfo/numpy-discussion) to explain your reasoning in addition to opening an issue or pull request. You can also check out our [Contributor Guide] -(https://github.com/numpy/numpy/blob/master/doc/source/dev/index.rst) if you +(https://github.com/numpy/numpy/blob/main/doc/source/dev/index.rst) if you need more information. --> diff --git a/.github/ISSUE_TEMPLATE/post-install.md b/.github/ISSUE_TEMPLATE/post-install.md index c0ec7896a40d..11b91384c1fd 100644 --- a/.github/ISSUE_TEMPLATE/post-install.md +++ b/.github/ISSUE_TEMPLATE/post-install.md @@ -15,7 +15,7 @@ labels: 32 - Installation +https://github.com/numpy/numpy/blob/main/doc/source/dev/development_environment.rst#debugging --> diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 508c8c034869..704d2d16fd9c 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,16 +1,16 @@ - + diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000000..16ce0846cb59 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,22 @@ +version: 2 +updates: +- package-ecosystem: pip + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 10 + labels: + - 03 - Maintenance + ignore: + - dependency-name: gitpython + versions: + - "> 3.1.13, < 3.2" + - dependency-name: pydata-sphinx-theme + versions: + - 0.6.0 + - 0.6.1 + - dependency-name: hypothesis + versions: + - 6.3.0 + commit-message: + prefix: MAINT diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index d38ae0934b33..c7d463348f6d 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -1,6 +1,14 @@ name: Build_Test -on: [push, pull_request] +on: + push: + branches: + - main + - maintenance/** + pull_request: + branches: + - main + - maintenance/** defaults: run: @@ -11,7 +19,27 @@ env: PYTHON_VERSION: 3.7 jobs: + lint: + if: "github.repository == 'numpy/numpy' && github.ref != 'refs/heads/main' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip github]')" + runs-on: ubuntu-latest + continue-on-error: true + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + fetch-depth: 0 + - uses: actions/setup-python@v2 + with: + python-version: ${{ env.PYTHON_VERSION }} + - name: Install linter requirements + run: + python -m pip install -r linter_requirements.txt + - name: Run linter on PR diff + run: + python tools/linter.py --branch origin/${{ github.base_ref }} + smoke_test: + if: "github.repository == 'numpy/numpy' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip github]')" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -24,7 +52,7 @@ jobs: - uses: ./.github/actions basic: - needs: smoke_test + needs: [smoke_test, lint] runs-on: ubuntu-latest strategy: matrix: @@ -36,11 +64,11 @@ jobs: fetch-depth: 0 - uses: actions/setup-python@v2 with: - python-version: ${{ env.PYTHON_VERSION }} + python-version: ${{ matrix.python-version }} - uses: ./.github/actions debug: - needs: smoke_test + needs: [smoke_test, lint] runs-on: ubuntu-20.04 env: USE_DEBUG: 1 @@ -55,7 +83,7 @@ jobs: - uses: ./.github/actions blas64: - needs: smoke_test + needs: [smoke_test, lint] runs-on: ubuntu-latest env: NPY_USE_BLAS_ILP64: 1 @@ -70,8 +98,8 @@ jobs: - uses: ./.github/actions full: - needs: smoke_test - runs-on: ubuntu-latest + needs: [smoke_test, lint] + runs-on: ubuntu-18.04 env: USE_WHEEL: 1 RUN_FULL_TESTS: 1 @@ -88,7 +116,7 @@ jobs: - uses: ./.github/actions benchmark: - needs: smoke_test + needs: [smoke_test, lint] runs-on: ubuntu-latest env: PYTHONOPTIMIZE: 2 @@ -109,7 +137,7 @@ jobs: - uses: ./.github/actions no_relaxed_strides: - needs: smoke_test + needs: [smoke_test, lint] runs-on: ubuntu-latest env: NPY_RELAXED_STRIDES_CHECKING: 0 @@ -126,7 +154,7 @@ jobs: - uses: ./.github/actions use_wheel: - needs: smoke_test + needs: [smoke_test, lint] runs-on: ubuntu-latest env: USE_WHEEL: 1 @@ -142,7 +170,7 @@ jobs: - uses: ./.github/actions no_array_func: - needs: smoke_test + needs: [smoke_test, lint] runs-on: ubuntu-latest env: NUMPY_EXPERIMENTAL_ARRAY_FUNCTION: 0 @@ -157,7 +185,7 @@ jobs: - uses: ./.github/actions no_openblas: - needs: smoke_test + needs: [smoke_test, lint] runs-on: ubuntu-latest env: BLAS: None @@ -175,27 +203,30 @@ jobs: - uses: ./.github/actions pypy37: - needs: smoke_test + needs: [smoke_test, lint] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: submodules: recursive fetch-depth: 0 - - name: get_pypy - run: | - wget -q https://downloads.python.org/pypy/pypy3.6-v7.3.2-linux64.tar.bz2 -O pypy.tar.bz2 - mkdir -p pypy3 - (cd pypy3; tar --strip-components=1 -xf ../pypy.tar.bz2) - pypy3/bin/pypy3 -mensurepip - pypy3/bin/pypy3 -m pip install --upgrade pip wheel - if [ ! -e pypy3/bin/python ] - then - pushd pypy3/bin - ln -s pypy3 python - popd - fi - echo $PWD/pypy3/bin >> $GITHUB_PATH + - uses: actions/setup-python@v2 + with: + python-version: pypy-3.7-v7.3.4 + - uses: ./.github/actions + sdist: + needs: [smoke_test, lint] + runs-on: ubuntu-latest + env: + USE_SDIST: 1 + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + fetch-depth: 0 + - uses: actions/setup-python@v2 + with: + python-version: ${{ env.PYTHON_VERSION }} - uses: ./.github/actions diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 000000000000..cc4950590af0 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,57 @@ +name: Build Base Docker Image + +on: + push: + branches: + - main + paths: + - 'environment.yml' + +jobs: + build: + name: Build base Docker image + runs-on: ubuntu-latest + environment: numpy-dev + if: "github.repository_owner == 'numpy' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip github]')" + steps: + - name: Clone repository + uses: actions/checkout@v2 + - name: Lint Docker + uses: brpaz/hadolint-action@v1.2.1 + with: + dockerfile: ./tools/gitpod/Dockerfile + - name: Get refs + shell: bash + run: | + export raw_branch=${GITHUB_REF#refs/heads/} + echo "::set-output name=branch::${raw_branch//\//-}" + echo "::set-output name=date::$(date +'%Y%m%d')" + echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)" + id: getrefs + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: ${{ runner.os }}-buildx- + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: "." + file: "./tools/gitpod/Dockerfile" + push: ${{ github.event_name != 'pull_request' }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + tags: | + numpy/numpy-dev:${{ steps.getrefs.outputs.date }}-${{ steps.getrefs.outputs.branch}}-${{ steps.getrefs.outputs.sha8 }}, numpy/numpy-dev:latest + - name: Image digest + # Return details of the image build: sha and shell + run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/.github/workflows/gitpod.yml b/.github/workflows/gitpod.yml new file mode 100644 index 000000000000..55683bcae78d --- /dev/null +++ b/.github/workflows/gitpod.yml @@ -0,0 +1,55 @@ +name: Build Gitpod Docker image + +on: + push: + branches: + - main + +jobs: + build: + name: Build Gitpod Docker image + runs-on: ubuntu-latest + environment: numpy-dev + if: "github.repository_owner == 'numpy' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip github]')" + steps: + - name: Clone repository + uses: actions/checkout@v2 + - name: Lint Docker + uses: brpaz/hadolint-action@v1.2.1 + with: + dockerfile: ./tools/gitpod/gitpod.Dockerfile + - name: Get refs + shell: bash + run: | + export raw_branch=${GITHUB_REF#refs/heads/} + echo "::set-output name=branch::${raw_branch//\//-}" + echo "::set-output name=date::$(date +'%Y%m%d')" + echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)" + id: getrefs + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: ${{ runner.os }}-buildx- + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: "." + file: "./tools/gitpod/gitpod.Dockerfile" + push: ${{ github.event_name != 'pull_request' }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + tags: | + numpy/numpy-gitpod:${{ steps.getrefs.outputs.date }}-${{ steps.getrefs.outputs.branch}}-${{ steps.getrefs.outputs.sha8 }}, numpy/numpy-gitpod:latest + - name: Image digest + # Return details of the image build: sha and shell + run: echo ${{ steps.docker_build.outputs.digest }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index d24605871e4b..a2a1f2b68725 100644 --- a/.gitignore +++ b/.gitignore @@ -120,9 +120,7 @@ numpy/__config__.py numpy/core/include/numpy/__multiarray_api.h numpy/core/include/numpy/__ufunc_api.h numpy/core/include/numpy/_numpyconfig.h -numpy/version.py site.cfg -setup.cfg .tox numpy/core/include/numpy/__multiarray_api.c numpy/core/include/numpy/__ufunc_api.c @@ -131,20 +129,11 @@ numpy/core/include/numpy/config.h numpy/core/include/numpy/multiarray_api.txt numpy/core/include/numpy/ufunc_api.txt numpy/core/lib/ -numpy/core/src/_simd/_simd.dispatch.avx512_skx.c -numpy/core/src/_simd/_simd.dispatch.avx512f.c -numpy/core/src/_simd/_simd.dispatch.c -numpy/core/src/_simd/_simd.dispatch.fma3.avx2.c -numpy/core/src/_simd/_simd.dispatch.h -numpy/core/src/_simd/_simd.dispatch.sse42.c -numpy/core/src/_simd/_simd_data.inc -numpy/core/src/_simd/_simd_inc.h numpy/core/src/common/npy_binsearch.h numpy/core/src/common/npy_cpu_features.c numpy/core/src/common/npy_partition.h numpy/core/src/common/npy_sort.h numpy/core/src/common/templ_common.h -numpy/core/src/common/_cpu_dispatch.h numpy/core/src/multiarray/_multiarray_tests.c numpy/core/src/multiarray/arraytypes.c numpy/core/src/multiarray/einsum.c @@ -181,9 +170,7 @@ numpy/core/src/umath/simd.inc numpy/core/src/umath/struct_ufunc_test.c numpy/core/src/umath/test_rational.c numpy/core/src/umath/umath_tests.c -numpy/core/src/umath/_umath_tests.dispatch.avx2.c -numpy/core/src/umath/_umath_tests.dispatch.h -numpy/core/src/umath/_umath_tests.dispatch.sse41.c +numpy/core/src/umath/loops_utils.h numpy/distutils/__config__.py numpy/linalg/umath_linalg.c doc/source/**/generated/ @@ -200,6 +187,7 @@ numpy/random/legacy/*.c numpy/random/_mtrand/randint_helpers.pxi numpy/random/bounded_integers.pyx numpy/random/bounded_integers.pxd +numpy/random/lib/npyrandom.lib tools/swig/test/Array_wrap.cxx tools/swig/test/Farray_wrap.cxx tools/swig/test/Farray.py @@ -214,3 +202,20 @@ tools/swig/test/Tensor.py tools/swig/test/Vector.py tools/swig/test/Vector_wrap.cxx tools/swig/test/Array.py + +# SIMD generated files # +################################### +# config headers of dispatchable sources +*.dispatch.h +# wrapped sources of dispatched targets, e.g. *.dispatch.avx2.c +*.dispatch.*.c +# _simd module +numpy/core/src/_simd/_simd.dispatch.c +numpy/core/src/_simd/_simd_data.inc +numpy/core/src/_simd/_simd_inc.h +# umath module +numpy/core/src/umath/loops_unary_fp.dispatch.c +numpy/core/src/umath/loops_arithm_fp.dispatch.c +numpy/core/src/umath/loops_arithmetic.dispatch.c +numpy/core/src/umath/loops_trigonometric.dispatch.c +numpy/core/src/umath/loops_exponent_log.dispatch.c diff --git a/.gitmodules b/.gitmodules index e69de29bb2d1..0d6857868837 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "doc/source/_static/scipy-mathjax"] + path = doc/source/_static/scipy-mathjax + url = https://github.com/scipy/scipy-mathjax.git diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 000000000000..dfbee831a33b --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,63 @@ +# Rebuilding NumPy on init - rather than on prebuild: this ensures +# that even forks do have a usable freshly built NumPy +# Might delegate this later to prebuild with Q2 improvements on gitpod +# https://www.gitpod.io/docs/config-start-tasks/#configuring-the-terminal +# ------------------------------------------------------------------------- + +image: numpy/numpy-gitpod:latest +tasks: + - name: Prepare development + init: | + mkdir -p .vscode + cp tools/gitpod/settings.json .vscode/settings.json + conda activate numpy-dev + python setup.py build_ext --inplace + echo "🛠 Completed rebuilding NumPy!! 🛠 " + echo "📖 Building docs 📖 " + git submodule update --init + cd doc + make html + echo "✨ Pre-build complete! You can close this terminal ✨ " + + +# -------------------------------------------------------- +# exposing ports for liveserve +ports: + - port: 5500 + onOpen: notify + +# -------------------------------------------------------- +# some useful extensions to have +vscode: + extensions: + - eamodio.gitlens + - njpwerner.autodocstring + - lextudio.restructuredtext + - ritwickdey.liveserver + - ms-python.python + - yzhang.markdown-all-in-one + - bungcip.better-toml + - mhutchie.git-graph + +# -------------------------------------------------------- +# using prebuilds for the container - note: atm this only +# works for the NumPy repo +# With this configuration the prebuild will happen on push to master +github: + prebuilds: + # enable for main/default branch + master: true + # enable for other branches (defaults to false) + branches: false + # enable for pull requests coming from this repo (defaults to true) + pullRequests: false + # enable for pull requests coming from forks (defaults to false) + pullRequestsFromForks: false + # add a check to pull requests (defaults to true) + addCheck: false + # add a "Review in Gitpod" button as a comment to pull requests (defaults to false) + addComment: false + # add a "Review in Gitpod" button to the pull request's description (defaults to false) + addBadge: false + # add a label once the prebuild is ready to pull requests (defaults to false) + addLabel: false \ No newline at end of file diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 000000000000..0188ba2cf627 --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,7 @@ +--- +ignored: + - DL3006 + - DL3008 + - SC2016 + - DL3004 + - DL3007 \ No newline at end of file diff --git a/.mailmap b/.mailmap index f3fd63519e3b..3f45904fcd8b 100644 --- a/.mailmap +++ b/.mailmap @@ -8,294 +8,429 @@ # This file is up-to-date if the command git log --format="%aN <%aE>" | sort -u # gives no duplicates. -Aaron Baecker abaecker -Aarthi Agurusa agurusa -Alan Fontenot logeaux -Alan Fontenot logeaux <36168460+logeaux@users.noreply.github.com> -Abdul Muneer abdulmuneer -Abhilash Barigidad abhilash42 <64172584+abhilash42@users.noreply.github.com> -Abhinav Reddy tabhi0797 -Adam Ginsburg Adam Ginsburg -Albert Jornet Puig jurnix -Alex Rockhill Alex -Alex Griffing alex -Alex Griffing argriffing -Alex Griffing argriffing -Alex Griffing argriffing -Alex Thomas alexthomas93 -Alexander Belopolsky Alexander Belopolsky -Alexander Belopolsky Alexander Belopolsky +@8bitmp3 <19637339+8bitmp3@users.noreply.github.com> +@DWesl <22566757+DWesl@users.noreply.github.com> +@Endolith +@Illviljan <14371165+Illviljan@users.noreply.github.com> +@LSchroefl <65246829+LSchroefl@users.noreply.github.com> +@Lbogula +@Lisa <34400837+lyzlisa@users.noreply.github.com> +@Patrick <39380924+xamm@users.noreply.github.com> +@Scian <65375075+hoony6134@users.noreply.github.com> +@h-vetinari +@h6197627 <44726212+h6197627@users.noreply.github.com> +@jbCodeHub +@legoffant <58195095+legoffant@users.noreply.github.com> +@luzpaz +@luzpaz +@sfolje0 +@spacescientist +@tautaus +@xoviat <49173759+xoviat@users.noreply.github.com> +@xoviat <49173759+xoviat@users.noreply.github.com> +@yetanothercheer +Aaron Baecker +Aarthi Agurusa +Alan Fontenot +Alan Fontenot <36168460+logeaux@users.noreply.github.com> +Abdul Muneer +Abhilash Barigidad +Abhilash Barigidad <64172584+abhilash42@users.noreply.github.com> +Abhinav Reddy +Adam Ginsburg +Aerik Pawson <45904740+aerikpawson@users.noreply.github.com> +Albert Jornet Puig +Alex Rockhill +Alex Griffing +Alex Griffing +Alex Griffing +Alex Henrie +Alex Rogozhnikov +Alex Thomas +Alexander Belopolsky +Alexander Belopolsky +Alexander Belopolsky Alexander Belopolsky sasha -Alexander Jung aleju -Alexander Shadchin Alexandr Shadchin -Alexander Shadchin shadchin -Allan Haldane ahaldane +Alexander Hunt +Alexander Jung +Alexander Shadchin +Alexander Shadchin +Alizé Papp <68250865+alize-papp@users.noreply.github.com> +Allan Haldane +Al-Baraa El-Hag <48454648+a-elhag@users.noreply.github.com> Alok Singhal Alok Singhal -Alyssa Quek alyssaq -Amir Sarabadani amir -Anatoly Techtonik anatoly techtonik -Andras Deak adeak -Andrea Olivo andryandrew@gmail.com andryandrew -Andrea Pattori patto90 -Andrea Sangalli and-sang <53617841+and-sang@users.noreply.github.com> -Andrei Kucharavy chiffa -Anne Archibald aarchiba -Anne Archibald Anne Archibald -Anže Starič astaric -Aron Ahmadia ahmadia -Arun Persaud Arun Persaud -Ashutosh Singh ashutosh619-sudo -Ashutosh Singh Ashutosh singh <55102089+Ashutosh619-sudo@users.noreply.github.com> -Åsmund Hjulstad Åsmund Hjulstad -Auke Wiggers auke -Badhri Narayanan Krishnakumar badhrink -Bangcheng Yang DumbMice -Behzad Nouri behzad nouri -Ben Nathanson bjnath -Benjamin Root Ben Root +Alyssa Quek +Amir Sarabadani +Anas Khan +Anatoly Techtonik +Andras Deak +Andrea Olivo +Andrea Pattori +Andrea Sangalli <53617841+and-sang@users.noreply.github.com> +Andreas Klöckner +Andreas Schwab +Andrei Kucharavy +Andrew Lawson +Anirudh Subramanian +Anne Archibald +Anne Archibald +Anne Bonner <35413198+bonn0062@users.noreply.github.com> +Anthony Vo <43098273+anthonyhvo12@users.noreply.github.com> +Antoine Pitrou +Anže Starič +Aron Ahmadia +Arun Persaud +Ashutosh Singh +Ashutosh Singh <55102089+Ashutosh619-sudo@users.noreply.github.com> +Åsmund Hjulstad +Auke Wiggers +Badhri Narayanan Krishnakumar +Bangcheng Yang +Bhargav V <12525622+brpy@users.noreply.github.com> +Bas van Beek <43369155+BvB93@users.noreply.github.com> +Behzad Nouri +Ben Nathanson +Benjamin Root Benjamin Root weathergod -Bernardt Duvenhage bduvenhage -Bertrand Lefebvre bertrand -Bertrand Lefebvre Bertrand -Bharat Raghunathan Bharat123Rox -Bill Spotz William Spotz -Bill Spotz wfspotz@sandia.gov -Bob Eldering bobeldering -Brett R Murphy brettrmurphy +Bernardt Duvenhage +Bernie Gray +Bertrand Lefebvre +Bharat Raghunathan +Bharat Raghunathan +Bob Eldering +Brett R Murphy +Brigitta Sipocz +Brian Soto +Brian Soto +Brian Soto Bryan Van de Ven Bryan Van de Ven Bryan Van de Ven Bryan Van de Ven -Bui Duc Minh Mibu287 <41239569+Mibu287@users.noreply.github.com> -Carl Kleffner carlkl -Carl Leake leakec -Chris Burns chris.burns -Chris Kerr Chris Kerr -Christian Clauss cclauss -Christopher Hanley chanley +Bui Duc Minh <41239569+Mibu287@users.noreply.github.com> +Carl Kleffner +Carl Leake +Charles Stern <62192187+cisaacstern@users.noreply.github.com> +Chris Barker +Chris Burns +Chris Holland <41524756+ChrisAHolland@users.noreply.github.com> +Chris Kerr +Chris Vavaliaris +Christian Clauss +Christopher Dahlin +Christopher Hanley +Christoph Gohlke +Christoph Gohlke Christoph Gohlke cgholke -Christoph Gohlke cgohlke -Christoph Gohlke Christolph Gohlke -Chunlin Fang Qiyu8 -Chunlin Fang qiyu8 -Chunlin Fang Chunlin -Colin Snyder <47012605+colinsnyder@users.noreply.github.com> colinsnyder <47012605+colinsnyder@users.noreply.github.com> -Daniel B Allan danielballan -Daniel da Silva Daniel da Silva -Daniel da Silva Daniel da Silva -Daniel Hrisca danielhrisca -Daniel J Farrell danieljfarrell +Chunlin Fang +Chunlin Fang +Chunlin Fang <834352945@qq.com> +Colin Snyder <8csnyder@gmail.com> <47012605+colinsnyder@users.noreply.github.com> +Constanza Fierro +Daniel B Allan +Daniel da Silva +Daniel da Silva +Daniel Hrisca +Daniel J Farrell +Daniel Montes <53720019+Aerysv@users.noreply.github.com> +Daniel Müllner Daniel Müllner Daniel -Daniel Müllner dmuellner -Daniel Rasmussen drasmuss +Daniel Rasmussen +Daniel G. A. Smith +Daniel G. A. Smith +Dario Mory David Huard dhuard -David M Cooke cookedm -David Nicholson davidjn -David Ochoa ochoadavid -Davide Dal Bosco davidedalbosco <62077652+davidedalbosco@users.noreply.github.com> -Dawid Zych silenc3r -Dennis Zollo denniszollo -Derek Homeier Derek Homeier -Derek Homeier Derek Homeir -Derek Homeier Derek Homier -Derrick Williams derrick -Dmitriy Shalyga zuko3d -Dustan Levenstein dustanlevenstein <43019642+dustanlevenstein@users.noreply.github.com> -Ed Schofield edschofield -Egor Zindy zindy -Endolith -Erik M. Bray E. M. Bray -Erik M. Bray Erik Bray +David M Cooke +David Nicholson +David Ochoa +David Pitchford +Davide Dal Bosco <62077652+davidedalbosco@users.noreply.github.com> +Dawid Zych +Dennis Zollo +Derek Homeier +Derek Homeier +Derek Homeier +Derrick Williams +Dmitriy Shalyga +Dustan Levenstein <43019642+dustanlevenstein@users.noreply.github.com> +Dylan Cutler +Ed Schofield +Egor Zindy +Elliott M. Forney +Erik M. Bray +Erik M. Bray +Erik M. Bray Eric Fode Eric Fode -Eric Quintero e-q -Ernest N. Mamikonyan mamikony -Etienne Guesnet EGuesnet <51407514+EGuesnet@users.noreply.github.com> +Eric Quintero +Ernest N. Mamikonyan +Etienne Guesnet <51407514+EGuesnet@users.noreply.github.com> +Eva Jau Evgeni Burovski Evgeni Burovski -Evgeny Toder eltjpm -Fernando Perez Fernando Perez +Evgeny Toder +Fernando Perez +Filip Trojan +François Le Lay +Frank Breitling Friedrich Dunne dunneff Frederic Bastien Frederic -Gael Varoquaux GaelVaroquaux -Gerrit Holl Gerrit Holl -Giuseppe Venturini ggventurini -Golnaz Irannejad golnazir -Gopal Singh Meena gopalmeena -Greg Knoll gkBCCN -Greg Yang eulerreich -Greg Young gfyoung -Greg Young gfyoung +FX Coudert +Gael Varoquaux +Gerrit Holl +Gerrit Holl +Giuseppe Venturini +Golnaz Irannejad +Gopal Singh Meena +Greg Knoll +Greg Yang +Greg Young +Greg Young +Gregory R. Lee +Gregory R. Lee Guo Ci guoci -Han Genuit 87 -Han Genuit hangenuit@gmail.com -Han Genuit Han +Hameer Abbasi +Han Genuit Hanno Klemm hklemm -Hemil Desai hemildesai -Hiroyuki V. Yamazaki hvy -Hugo van Kemenade Hugo -Irvin Probst I--P -Isabela Presedo-Floyd isabela-pf -Gerhard Hobler hobler -Guillaume Peillex hippo91 -Jaime Fernandez Jaime Fernandez -Jaime Fernandez jaimefrio -Jaime Fernandez Jaime -Jakob Jakobson Jakob -Jakob Jacobson jakobjakobson13 <43045863+jakobjakobson13@users.noreply.github.com> -James Webber jamestwebber +Helder Oliveira +Hemil Desai +Hiroyuki V. Yamazaki +Hugo van Kemenade +I-Shen Leong +Inessa Pawson +Irvin Probst +Isabela Presedo-Floyd +Gerhard Hobler +Giannis Zapantis +Guillaume Peillex +Jack J. Woehr +Jaime Fernandez +Jaime Fernandez +Jaime Fernandez +Jamie Macey +Jakob Jakobson +Jakob Jakobson <43045863+jakobjakobson13@users.noreply.github.com> +James Bourbeau +James Webber +Jan Schlüter Jarrod Millman Jarrod Millman -Jason Grout Jason Grout -Jason King jason king -Jay Bourque jayvius -Jean Utke jutke -Jeffrey Yancey Jeff <3820914+jeffyancey@users.noreply.github.com> -Jeremy Lay jeremycl01 +Jason Grout +Jason King +Jay Bourque +Jean Utke +Jeff VanOss +Jeffrey Yancey <3820914+jeffyancey@users.noreply.github.com> +Jeremy Lay Jérémie du Boisberranger jeremiedbb <34657725+jeremiedbb@users.noreply.github.com> -Jerome Kelleher jeromekelleher -Johannes Hampp euronion <42553970+euronion@users.noreply.github.com> -Johannes Schönberger Johannes Schönberger -Johann Faouzi johann.faouzi -John Darbyshire <24256554+attack68@users.noreply.github.com> attack68 <24256554+attack68@users.noreply.github.com> -John Hagen johnthagen -John Kirkham jakirkham -Joseph Fox-Rabinovitz Joseph Fox-Rabinovitz -Joseph Fox-Rabinovitz Joseph Fox-Rabinovitz -Joseph Fox-Rabinovitz Mad Physicist -Joseph Martinot-Lagarde Joseph Martinot-Lagarde -Julian Taylor Julian Taylor -Julian Taylor Julian Taylor +Jérome Eertmans +Jerome Kelleher +Johannes Hampp <42553970+euronion@users.noreply.github.com> +Johannes Schönberger +Johann Faouzi +John Darbyshire <24256554+attack68@users.noreply.github.com> <24256554+attack68@users.noreply.github.com> +John Hagen +John Kirkham +John Kirkham +Joseph Fox-Rabinovitz +Joseph Fox-Rabinovitz +Joseph Fox-Rabinovitz +Joseph Martinot-Lagarde +Julian Taylor +Julian Taylor +Julian Taylor Julien Lhermitte Julien Lhermitte -Julien Schueller jschueller -Justus Magin keewis -Justus Magin Keewis -Kai Striega kai -Kai Striega kai-striega -Kai Striega kai-striega -Karan Dhir karan-dhir -Khaled Ben Abdallah Okuda KhaledTo +Julien Schueller +Justus Magin +Justus Magin +Kai Striega +Kai Striega +Kasia Leszek +Kasia Leszek <39829548+katleszek@users.noreply.github.com> +Karan Dhir +Keller Meier +Kevin Sheppard +Kevin Sheppard +Kerem Hallaç +Khaled Ben Abdallah Okuda Kiko Correoso kikocorreoso Kiko Correoso kikocorreoso -Konrad Kapp k_kapp@yahoo.com -Kriti Singh kritisingh1 -Kmol Yuan Yuan +Konrad Kapp +Kriti Singh +Kmol Yuan +Kumud Lakara <55556183+kumudlakara@users.noreply.github.com> Lars Buitinck Lars Buitinck Lars Buitinck Lars Buitinck -Lars Grüter Lars G -Luis Pedro Coelho Luis Pedro Coelho -Luke Zoltan Kelley lzkelley -Madhulika Jain Chambers madhulikajc <53166646+madhulikajc@users.noreply.github.com> -Magdalena Proszewska mpro -Magdalena Proszewska mproszewska <38814059+mproszewska@users.noreply.github.com> -Manoj Kumar MechCoder -Marcin Podhajski m-podhajski <36967358+m-podhajski@users.noreply.github.com> -Mark DePristo markdepristo -Mark Weissman m-d-w -Mark Wiebe Mark -Mark Wiebe Mark Wiebe -Mark Wiebe Mark Wiebe -Mark Wiebe Mark Wiebe -Martin Goodson martingoodson -Martin Reinecke mreineck -Martin Teichmann Martin Teichmann -Matt Hancock matt -Martino Sorbaro martinosorb -Mattheus Ueckermann empeeu -Matthew Harrigan MattHarrigan -Matti Picus mattip -Maximilian Konrad MLK97 -Melissa Weber Mendonça Melissa Weber Mendonca -Melissa Weber Mendonça melissawm +Lars Grüter +Lars Grüter +Leonardus Chen +Licht Takeuchi +Luis Pedro Coelho +Luke Zoltan Kelley +Madhulika Jain Chambers <53166646+madhulikajc@users.noreply.github.com> +Magdalena Proszewska +Magdalena Proszewska <38814059+mproszewska@users.noreply.github.com> +Manoj Kumar +Marcin Podhajski <36967358+m-podhajski@users.noreply.github.com> +Mark DePristo +Mark Weissman +Mark Wiebe +Mark Wiebe +Mark Wiebe +Mark Wiebe +Martin Goodson +Martin Reinecke +Martin Teichmann +Mary Conley +Matheus Vieira Portela +Mathieu Lamarre +Matías Ríos +Matt Ord +Matt Ord <55235095+Matt-Ord@users.noreply.github.com> +Matt Hancock +Martino Sorbaro +Mattheus Ueckermann +Matthew Harrigan +Matthias Bussonnier +Matti Picus +Maximilian Konrad +Melissa Weber Mendonça +Meltem Eren Copur Michael Behrisch behrisch Michael Droettboom mdroe -Michael K. Tran mtran -Michael Martin mmartin -Michael Schnaitter schnaitterm -Muhammad Kasim mfkasim91 -Masashi Kishimoto kishimoto-banana -Nathaniel J. Smith njsmith +Michael Dubravski +Michael Dubravski <41096057+mdubravski@users.noreply.github.com> +Michael Felt +Michael Hirsch +Michael K. Tran +Michael Martin +Michael Schnaitter +Michael Seifert +Michel Fruchart +Mike Toews +Mircea Akos Bruma +Mircea Akos Bruma +Mitchell Faas <35742861+Mitchell-Faas@users.noreply.github.com> +Muhammad Kasim +Masashi Kishimoto +Mukulikaa Parhari <60316606+Mukulikaa@users.noreply.github.com> +Nathaniel J. Smith Naveen Arunachalam naveenarun +Neil Girdhar +Nick Papior +Nicola Soranzo Nicolas Scheffer Nicolas Scheffer Nicholas A. Del Grosso nickdg +Nicholas McKibben Nick Minkyu Lee fivemok <9394929+fivemok@users.noreply.github.com> -Ondřej Čertík Ondrej Certik -Óscar Villellas Guillén ovillellas +Oliver Eberle +Ondřej Čertík +Óscar Villellas Guillén +Panos Mavrogiorgos Pat Miller patmiller -Paul Ivanov Paul Ivanov +Paul Ivanov +Paul Ivanov Paul YS Lee Paul -Paul Jacobson hpaulj -Pearu Peterson Pearu Peterson -Pete Peeradej Tanruangporn petetanru -Peter Bell peterbell10 -Peter J Cock peterjc +Paul Jacobson +Pearu Peterson +Pete Peeradej Tanruangporn +Peter Bell +Peter J Cock Phil Elson -Pierre GM pierregm +Pierre GM Pierre GM pierregm -Piotr Gaiński panpiort8 +Piotr Gaiński Piotr Gaiński Pan Jan Prabhu Ramachandran prabhu -Przemyslaw Bartosik przemb +Przemyslaw Bartosik +Raghuveer Devulapalli +Raghuveer Devulapalli <44766858+r-devulap@users.noreply.github.com> Rajas Rade lkdmttg7 -Ralf Gommers Ralf Gommers -Ralf Gommers rgommers -Rehas Sachdeva rehassachdeva -Ritta Narita RittaNarita -Riya Sharma ayir -Robert Kern Robert Kern -Robert LU RobberPhex +Rakesh Vasudevan +Ralf Gommers +Rehas Sachdeva +Ritta Narita +Riya Sharma +Robert Kern +Robert LU +Robert T. McGibbon +Roland Kaufmann +Roman Yurchak Ronan Lamy Ronan Lamy -Russell Hewett rhewett -Ryan Blakemore ryanblak -Sam Preston jspreston -Sam Radhakrishnan = <=> -Sam Radhakrishnan sam09 -Sanchez Gonzalez Alvaro alvarosg -Saullo Giovani saullogiovani +Russell Hewett +Ryan Blakemore +Ryan Polley +Ryan Soklaski +Ryan Soklaski +Sabrina Simao +Sabrina Simao SabrinaSimao +Sam Preston +Sam Radhakrishnan = <=> # committed without an email address +Samesh Lakhotia +Samesh Lakhotia <43701530+sameshl@users.noreply.github.com> +Sami Salonen +Sanchez Gonzalez Alvaro +Saullo Giovani Saurabh Mehta -Sebastian Berg seberg -Sergei Vorfolomeev vorfol <39548292+vorfol@users.noreply.github.com> -Shekhar Prasad Rajak shekharrajak -Shota Kawabuchi skwbc -Siavash Eliasi siavashserver -Simon Gasse sgasse -Søren Rasmussen sorenrasmussenai <47032123+sorenrasmussenai@users.noreply.github.com> -Stefan Behnel scoder -Stefan van der Walt Stefan van der Walt -Stefan van der Walt Stefan van der Walt -Stephan Hoyer Stephan Hoyer +Sebastian Berg +Sergei Vorfolomeev <39548292+vorfol@users.noreply.github.com> +Shekhar Prasad Rajak +Shen Zhou +Shota Kawabuchi +Siavash Eliasi +Simon Conseil +Simon Gasse +Simon Gasse +Søren Rasmussen <47032123+sorenrasmussenai@users.noreply.github.com> +Spencer Hill +Stefan Behnel +Stefan van der Walt +Stefan van der Walt +Stephan Hoyer +Stephan Hoyer +Steve Stagg Steven J Kern -Stuart Archibald stuartarchibald -SuryaChand P Surya P -SuryaChand P psschand -Takanori Hirano takanori-pskq -Takanori H takanori-pskq -Thomas A Caswell Thomas A Caswell -Tim Cera tim cera -Tim Teichmann tteichmann -Tim Teichmann tteichmann <44259103+tteichmann@users.noreply.github.com> -Tirth Patel tirthasheshpatel -Tom Boyd pezcore -Tom Poole tpoole -Tony LaTorre tlatorre -Travis Oliphant Travis E. Oliphant -Travis Oliphant Travis Oliphant -Valentin Haenel Valentin Haenel -Rakesh Vasudevan vrakesh -Vrinda Narayan vrindaaa <48102157+vrindaaa@users.noreply.github.com> -Wansoo Kim marload -Warren Weckesser Warren Weckesser -Weitang Li wtli@Dirac -Weitang Li wtli -Wendell Smith Wendell Smith -Wim Glenn wim glenn -Wojtek Ruszczewski wrwrwr -Yogesh Raisinghani raisinghanii <46864533+raisinghanii@users.noreply.github.com> -Yuji Kanagawa kngwyu -Yury Kirienko kirienko -Zac Hatfield-Dodds Zac-HD -Zixu Zhao ZZhaoTireless -Ziyan Zhou Ziyan -Zieji Pohz jpoh -Zieji Pohz zjpoh -Zieji Pohz Zijie (ZJ) Poh <8103276+zjpoh@users.noreply.github.com> -Zolisa Bleki zoj613 <44142765+zoj613@users.noreply.github.com> -Zolisa Bleki RedRuM <44142765+zoj613@users.noreply.github.com> -luzpaz luz.paz -luzpaz luzpaz -spacescientist spacescientist +Stuart Archibald +Stuart Archibald +SuryaChand P +Takanori Hirano +Thomas A Caswell +Thomas Kluyver +Thomas Orgis +Tim Cera +Tim Teichmann +Tim Teichmann <44259103+tteichmann@users.noreply.github.com> +Tirth Patel +Tobias Pitters +Tobias Pitters <31857876+CloseChoice@users.noreply.github.com> +Tobias Uelwer +Tom Boyd +Tom Poole +Tong Zou +Tony LaTorre +Toshiki Kataoka +Travis Oliphant +Travis Oliphant +Travis Oliphant +Valentin Haenel +Valentin Haenel +Varun Nayyar +Vrinda Narayan +Vrinda Narayan <48102157+vrindaaa@users.noreply.github.com> +Wansoo Kim +Warren Weckesser +Weitang Li +Wendell Smith +William Spotz +Wim Glenn +Wojtek Ruszczewski +Wojciech Rzadkowski <33913808+wrzadkow@users.noreply.github.com> +Yang Hau +Yang Hau +Yogesh Raisinghani <46864533+raisinghanii@users.noreply.github.com> +Yu Feng +Yuji Kanagawa +Yury Kirienko +Zac Hatfield-Dodds +Zé Vinícius +Zixu Zhao +Ziyan Zhou +Zieji Pohz +Zieji Pohz <8103276+zjpoh@users.noreply.github.com> +Zolboo Erdenebaatar +Zolisa Bleki <44142765+zoj613@users.noreply.github.com> diff --git a/.travis.yml b/.travis.yml index 6b7585a56be7..1486bbb885fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,10 @@ addons: # Speedup builds, particularly when USE_CHROOT=1 - eatmydata +# Disable clone depth +git: + depth: false + cache: directories: - $HOME/.cache/pip diff --git a/INSTALL.rst.txt b/INSTALL.rst.txt index 5ee97d7901a0..1bc97c4b5f86 100644 --- a/INSTALL.rst.txt +++ b/INSTALL.rst.txt @@ -14,7 +14,7 @@ Prerequisites Building NumPy requires the following installed software: -1) Python__ 3.6.x or newer. +1) Python__ 3.7.x or newer. Please note that the Python development headers also need to be installed, e.g., on Debian/Ubuntu one needs to install both `python3` and diff --git a/LICENSE.txt b/LICENSE.txt index 8ce64521862e..4723d4ea009e 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2005-2020, NumPy Developers. +Copyright (c) 2005-2021, NumPy Developers. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/LICENSES_bundled.txt b/LICENSES_bundled.txt index 00b7473777ca..26c7a7829361 100644 --- a/LICENSES_bundled.txt +++ b/LICENSES_bundled.txt @@ -15,3 +15,8 @@ Name: dragon4 Files: numpy/core/src/multiarray/dragon4.c License: MIT For license text, see numpy/core/src/multiarray/dragon4.c + +Name: libdivide +Files: numpy/core/include/numpy/libdivide/* +License: Zlib + For license text, see numpy/core/include/numpy/libdivide/LICENSE.txt diff --git a/MANIFEST.in b/MANIFEST.in index 35eb05a61619..8ec62123b998 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,16 +4,16 @@ # data, etc files to distribution (*for installation*). # Avoid using MANIFEST.in for that. # -include MANIFEST.in -include pyproject.toml -include pytest.ini -include *.txt -include README.md -include site.cfg.example -include runtests.py -include tox.ini -include .coveragerc -include test_requirements.txt +# Files in top-level directory: +include *.* +# Exclude license file that we append to the main license when running +# `python setup.py sdist`. And exclude generated files in repo root. +exclude LICENSES_bundled.txt +exclude .* +exclude azure-*.yml + +# Sub-directories. Included are: numpy/, doc/, benchmarks/, tools/ +include numpy/_version.py recursive-include numpy/random *.pyx *.pxd *.pyx.in *.pxd.in include numpy/py.typed include numpy/random/include/* @@ -45,6 +45,3 @@ prune benchmarks/numpy # Exclude generated files prune */__pycache__ global-exclude *.pyc *.pyo *.pyd *.swp *.bak *~ -# Exclude license file that we append to the main license when running -# `python setup.py sdist` -exclude LICENSES_bundled.txt diff --git a/README.md b/README.md index 9271a5d28872..88c1151a0f89 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,4 @@ -# NumPy - -[![Travis CI](https://img.shields.io/travis/com/numpy/numpy/master?label=Travis%20CI)]( - https://travis-ci.com/github/numpy/numpy) -[![Azure](https://dev.azure.com/numpy/numpy/_apis/build/status/azure-pipeline%20numpy.numpy)]( - https://dev.azure.com/numpy/numpy/_build/latest?definitionId=5) -[![codecov](https://codecov.io/gh/numpy/numpy/branch/master/graph/badge.svg)]( - https://codecov.io/gh/numpy/numpy) +# NumPy NumPy is the fundamental package needed for scientific computing with Python. @@ -26,10 +19,7 @@ It provides: Testing: -- NumPy versions ≥ 1.15 require `pytest` -- NumPy versions < 1.15 require `nose` - -Tests can then be run after installation with: +NumPy requires `pytest`. Tests can then be run after installation with: python -c 'import numpy; numpy.test()' @@ -37,13 +27,39 @@ Tests can then be run after installation with: Call for Contributions ---------------------- -NumPy appreciates help from a wide range of different backgrounds. -Work such as high level documentation or website improvements are valuable -and we would like to grow our team with people filling these roles. -Small improvements or fixes are always appreciated and issues labeled as easy -may be a good starting point. -If you are considering larger contributions outside the traditional coding work, -please contact us through the mailing list. +The NumPy project welcomes your expertise and enthusiasm! + +Small improvements or fixes are always appreciated; issues labeled as "good +first issue" may be a good starting point. If you are considering larger +contributions to the source code, please contact us through the [mailing +list](https://mail.python.org/mailman/listinfo/numpy-discussion) first. + +Writing code isn’t the only way to contribute to NumPy. You can also: +- review pull requests +- triage issues +- develop tutorials, presentations, and other educational materials +- maintain and improve [our website](https://github.com/numpy/numpy.org) +- develop graphic design for our brand assets and promotional materials +- translate website content +- help with outreach and onboard new contributors +- write grant proposals and help with other fundraising efforts + +If you’re unsure where to start or how your skills fit in, reach out! You can +ask on the mailing list or here, on GitHub, by opening a new issue or leaving a +comment on a relevant issue that is already open. + +Our preferred channels of communication are all public, but if you’d like to +speak to us in private first, contact our community coordinators at +numpy-team@googlegroups.com or on Slack (write numpy-team@googlegroups.com for +an invitation). + +We also have a biweekly community call, details of which are announced on the +mailing list. You are very welcome to join. + +If you are new to contributing to open source, [this +guide](https://opensource.guide/how-to-contribute/) helps explain why, what, +and how to successfully get involved. + [![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f8773dc36abc..14a59e8800af 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,7 +3,7 @@ trigger: batch: False branches: include: - - master + - main - maintenance/* @@ -18,6 +18,54 @@ stages: - stage: InitialTests jobs: + - job: Lint + condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) + pool: + vmImage: 'ubuntu-18.04' + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.8' + addToPath: true + architecture: 'x64' + - script: >- + python -m pip install -r linter_requirements.txt + displayName: 'Install tools' + # pip 21.1 emits a pile of garbage messages to annoy users :) + # failOnStderr: true + - script: | + python tools/linter.py --branch origin/$(System.PullRequest.TargetBranch) + displayName: 'Run Lint Checks' + failOnStderr: true + # Native build is based on gcc flag `-march=native` + - job: Linux_baseline_native + pool: + vmImage: 'ubuntu-20.04' + steps: + - script: | + if ! `gcc 2>/dev/null`; then + sudo apt install gcc + fi + sudo apt install python3 + sudo apt install python3-dev + # python3 has no setuptools, so install one to get us going + python3 -m pip install --user --upgrade pip 'setuptools<49.2.0' + python3 -m pip install --user -r test_requirements.txt + displayName: 'install python/requirements' + - script: | + python3 runtests.py --show-build-log --cpu-baseline=native --cpu-dispatch=none \ + --debug-info --mode=full -- -rsx --junitxml=junit/test-results.xml + displayName: 'Run native baseline Build / Tests' + - task: PublishTestResults@2 + condition: succeededOrFailed() + inputs: + testResultsFiles: '**/test-*.xml' + failTaskOnFailedTests: true + testRunTitle: 'Publish test results for baseline/native' + +- stage: ComprehensiveTests + jobs: + - job: WindowsFast pool: @@ -32,19 +80,13 @@ stages: steps: - template: azure-steps-windows.yml - -- stage: ComprehensiveTests - jobs: - - - job: Linux_Python_38_32bit_full_with_asserts pool: - vmImage: 'ubuntu-18.04' + vmImage: 'ubuntu-20.04' steps: - script: | - docker pull quay.io/pypa/manylinux2010_i686 docker run -v $(pwd):/numpy -e CFLAGS="-msse2 -std=c99 -UNDEBUG" \ - -e F77=gfortran-5 -e F90=gfortran-5 quay.io/pypa/manylinux2010_i686 \ + -e F77=gfortran-5 -e F90=gfortran-5 quay.io/pypa/manylinux2010_i686:2021-02-28-1f32361 \ /bin/bash -xc "cd numpy && \ /opt/python/cp38-cp38/bin/python -mvenv venv &&\ source venv/bin/activate && \ @@ -155,7 +197,6 @@ stages: - script: python setup.py build -j 4 build_ext --inplace install displayName: 'Build NumPy without OpenBLAS and new casting' env: - NPY_USE_NEW_CASTINGIMPL: 1 BLAS: None LAPACK: None ATLAS: None @@ -166,7 +207,7 @@ stages: - script: python -m pip install matplotlib displayName: 'Install matplotlib before refguide run' - script: python runtests.py -g --refguide-check - displayName: 'Run Refuide Check' + displayName: 'Run Refguide Check' condition: eq(variables['USE_OPENBLAS'], '1') - script: python runtests.py -n --mode=full -- -rsx --junitxml=junit/test-results.xml displayName: 'Run Full NumPy Test Suite' @@ -206,6 +247,11 @@ stages: PYTHON_ARCH: 'x64' TEST_MODE: full BITS: 64 + #PyPy37-64bit-full: + # PYTHON_VERSION: 'PyPy3.7' + # PYTHON_ARCH: 'x64' + # TEST_MODE: fast + # BITS: 64 Python38-32bit-fast: PYTHON_VERSION: '3.8' PYTHON_ARCH: 'x86' @@ -238,6 +284,7 @@ stages: vmImage: 'ubuntu-18.04' steps: - script: | + sudo apt update sudo apt install python3.7 sudo apt install python3.7-dev if ! `gcc-4.8 2>/dev/null`; then @@ -258,3 +305,4 @@ stages: failTaskOnFailedTests: true testRunTitle: 'Publish test results for gcc 4.8' + diff --git a/azure-steps-windows.yml b/azure-steps-windows.yml index 28762f5d9528..6a69db7539b3 100644 --- a/azure-steps-windows.yml +++ b/azure-steps-windows.yml @@ -6,7 +6,7 @@ steps: architecture: $(PYTHON_ARCH) condition: not(contains(variables['PYTHON_VERSION'], 'PyPy')) - powershell: | - $url = "http://buildbot.pypy.org/nightly/py3.6/pypy-c-jit-latest-win32.zip" + $url = "http://buildbot.pypy.org/nightly/py3.7/pypy-c-jit-latest-win64.zip" $output = "pypy.zip" $wc = New-Object System.Net.WebClient $wc.DownloadFile($url, $output) diff --git a/benchmarks/README.rst b/benchmarks/README.rst index f56c253399ad..2700e95e7ab2 100644 --- a/benchmarks/README.rst +++ b/benchmarks/README.rst @@ -50,7 +50,7 @@ Compare change in benchmark results to another version/commit/branch:: python runtests.py --bench-compare v1.6.2 bench_core python runtests.py --bench-compare 8bf4e9b bench_core - python runtests.py --bench-compare master bench_core + python runtests.py --bench-compare main bench_core All of the commands above display the results in plain text in the console, and the results are not saved for comparison with diff --git a/benchmarks/asv_compare.conf.json.tpl b/benchmarks/asv_compare.conf.json.tpl index 1f339077c66d..03d13d985c8d 100644 --- a/benchmarks/asv_compare.conf.json.tpl +++ b/benchmarks/asv_compare.conf.json.tpl @@ -78,7 +78,9 @@ "build_command" : [ "python setup.py build {numpy_build_options}", - "PIP_NO_BUILD_ISOLATION=false python -mpip wheel --no-deps --no-index -w {build_cache_dir} {build_dir}" + // pip ignores '--global-option' when pep517 is enabled, we also enabling pip verbose to + // be reached from asv `--verbose` so we can verify the build options. + "PIP_NO_BUILD_ISOLATION=false python {build_dir}/benchmarks/asv_pip_nopep517.py -v {numpy_global_options} --no-deps --no-index -w {build_cache_dir} {build_dir}" ], // The commits after which the regression search in `asv publish` // should start looking for regressions. Dictionary whose keys are diff --git a/benchmarks/asv_pip_nopep517.py b/benchmarks/asv_pip_nopep517.py new file mode 100644 index 000000000000..9ba165493085 --- /dev/null +++ b/benchmarks/asv_pip_nopep517.py @@ -0,0 +1,15 @@ +""" +This file is used by asv_compare.conf.json.tpl. +""" +import subprocess, sys +# pip ignores '--global-option' when pep517 is enabled therefore we disable it. +cmd = [sys.executable, '-mpip', 'wheel', '--no-use-pep517'] +try: + output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, universal_newlines=True) +except Exception as e: + output = str(e.output) +if "no such option" in output: + print("old version of pip, escape '--no-use-pep517'") + cmd.pop() + +subprocess.run(cmd + sys.argv[1:]) diff --git a/benchmarks/benchmarks/__init__.py b/benchmarks/benchmarks/__init__.py index e4193cf0582f..7b9f1d3e688d 100644 --- a/benchmarks/benchmarks/__init__.py +++ b/benchmarks/benchmarks/__init__.py @@ -1 +1,53 @@ from . import common +import sys +import os + +def show_cpu_features(): + from numpy.lib.utils import _opt_info + info = _opt_info() + info = "NumPy CPU features: " + (info if info else 'nothing enabled') + # ASV wrapping stdout & stderr, so we assume having a tty here + if 'SHELL' in os.environ and sys.platform != 'win32': + # to avoid the red color that imposed by ASV + print(f"\033[33m{info}\033[0m") + else: + print(info) + +def dirty_lock(lock_name, lock_on_count=1): + # this lock occurred before each round to avoid duplicate printing + if not hasattr(os, "getppid"): + return False + ppid = os.getppid() + if not ppid or ppid == os.getpid(): + # not sure if this gonna happen, but ASV run each round in + # a separate process so the lock should be based on the parent + # process id only + return False + lock_path = os.path.abspath(os.path.join( + os.path.dirname(__file__), "..", "env", lock_name) + ) + # ASV load the 'benchmark_dir' to discovering the available benchmarks + # the issue here is ASV doesn't capture any strings from stdout or stderr + # during this stage so we escape it and lock on the second increment + try: + with open(lock_path, 'a+') as f: + f.seek(0) + count, _ppid = (f.read().split() + [0, 0])[:2] + count, _ppid = int(count), int(_ppid) + if _ppid == ppid: + if count >= lock_on_count: + return True + count += 1 + else: + count = 0 + f.seek(0) + f.truncate() + f.write(f"{str(count)} {str(ppid)}") + except IOError: + pass + return False + + +# FIXME: there's no official way to provide extra information to the test log +if not dirty_lock("print_cpu_features.lock"): + show_cpu_features() diff --git a/benchmarks/benchmarks/bench_app.py b/benchmarks/benchmarks/bench_app.py index bee95c201172..d22aa2e09604 100644 --- a/benchmarks/benchmarks/bench_app.py +++ b/benchmarks/benchmarks/bench_app.py @@ -70,8 +70,8 @@ def maxes_of_dots(self, arrays): Arrays must agree only on the first dimension. - For numpy it a join benchmark of dot products and max() - on a set of arrays. + Numpy uses this as a simultaneous benchmark of 1) dot products + and 2) max(, axis=). """ feature_scores = ([0] * len(arrays)) for (i, sd) in enumerate(arrays): diff --git a/benchmarks/benchmarks/bench_core.py b/benchmarks/benchmarks/bench_core.py index 0c2a18c15333..30647f4b850f 100644 --- a/benchmarks/benchmarks/bench_core.py +++ b/benchmarks/benchmarks/bench_core.py @@ -93,6 +93,12 @@ def time_triu_l10x10(self): def time_tril_l10x10(self): np.tril(self.l10x10) + def time_triu_indices_500(self): + np.triu_indices(500) + + def time_tril_indices_500(self): + np.tril_indices(500) + class Temporaries(Benchmark): def setup(self): @@ -136,7 +142,7 @@ class CountNonzero(Benchmark): params = [ [1, 2, 3], [100, 10000, 1000000], - [bool, int, str, object] + [bool, np.int8, np.int16, np.int32, np.int64, str, object] ] def setup(self, numaxes, size, dtype): @@ -165,6 +171,9 @@ def setup(self, dtype): def time_packbits(self, dtype): np.packbits(self.d) + def time_packbits_little(self, dtype): + np.packbits(self.d, bitorder="little") + def time_packbits_axis0(self, dtype): np.packbits(self.d2, axis=0) diff --git a/benchmarks/benchmarks/bench_function_base.py b/benchmarks/benchmarks/bench_function_base.py index b1e59274986c..062843d10cc0 100644 --- a/benchmarks/benchmarks/bench_function_base.py +++ b/benchmarks/benchmarks/bench_function_base.py @@ -47,6 +47,8 @@ class Median(Benchmark): def setup(self): self.e = np.arange(10000, dtype=np.float32) self.o = np.arange(10001, dtype=np.float32) + self.tall = np.random.random((10000, 20)) + self.wide = np.random.random((20, 10000)) def time_even(self): np.median(self.e) @@ -66,6 +68,12 @@ def time_even_small(self): def time_odd_small(self): np.median(self.o[:500], overwrite_input=True) + def time_tall(self): + np.median(self.tall, axis=-1) + + def time_wide(self): + np.median(self.wide, axis=0) + class Percentile(Benchmark): def setup(self): diff --git a/benchmarks/benchmarks/bench_lib.py b/benchmarks/benchmarks/bench_lib.py index c22ceaa5e42f..f7884cd6c309 100644 --- a/benchmarks/benchmarks/bench_lib.py +++ b/benchmarks/benchmarks/bench_lib.py @@ -53,6 +53,7 @@ def setup(self, shape, pad_width, mode): def time_pad(self, shape, pad_width, mode): np.pad(self.array, pad_width, mode) + class Nan(Benchmark): """Benchmarks for nan functions""" @@ -113,3 +114,26 @@ def time_nanquantile(self, array_size, percent_nans): def time_nanpercentile(self, array_size, percent_nans): np.nanpercentile(self.arr, q=50) + + +class Unique(Benchmark): + """Benchmark for np.unique with np.nan values.""" + + param_names = ["array_size", "percent_nans"] + params = [ + # sizes of the 1D arrays + [200, int(2e5)], + # percent of np.nan in arrays + [0, 0.1, 2., 50., 90.], + ] + + def setup(self, array_size, percent_nans): + np.random.seed(123) + # produce a randomly shuffled array with the + # approximate desired percentage np.nan content + base_array = np.random.uniform(size=array_size) + base_array[base_array < percent_nans / 100.] = np.nan + self.arr = base_array + + def time_unique(self, array_size, percent_nans): + np.unique(self.arr) diff --git a/benchmarks/benchmarks/bench_linalg.py b/benchmarks/benchmarks/bench_linalg.py index a72cccb5f7ed..5ed5b6eecd6d 100644 --- a/benchmarks/benchmarks/bench_linalg.py +++ b/benchmarks/benchmarks/bench_linalg.py @@ -91,8 +91,8 @@ def setup(self, op, typename): # check that dtype is supported at all try: self.func(self.a[:2, :2]) - except TypeError: - raise NotImplementedError() + except TypeError as e: + raise NotImplementedError() from e def time_op(self, op, typename): self.func(self.a) diff --git a/benchmarks/benchmarks/bench_ufunc.py b/benchmarks/benchmarks/bench_ufunc.py index 9f45a72575ff..b036581e1aae 100644 --- a/benchmarks/benchmarks/bench_ufunc.py +++ b/benchmarks/benchmarks/bench_ufunc.py @@ -134,6 +134,23 @@ def time_less_than_scalar2(self, dtype): (self.d < 1) +class CustomScalarFloorDivideInt(Benchmark): + params = (np.sctypes['int'] + np.sctypes['uint'], [8, -8, 43, -43]) + param_names = ['dtype', 'divisors'] + + def setup(self, dtype, divisor): + if dtype in np.sctypes['uint'] and divisor < 0: + raise NotImplementedError( + "Skipping test for negative divisor with unsigned type") + + iinfo = np.iinfo(dtype) + self.x = np.random.randint( + iinfo.min, iinfo.max, size=10000, dtype=dtype) + + def time_floor_divide_int(self, dtype, divisor): + self.x // divisor + + class Scalar(Benchmark): def setup(self): self.x = np.asarray(1.0) diff --git a/benchmarks/benchmarks/bench_avx.py b/benchmarks/benchmarks/bench_ufunc_strides.py similarity index 87% rename from benchmarks/benchmarks/bench_avx.py rename to benchmarks/benchmarks/bench_ufunc_strides.py index 82866c17077f..213ff0020293 100644 --- a/benchmarks/benchmarks/bench_avx.py +++ b/benchmarks/benchmarks/bench_ufunc_strides.py @@ -2,7 +2,7 @@ import numpy as np -avx_ufuncs = ['sin', +unary_ufuncs = ['sin', 'cos', 'exp', 'log', @@ -20,24 +20,26 @@ 'isinf', 'signbit'] stride = [1, 2, 4] +stride_out = [1, 2, 4] dtype = ['f', 'd'] -class AVX_UFunc(Benchmark): - params = [avx_ufuncs, stride, dtype] - param_names = ['avx_based_ufunc', 'stride', 'dtype'] +class Unary(Benchmark): + params = [unary_ufuncs, stride, stride_out, dtype] + param_names = ['ufunc', 'stride_in', 'stride_out', 'dtype'] timeout = 10 - def setup(self, ufuncname, stride, dtype): + def setup(self, ufuncname, stride, stride_out, dtype): np.seterr(all='ignore') try: self.f = getattr(np, ufuncname) except AttributeError: - raise NotImplementedError() + raise NotImplementedError(f"No ufunc {ufuncname} found") from None N = 10000 self.arr = np.ones(stride*N, dtype) + self.arr_out = np.empty(stride_out*N, dtype) - def time_ufunc(self, ufuncname, stride, dtype): - self.f(self.arr[::stride]) + def time_ufunc(self, ufuncname, stride, stride_out, dtype): + self.f(self.arr[::stride], self.arr_out[::stride_out]) class AVX_UFunc_log(Benchmark): params = [stride, dtype] @@ -66,7 +68,7 @@ def setup(self, ufuncname, dtype, stride): try: self.f = getattr(np, ufuncname) except AttributeError: - raise NotImplementedError() + raise NotImplementedError(f"No ufunc {ufuncname} found") from None N = 10000 self.arr1 = np.array(np.random.rand(stride*N), dtype=dtype) self.arr2 = np.array(np.random.rand(stride*N), dtype=dtype) @@ -107,7 +109,7 @@ def setup(self, bfuncname, stride, dtype): try: self.f = getattr(np, bfuncname) except AttributeError: - raise NotImplementedError() + raise NotImplementedError(f"No bfunc {bfuncname} found") from None N = 10000 self.arr1 = np.ones(stride*N, dtype) self.arr2 = np.ones(stride*N, dtype) @@ -130,7 +132,7 @@ def setup(self, bfuncname, stride, dtype): try: self.f = getattr(np, bfuncname) except AttributeError: - raise NotImplementedError() + raise NotImplementedError(f"No bfunc {bfuncname} found") from None N = 10000 self.arr1 = np.ones(stride*N, dtype) diff --git a/benchmarks/benchmarks/common.py b/benchmarks/benchmarks/common.py index b65cc5fd212a..0c40e85b0612 100644 --- a/benchmarks/benchmarks/common.py +++ b/benchmarks/benchmarks/common.py @@ -14,14 +14,14 @@ # time-consuming functions (ufunc, linalg, etc) nxs, nys = 100, 100 -# a set of interesting types to test +# a list of interesting types to test TYPES1 = [ 'int16', 'float16', 'int32', 'float32', 'int64', 'float64', 'complex64', 'longfloat', 'complex128', ] -if 'complex256' in numpy.typeDict: +if 'complex256' in numpy.sctypeDict: TYPES1.append('complex256') diff --git a/branding/logo/logoguidelines.md b/branding/logo/logoguidelines.md index c674a9b37763..0c37e3dd455e 100644 --- a/branding/logo/logoguidelines.md +++ b/branding/logo/logoguidelines.md @@ -4,7 +4,7 @@ These guidelines are meant to help keep the NumPy logo consistent and recognizab The primary logo is the horizontal option (logomark and text next to each other) and the secondary logo is the stacked version (logomark over text). I’ve also provided the logomark on its own (meaning it doesn’t have text). When in doubt, it’s preferable to use primary or secondary options over the logomark alone. ## Color -The full color options are a combo of Maximum Blue (#4DABCF) and Han Blue (#4D77CF), while light options are white (#FFFFFF) and dark options Warm Black (#013243). +The full color options are a combo of two shades of blue, rgb(77, 171, 207) and rgb(77, 119, 207), while light options are rgb(255, 255, 255) and dark options are rgb(1, 50, 67). Whenever possible, use the full color logos. One color logos (light or dark) are to be used when full color will not have enough contrast, usually when logos must be on colored backgrounds. @@ -15,4 +15,4 @@ Please do not make the primary logo smaller than 50px wide, secondary logo small A few other notes to keep in mind when using the logo: - Make sure to scale the logo proportionally. - Maintain a good amount of space around the logo. Don’t let it overlap with text, images, or other elements. -- Do not try and recreate or modify the logo. For example, do not use the logomark and then try to write NumPy in another font. \ No newline at end of file +- Do not try and recreate or modify the logo. For example, do not use the logomark and then try to write NumPy in another font. diff --git a/branding/logo/logomark/numpylogoicon.svg b/branding/logo/logomark/numpylogoicon.svg index 4fef2a9c8617..50810223b355 100644 --- a/branding/logo/logomark/numpylogoicon.svg +++ b/branding/logo/logomark/numpylogoicon.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/branding/logo/primary/numpylogo.svg b/branding/logo/primary/numpylogo.svg index e5791dc3e666..63d61c50f6a0 100644 --- a/branding/logo/primary/numpylogo.svg +++ b/branding/logo/primary/numpylogo.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/branding/logo/secondary/numpylogo2.svg b/branding/logo/secondary/numpylogo2.svg index 76b076beb74d..20385487c94e 100644 --- a/branding/logo/secondary/numpylogo2.svg +++ b/branding/logo/secondary/numpylogo2.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/doc/DISTUTILS.rst.txt b/doc/DISTUTILS.rst.txt index c58a423c0bfb..539a3b9c121a 100644 --- a/doc/DISTUTILS.rst.txt +++ b/doc/DISTUTILS.rst.txt @@ -472,7 +472,7 @@ by these modules during the build process are ready to be compiled. This form of generic typing is also supported for C header files (preprocessed to produce ``.h`` files). -.. _conv_template.py: https://github.com/numpy/numpy/blob/master/numpy/distutils/conv_template.py +.. _conv_template.py: https://github.com/numpy/numpy/blob/main/numpy/distutils/conv_template.py Useful functions in ``numpy.distutils.misc_util`` ------------------------------------------------- diff --git a/doc/HOWTO_RELEASE.rst.txt b/doc/HOWTO_RELEASE.rst.txt index 5a9c4d5052b4..9af58dd24e96 100644 --- a/doc/HOWTO_RELEASE.rst.txt +++ b/doc/HOWTO_RELEASE.rst.txt @@ -18,7 +18,7 @@ Source tree NumPy Docs ---------- -- https://github.com/numpy/numpy/blob/master/doc/HOWTO_RELEASE.rst.txt +- https://github.com/numpy/numpy/blob/main/doc/HOWTO_RELEASE.rst.txt SciPy.org wiki @@ -35,7 +35,7 @@ Supported platforms and versions ================================ :ref:`NEP 29 ` outlines which Python versions are supported; For the first half of 2020, this will be Python >= 3.6. We test -NumPy against all these versions every time we merge code to master. Binary +NumPy against all these versions every time we merge code to main. Binary installers may be available for a subset of these versions (see below). OS X @@ -185,7 +185,7 @@ A typical release schedule is one beta, two release candidates and a final release. It's best to discuss the timing on the mailing list first, in order for people to get their commits in on time, get doc wiki edits merged, etc. After a date is set, create a new maintenance/x.y.z branch, add new empty -release notes for the next version in the master branch and update the Trac +release notes for the next version in the main branch and update the Trac Milestones. @@ -258,10 +258,8 @@ Check the release notes Use `towncrier`_ to build the release note and commit the changes. This will remove all the fragments from ``doc/release/upcoming_changes`` and add ``doc/release/-note.rst``. -Note that currently towncrier must be installed from its master branch as the -last release (19.2.0) is outdated. - towncrier --version "" + towncrier build --version "" git commit -m"Create release note" Check that the release notes are up-to-date. @@ -275,7 +273,7 @@ following: - for SciPy, supported NumPy version(s) - outlook for the near future -.. _towncrier: https://github.com/hawkowl/towncrier +.. _towncrier: https://pypi.org/project/towncrier/ Update the release status and create a release "tag" @@ -336,8 +334,8 @@ to public keyservers, with a command such as:: gpg --send-keys -Update the version of the master branch ---------------------------------------- +Update the version of the main branch +------------------------------------- Increment the release number in setup.py. Release candidates should have "rc1" (or "rc2", "rcN") appended to the X.Y.Z format. @@ -460,6 +458,15 @@ The scipy.org should be a PR at https://github.com/scipy/scipy.org. The file that needs modification is ``www/index.rst``. Search for ``News``. +Update oldest-supported-numpy +----------------------------- +If this release is the first one to support a new Python version, or the first +to provide wheels for a new platform or PyPy version, the version pinnings +in https://github.com/scipy/oldest-supported-numpy should be updated. +Either submit a PR with changes to ``setup.cfg`` there, or open an issue with +info on needed changes. + + Announce to the lists --------------------- The release should be announced on the mailing lists of @@ -483,5 +490,5 @@ After the final release is announced, a few administrative tasks are left to be done: - Forward port changes in the release branch to release notes and release - scripts, if any, to master branch. + scripts, if any, to main branch. - Update the Milestones in Trac. diff --git a/doc/Makefile b/doc/Makefile index dd63702de1bd..68d496389e84 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -49,7 +49,7 @@ help: @echo " show to show the html output in a browser" clean: - -rm -rf build/* + -rm -rf build/* find . -name generated -type d -prune -exec rm -rf "{}" ";" gitwash-update: @@ -66,7 +66,7 @@ gitwash-update: # Build the current numpy version, and extract docs from it. # We have to be careful of some issues: -# +# # - Everything must be done using the same Python version # - We must use eggs (otherwise they might override PYTHONPATH on import). # - Different versions of easy_install install to different directories (!) @@ -80,8 +80,7 @@ UPLOAD_DIR=/srv/docs_scipy_org/doc/numpy-$(RELEASE) DIST_VARS=SPHINXBUILD="LANG=C PYTHONPATH=$(INSTALL_PPH) python$(PYVER) `which sphinx-build`" PYTHON="PYTHONPATH=$(INSTALL_PPH) python$(PYVER)" NUMPYVER:=$(shell $(PYTHON) -c "import numpy; print(numpy.version.git_revision[:10])" 2>/dev/null) -GITVER ?= $(shell cd ..; $(PYTHON) -c "from setup import git_version; \ - print(git_version()[:10])") +GITVER ?= $(shell cd ..; $(PYTHON) -c "import versioneer as v; print(v.get_versions()['full-revisionid'][:10])") version-check: ifeq "$(GITVER)" "Unknown" @@ -163,7 +162,7 @@ endif @echo " " @echo in build/merge/index.html, @echo then \"git commit\", \"git push\" - + #------------------------------------------------------------------------------ # Basic Sphinx generation rules for different formats diff --git a/doc/RELEASE_WALKTHROUGH.rst.txt b/doc/RELEASE_WALKTHROUGH.rst.txt index 733f681af704..4fbc7af1c6f4 100644 --- a/doc/RELEASE_WALKTHROUGH.rst.txt +++ b/doc/RELEASE_WALKTHROUGH.rst.txt @@ -29,7 +29,7 @@ appended to ``doc/release/1.19.0-notes.rst`` for patch release, though not for new releases like ``1.19.0``, as the changelogs for ``*.0`` releases tend to be excessively long. The ``doc/source/release.rst`` file should also be updated with a link to the new release notes. These changes should be committed to the -maintenance branch, and later will be forward ported to master. The changelog +maintenance branch, and later will be forward ported to main. The changelog should be reviewed for name duplicates or short names and the ``.mailmap`` file updated if needed. @@ -252,6 +252,10 @@ work:: $ firefox doc/build/merge/index.html +Update the stable link:: + + $ ln -sfn 1.19 stable + Once everything seems satisfactory, commit and upload the changes:: $ pushd doc/build/merge @@ -288,7 +292,7 @@ python-announce-list is BCC so that replies will not be sent to that list. Post-Release Tasks ------------------ -Checkout master and forward port the documentation changes:: +Checkout main and forward port the documentation changes:: $ git checkout -b post-1.19.0-release-update $ git checkout maintenance/1.19.x doc/source/release/1.19.0-notes.rst @@ -297,7 +301,7 @@ Checkout master and forward port the documentation changes:: $ gvim doc/source/release.rst # Add link to new notes $ git add doc/changelog/1.19.0-changelog.rst doc/source/release/1.19.0-notes.rst $ git status # check status before commit - $ git commit -a -m"REL: Update master after 1.19.0 release." + $ git commit -a -m"REL: Update main after 1.19.0 release." $ git push origin HEAD Go to github and make a PR. diff --git a/doc/TESTS.rst.txt b/doc/TESTS.rst.txt index d1af7017bc03..ba09aa80028a 100644 --- a/doc/TESTS.rst.txt +++ b/doc/TESTS.rst.txt @@ -59,7 +59,7 @@ that are run; but if it is greater than 1, then the tests will also provide warnings on missing tests. So if you want to run every test and get messages about which modules don't have tests:: - >>> numpy.test(label='full', verbose=2) # or numpy.test('full', 2) + >>> numpy.test(label='full', verbose=2) # or numpy.test('full', 2) Finally, if you are only interested in testing a subset of NumPy, for example, the ``core`` module, use the following:: @@ -101,27 +101,39 @@ module called ``test_yyy.py``. If you only need to test one aspect of ``zzz``, you can simply add a test function:: def test_zzz(): - assert_(zzz() == 'Hello from zzz') + assert zzz() == 'Hello from zzz' More often, we need to group a number of tests together, so we create a test class:: - from numpy.testing import assert_, assert_raises + import pytest # import xxx symbols from numpy.xxx.yyy import zzz + import pytest class TestZzz: def test_simple(self): - assert_(zzz() == 'Hello from zzz') + assert zzz() == 'Hello from zzz' def test_invalid_parameter(self): - assert_raises(...) + with pytest.raises(ValueError, match='.*some matching regex.*'): + ... -Within these test methods, ``assert_()`` and related functions are used to test +Within these test methods, ``assert`` and related functions are used to test whether a certain assumption is valid. If the assertion fails, the test fails. -Note that the Python builtin ``assert`` should not be used, because it is -stripped during compilation with ``-O``. +``pytest`` internally rewrites the ``assert`` statement to give informative +output when it fails, so should be preferred over the legacy variant +``numpy.testing.assert_``. Whereas plain ``assert`` statements are ignored +when running Python in optimized mode with ``-O``, this is not an issue when +running tests with pytest. + +Similarly, the pytest functions :func:`pytest.raises` and :func:`pytest.warns` +should be preferred over their legacy counterparts +:func:`numpy.testing.assert_raises` and :func:`numpy.testing.assert_warns`, +since the pytest variants are more broadly used and allow more explicit +targeting of warnings and errors when used with the ``match`` regex. + Note that ``test_`` functions or methods should not have a docstring, because that makes it hard to identify the test from the output of running the test @@ -145,7 +157,7 @@ can label it with ``pytest.mark.slow``:: @pytest.mark.slow def test_big(self): - print 'Big, slow test' + print('Big, slow test') Similarly for methods:: @@ -162,21 +174,21 @@ name; thus:: def setup(): """Module-level setup""" - print 'doing setup' + print('doing setup') def teardown(): """Module-level teardown""" - print 'doing teardown' + print('doing teardown') class TestMe: def setup(): """Class-level setup""" - print 'doing setup' + print('doing setup') def teardown(): """Class-level teardown""" - print 'doing teardown' + print('doing teardown') Setup and teardown functions to functions and methods are known as "fixtures", @@ -187,7 +199,7 @@ Parametric tests One very nice feature of testing is allowing easy testing across a range of parameters - a nasty problem for standard unit tests. Use the -``dec.paramaterize`` decorator. +``pytest.mark.parametrize`` decorator. Doctests -------- @@ -278,16 +290,16 @@ minor variations, it can be helpful to create a base class containing all the common tests, and then create a subclass for each variation. Several examples of this technique exist in NumPy; below are excerpts from one in `numpy/linalg/tests/test_linalg.py -`__:: +`__:: class LinalgTestCase: def test_single(self): - a = array([[1.,2.], [3.,4.]], dtype=single) + a = array([[1., 2.], [3., 4.]], dtype=single) b = array([2., 1.], dtype=single) self.do(a, b) def test_double(self): - a = array([[1.,2.], [3.,4.]], dtype=double) + a = array([[1., 2.], [3., 4.]], dtype=double) b = array([2., 1.], dtype=double) self.do(a, b) @@ -296,14 +308,14 @@ from one in `numpy/linalg/tests/test_linalg.py class TestSolve(LinalgTestCase): def do(self, a, b): x = linalg.solve(a, b) - assert_almost_equal(b, dot(a, x)) - assert_(imply(isinstance(b, matrix), isinstance(x, matrix))) + assert_allclose(b, dot(a, x)) + assert imply(isinstance(b, matrix), isinstance(x, matrix)) class TestInv(LinalgTestCase): def do(self, a, b): a_inv = linalg.inv(a) - assert_almost_equal(dot(a, a_inv), identity(asarray(a).shape[0])) - assert_(imply(isinstance(a, matrix), isinstance(a_inv, matrix))) + assert_allclose(dot(a, a_inv), identity(asarray(a).shape[0])) + assert imply(isinstance(a, matrix), isinstance(a_inv, matrix)) In this case, we wanted to test solving a linear algebra problem using matrices of several data types, using ``linalg.solve`` and diff --git a/doc/changelog/1.17.0-changelog.rst b/doc/changelog/1.17.0-changelog.rst index 4177c848fd7e..8179c180bad3 100644 --- a/doc/changelog/1.17.0-changelog.rst +++ b/doc/changelog/1.17.0-changelog.rst @@ -159,7 +159,7 @@ names contributed a patch for the first time. Pull requests merged ==================== -A total of 531 pull requests were merged for this release. +A total of 532 pull requests were merged for this release. * `#4808 `__: ENH: Make the `mode` parameter of np.pad default to 'constant' * `#8131 `__: BUG: Fix help() formatting for deprecated functions. @@ -174,6 +174,7 @@ A total of 531 pull requests were merged for this release. * `#10855 `__: ENH: Adding a count parameter to np.unpackbits * `#11230 `__: MAINT: More cleanup of einsum * `#11233 `__: BUG: ensure i0 does not change the shape. +* `#11358 `__: MAINT: Rewrite numpy.pad without concatenate * `#11684 `__: BUG: Raise when unravel_index, ravel_multi_index are given empty... * `#11689 `__: DOC: Add ref docs for C generic types. * `#11721 `__: BUG: Make `arr.ctypes.data` hold onto a reference to the underlying... diff --git a/doc/changelog/1.18.0-changelog.rst b/doc/changelog/1.18.0-changelog.rst index b86b3614ad3a..266ff08077ac 100644 --- a/doc/changelog/1.18.0-changelog.rst +++ b/doc/changelog/1.18.0-changelog.rst @@ -123,20 +123,20 @@ names contributed a patch for the first time. Pull requests merged ==================== -A total of 406 pull requests were merged for this release. +A total of 413 pull requests were merged for this release. * `#9301 `__: DOC: added note to docstring of numpy.savez * `#10151 `__: BUG: Numpy scalar types sometimes have the same name * `#12129 `__: DOC: Improve axes shift description and example in np.tensordot -* `#12205 `__: MAINT: avoid relying on `np.generic.__name__` in `np.dtype.name` +* `#12205 `__: MAINT: avoid relying on ``np.generic.__name__`` in ``np.dtype.name`` * `#12284 `__: ENH: supply our version of numpy.pxd, requires cython>=0.29 * `#12633 `__: BUG: General fixes to f2py reference counts (dereferencing) * `#12658 `__: BUG: NaT now sorts to ends of arrays * `#12828 `__: DOC: Updates to nditer usage instructions -* `#13003 `__: BUG: Do not crash on recursive `.dtype` attribute lookup. +* `#13003 `__: BUG: Do not crash on recursive ``.dtype`` attribute lookup. * `#13368 `__: ENH: Use AVX for float32 implementation of np.sin & np.cos * `#13605 `__: DEP: Deprecate silent ignoring of bad data in fromfile/fromstring -* `#13610 `__: ENH: Always produce a consistent shape in the result of `argwhere` +* `#13610 `__: ENH: Always produce a consistent shape in the result of ``argwhere`` * `#13673 `__: DOC: array(obj, dtype=dt) can downcast * `#13698 `__: DOC: Document ma.filled behavior with non-scalar fill_value * `#13710 `__: DOC: Add note to irfft-like functions about the default sizes @@ -144,6 +144,7 @@ A total of 406 pull requests were merged for this release. * `#13766 `__: MAINT: Update NEP template. * `#13794 `__: ENH: random: Add the multivariate hypergeometric distribution. * `#13799 `__: DOC: Fix unrendered links +* `#13802 `__: BUG: Fixed maximum relative error reporting in assert_allclose * `#13812 `__: MAINT: Rewrite Floyd algorithm * `#13825 `__: DOC: Add missing macros to C-API documentation * `#13829 `__: ENH: Add axis argument to random.permutation and random.shuffle @@ -162,6 +163,7 @@ A total of 406 pull requests were merged for this release. * `#13892 `__: DOC : Refactor Array API documentation -- Array Structure and... * `#13895 `__: DOC: Fix typo in "make_mask" documentation * `#13896 `__: MAINT: Delete unused _aliased_types.py +* `#13899 `__: MAINT: Change the type of error raised in set_printoptions * `#13901 `__: BLD: Remove Trusty dist in Travis CI build * `#13907 `__: BUG: Handle weird bytestrings in dtype() * `#13908 `__: ENH: use towncrier to build the release note @@ -174,7 +176,7 @@ A total of 406 pull requests were merged for this release. * `#13926 `__: DOC: Remove explicit .next method calls with built-in next function... * `#13928 `__: DOC: Don't override MaskedArray.view documentation with the one... * `#13930 `__: BUG: Fix incorrect GIL release in array.nonzero -* `#13935 `__: MAINT: Warn if `_add_newdocs.py` is used to add docstrings to... +* `#13935 `__: MAINT: Warn if ``_add_newdocs.py`` is used to add docstrings to... * `#13943 `__: MAINT: Revert #13876, "MAINT,BUG,DOC: Fix errors in _add_newdocs" * `#13944 `__: MAINT,BUG,DOC: Fix errors in _add_newdocs * `#13945 `__: DOC, MAINT: emphasize random API changes, remove Generator.randint @@ -184,7 +186,7 @@ A total of 406 pull requests were merged for this release. * `#13950 `__: Fixing failure on Python 2.7 on Windows 7 * `#13952 `__: Fix a typo related to the range of indices * `#13959 `__: DOC: add space between words across lines -* `#13964 `__: BUG, DOC: add new recfunctions to `__all__` +* `#13964 `__: BUG, DOC: add new recfunctions to ``__all__`` * `#13967 `__: DOC: Change (old) range() to np.arange() * `#13968 `__: DOC: improve np.sort docstring * `#13970 `__: DOC: spellcheck numpy/doc/broadcasting.py @@ -226,7 +228,7 @@ A total of 406 pull requests were merged for this release. * `#14076 `__: TST: Add 3.8-dev to travisCI testing. * `#14085 `__: DOC: Add blank line above doctest for intersect1d * `#14086 `__: ENH: Propose standard policy for dropping support of old Python... -* `#14089 `__: DOC: Use `pip install .` where possible instead of calling setup.py +* `#14089 `__: DOC: Use ``pip install .`` where possible instead of calling setup.py * `#14091 `__: MAINT: adjustments to test_ufunc_noncontigous * `#14092 `__: MAINT: Improve NEP template * `#14096 `__: DOC: fix documentation of i and j for tri. @@ -236,6 +238,7 @@ A total of 406 pull requests were merged for this release. * `#14106 `__: MAINT: remove duplicate variable assignments * `#14108 `__: BUG: initialize variable that is passed by pointer * `#14110 `__: DOC: fix typo in c-api/array.rst doc +* `#14115 `__: DOC: fix markup of news fragment readme * `#14121 `__: BUG: Add gcd/lcm definitions to npy_math.h * `#14122 `__: MAINT: Mark umath accuracy test xfail. * `#14124 `__: MAINT: Use equality instead of identity check with literal @@ -249,36 +252,39 @@ A total of 406 pull requests were merged for this release. * `#14153 `__: TST: Allow fuss in testing strided/non-strided exp/log loops * `#14170 `__: NEP: Proposal for __duckarray__ protocol * `#14171 `__: BUG: Make advanced indexing result on read-only subclass writeable +* `#14174 `__: BUG: Check for existence of ``fromstr`` which used in ``fromstr_next_element`` * `#14178 `__: TST: Clean up of test_pocketfft.py * `#14181 `__: DEP: Deprecate np.alen +* `#14183 `__: DOC: Fix misleading ``allclose`` docstring for ``equal_nan`` * `#14185 `__: MAINT: Workaround for Intel compiler bug leading to failing test -* `#14190 `__: DOC: Fix hermitian argument docs in `svd` +* `#14190 `__: DOC: Fix hermitian argument docs in ``svd`` * `#14195 `__: MAINT: Fix a docstring typo. -* `#14196 `__: DOC: Fix links in `/.github/CONTRIBUTING.md`. +* `#14196 `__: DOC: Fix links in ``/.github/CONTRIBUTING.md``. * `#14197 `__: ENH: Multivariate normal speedups * `#14203 `__: MAINT: Improve mismatch message of np.testing.assert_array_equal * `#14204 `__: DOC,MAINT: Move towncrier files and fixup categories * `#14207 `__: BUG: Fixed default BitGenerator name * `#14209 `__: BUG: Fix uint-overflow if padding with linear_ramp and negative... * `#14216 `__: ENH: Enable huge pages in all Linux builds -* `#14217 `__: BUG: Fix leak in the f2py-generated module init and `PyMem_Del`... +* `#14217 `__: BUG: Fix leak in the f2py-generated module init and ``PyMem_Del``... * `#14219 `__: DOC: new nan_to_num keywords are from 1.17 onwards * `#14223 `__: TST: Add tests for deprecated C functions (PyArray_As1D, PyArray_As1D) -* `#14224 `__: DOC: mention `take_along_axis` in `choose` +* `#14224 `__: DOC: mention ``take_along_axis`` in ``choose`` * `#14227 `__: ENH: Parse complex number from string * `#14231 `__: DOC: update or remove outdated sourceforge links * `#14234 `__: MAINT: Better error message for norm * `#14235 `__: DOC: add backlinks to numpy.org * `#14240 `__: BUG: Don't fail when lexsorting some empty arrays. -* `#14241 `__: BUG: Fix segfault in `random.permutation(x)` when x is a string. +* `#14241 `__: BUG: Fix segfault in ``random.permutation(x)`` when x is a string. * `#14245 `__: Doc: fix a typo in NEP21 * `#14249 `__: DOC: set status of NEP 28 (website redesign) to Accepted * `#14250 `__: BLD: MAINT: change default behavior of build flag appending. * `#14252 `__: BUG: Fixes StopIteration error from 'np.genfromtext' for empty... -* `#14255 `__: BUG: fix inconsistent axes ordering for axis in function `unique` +* `#14255 `__: BUG: fix inconsistent axes ordering for axis in function ``unique`` * `#14256 `__: DEP: Deprecate load/dump functions in favour of pickle methods * `#14257 `__: MAINT: Update NEP-30 * `#14259 `__: DEP: Deprecate arrayprint formatting functions +* `#14263 `__: DOC: Make Py3K docs C code snippets RST literal blocks * `#14266 `__: DOC: remove scipy.org from the breadcrumb formattiong * `#14270 `__: BUG: Fix formatting error in exception message * `#14272 `__: DOC: Address typos in dispatch docs @@ -293,9 +299,9 @@ A total of 406 pull requests were merged for this release. * `#14313 `__: DOC: Clarify rules about broadcasting when empty arrays are involved. * `#14321 `__: TST, MAINT: bump to OpenBLAS 0.3.7 stable * `#14325 `__: DEP: numpy.testing.rand -* `#14335 `__: DEP: Deprecate class `SafeEval` +* `#14335 `__: DEP: Deprecate class ``SafeEval`` * `#14341 `__: BUG: revert detecting and raising error on ragged arrays -* `#14342 `__: DOC: Improve documentation of `isscalar`. +* `#14342 `__: DOC: Improve documentation of ``isscalar``. * `#14349 `__: MAINT: Fix bloated mismatch error percentage in array comparisons. * `#14351 `__: DOC: Fix a minor typo in dispatch documentation. * `#14352 `__: MAINT: Remove redundant deprecation checks @@ -344,7 +350,7 @@ A total of 406 pull requests were merged for this release. * `#14475 `__: DOC: add timedelta64 signature * `#14477 `__: MAINT: Extract raising of MemoryError to a helper function * `#14483 `__: BUG,MAINT: Some fixes and minor cleanup based on clang analysis -* `#14484 `__: MAINT: Add `NPY_UNUSED` and `const` qualified suggested by clang +* `#14484 `__: MAINT: Add ``NPY_UNUSED`` and ``const`` qualified suggested by clang * `#14485 `__: MAINT: Silence integer comparison build warnings in assert statements * `#14486 `__: MAINT: distutils: Add newline at the end of printed warnings. * `#14490 `__: BUG: random: Revert gh-14458 and refix gh-14557. @@ -383,7 +389,7 @@ A total of 406 pull requests were merged for this release. * `#14567 `__: DEP: remove deprecated (and private) numpy.testing submodules. * `#14568 `__: BLD, DOC: fix gh-14518, add release note * `#14570 `__: BUG: importing build_src breaks setuptools monkeypatch for msvc14 -* `#14572 `__: DOC: Note runtests.py `-- -s` method to use pytests `-s` +* `#14572 `__: DOC: Note runtests.py ``-- -s`` method to use pytests ``-s`` * `#14573 `__: DOC: update submodule docstrings, remove info.py files * `#14576 `__: DOC: Document the NPY_SCALARKIND values as C variables. * `#14582 `__: MAINT: Bump pytest from 5.1.2 to 5.1.3 @@ -405,30 +411,31 @@ A total of 406 pull requests were merged for this release. * `#14614 `__: MAINT: Bump pytest from 5.1.3 to 5.2.0 * `#14615 `__: MAINT: Add "MAINT" tag to dependabot commit msg * `#14616 `__: DOC: Updated sphinx directive formatting -* `#14620 `__: DEP: Finish deprecation of non-integer `num` in linspace +* `#14620 `__: DEP: Finish deprecation of non-integer ``num`` in linspace * `#14621 `__: DOC: s/OR/AND/ in np.logical_and docstring * `#14623 `__: DOC: misleading np.sinc() documentation * `#14629 `__: DOC: clarify residual in np.polyfit * `#14630 `__: BUILD: change to build_src --verbose-cfg, runtests.py --debug-info * `#14631 `__: BUG: always free clean_sep -* `#14634 `__: DOC: Create `class Extension` docstring and add it to documentation. -* `#14636 `__: DOC: add `printoptions` as a context manager to `set_printoptions` +* `#14634 `__: DOC: Create ``class Extension`` docstring and add it to documentation. +* `#14636 `__: DOC: add ``printoptions`` as a context manager to ``set_printoptions`` * `#14639 `__: DOC: Fix typo in NEP 29 * `#14643 `__: MAINT: Use scalar math power function directly * `#14649 `__: DOC: Add IPython to dependencies needed to build docs. * `#14652 `__: MAINT: Bump pytest-cov from 2.7.1 to 2.8.1 * `#14653 `__: MAINT: Bump pytest from 5.2.0 to 5.2.1 * `#14654 `__: MAINT: Bump pytz from 2019.2 to 2019.3 -* `#14656 `__: MAINT: Use `extract_unit` throughout datetime +* `#14656 `__: MAINT: Use ``extract_unit`` throughout datetime * `#14657 `__: BUG: fix fromfile behavior when reading sub-array dtypes * `#14662 `__: BUG: random: Use correct length when axis is given to shuffle. * `#14669 `__: BUG: Do not rely on undefined behaviour to cast from float to... * `#14674 `__: NEP: add default-dtype-object-deprecation nep 34 * `#14681 `__: MAINT: Remove unused boolean negative/subtract loops -* `#14682 `__: DEP: ufunc `out` argument must be a tuple for multiple outputs -* `#14693 `__: BUG: Fix `np.einsum` errors on Power9 Linux and z/Linux +* `#14682 `__: DEP: ufunc ``out`` argument must be a tuple for multiple outputs +* `#14693 `__: BUG: Fix ``np.einsum`` errors on Power9 Linux and z/Linux * `#14696 `__: DOC: Note release notes process changes on devdocs start page * `#14699 `__: Doc warnings +* `#14703 `__: TST: Adding CI stages, with one initial job to the Travis CI * `#14705 `__: DOC: Switch Markdown link to RST in NEP 29 * `#14709 `__: TST: Divide Azure CI Pipelines into stages. * `#14710 `__: DEP: Finish the out kwarg deprecation for ufunc calls @@ -526,7 +533,7 @@ A total of 406 pull requests were merged for this release. * `#15058 `__: API, DOC: change names to multivariate_hypergeometric, improve docs * `#15059 `__: REL: Prepare for NumPy 1.18.0 release. * `#15109 `__: TST: Check requires_memory immediately before the test -* `#15111 `__: ENH: Add support to sort timedelta64 `NaT` to end of the array +* `#15111 `__: ENH: Add support to sort timedelta64 ``NaT`` to end of the array * `#15112 `__: MAINT: follow-up cleanup for blas64 PR * `#15113 `__: ENH: f2py: add --f2cmap option for specifying the name of .f2py_f2cmap * `#15114 `__: ENH: add support for ILP64 OpenBLAS (without symbol suffix) diff --git a/doc/changelog/1.18.5-changelog.rst b/doc/changelog/1.18.5-changelog.rst new file mode 100644 index 000000000000..f0bc51e6f2a7 --- /dev/null +++ b/doc/changelog/1.18.5-changelog.rst @@ -0,0 +1,18 @@ + +Contributors +============ + +A total of 3 people contributed to this release. People with a "+" by their +names contributed a patch for the first time. + +* Charles Harris +* Matti Picus +* Siyuan + + +Pull requests merged +==================== + +A total of 2 pull requests were merged for this release. + +* `#16439 `__: ENH: enable pickle protocol 5 support for python3.5 +* `#16441 `__: BUG: relpath fails for different drives on windows diff --git a/doc/changelog/1.19.0-changelog.rst b/doc/changelog/1.19.0-changelog.rst index bd743832a33b..bde00249972a 100644 --- a/doc/changelog/1.19.0-changelog.rst +++ b/doc/changelog/1.19.0-changelog.rst @@ -136,25 +136,28 @@ names contributed a patch for the first time. Pull requests merged ==================== -A total of 452 pull requests were merged for this release. +A total of 488 pull requests were merged for this release. * `#8255 `__: ENH: add identity kwarg to frompyfunc +* `#10600 `__: DOC: Do not complain about contiguity when mutating ``ndarray.shape`` * `#12646 `__: TST: check exception details in refguide_check.py * `#13421 `__: ENH: improve runtime detection of CPU features * `#14326 `__: TST: Add assert_array_equal test for big integer arrays. * `#14376 `__: MAINT: Remove unnecessary 'from __future__ import ...' statements * `#14530 `__: MAINT: Fix typos and copy edit NEP-0030. * `#14546 `__: DOC: NumPy for absolute beginners tutorial -* `#14715 `__: NEP: Proposal for array creation dispatching with `__array_function__` +* `#14715 `__: NEP: Proposal for array creation dispatching with ``__array_function__`` * `#14867 `__: ENH: Use AVX-512F for np.maximum and np.minimum * `#14924 `__: BUG: Fix numpy.random.dirichlet returns NaN for small 'alpha'... -* `#14933 `__: API: Use `ResultType` in `PyArray_ConvertToCommonType` +* `#14933 `__: API: Use ``ResultType`` in ``PyArray_ConvertToCommonType`` +* `#14940 `__: BUG: pickle the content of a scalar containing objects, not the... * `#14942 `__: MAINT,API: ignore and NULL fasttake/fastputmask ArrFuncs slots * `#14981 `__: BUG: Make ``ediff1d`` kwarg casting consistent * `#14988 `__: DOC: linalg: Include information about scipy.linalg. * `#14995 `__: BUG: Use ``__array__`` during dimension discovery * `#15011 `__: MAINT: cleanup compat.py3k.py * `#15022 `__: ENH: f2py: improve error messages +* `#15024 `__: DOC: clarify documentation for transpose() * `#15028 `__: [DOC] LaTeX: fix preamble (closes #15026) * `#15035 `__: BUG: add endfunction, endsubroutine to valid fortran end words * `#15040 `__: TST: Add test for object method (and general unary) loops @@ -165,6 +168,7 @@ A total of 452 pull requests were merged for this release. * `#15052 `__: MAINT: follow-up cleanup for blas64 PR * `#15054 `__: DOC: add docstrings to refguide-check * `#15066 `__: Revert "DEP: issue deprecation warning when creating ragged array... +* `#15068 `__: ENH: Add support to sort timedelta64 ``NaT`` to end of the array * `#15069 `__: ENH: add support for ILP64 OpenBLAS (without symbol suffix) * `#15070 `__: DOC: correct version for NaT sort * `#15072 `__: TST: Check requires_memory immediately before the test @@ -201,6 +205,7 @@ A total of 452 pull requests were merged for this release. * `#15187 `__: MAINT: unskip test on win32 * `#15189 `__: ENH: Add property-based tests using Hypothesis * `#15194 `__: BUG: test, fix for c++ compilation +* `#15195 `__: MAINT: refactoring in np.core.records * `#15196 `__: DOC: Adding instructions for building documentation to developer... * `#15197 `__: DOC: NEP 37: A dispatch protocol for NumPy-like modules * `#15203 `__: MAINT: Do not use private Python function in testing @@ -215,6 +220,8 @@ A total of 452 pull requests were merged for this release. * `#15227 `__: DOC: typo in release.rst * `#15228 `__: NEP: universal SIMD NEP 38 * `#15229 `__: MAINT: Remove unused int_asbuffer +* `#15230 `__: BUG: do not emit warnings for np.sign, np.equal when using nan +* `#15231 `__: MAINT: Remove Python2 specific C module setup [part2] * `#15232 `__: MAINT: Cleaning up PY_MAJOR_VERSION/PY_VERSION_HEX * `#15233 `__: MAINT: Clean up more PY_VERSION_HEX * `#15236 `__: MAINT: Remove implicit inheritance from object class @@ -224,14 +231,14 @@ A total of 452 pull requests were merged for this release. * `#15241 `__: MAINT: Remove references to non-existent sys.exc_clear() * `#15242 `__: DOC: Update HOWTO_RELEASE.rst * `#15248 `__: MAINT: cleanup use of sys.exc_info -* `#15249 `__: MAINT: Eliminate some calls to `eval` +* `#15249 `__: MAINT: Eliminate some calls to ``eval`` * `#15251 `__: MAINT: Improve const-correctness of shapes and strides * `#15253 `__: DOC: clarify the effect of None parameters passed to ndarray.view * `#15254 `__: MAINT: Improve const-correctness of string arguments * `#15255 `__: MAINT: Delete numpy.distutils.compat * `#15256 `__: MAINT: Implement keyword-only arguments as syntax * `#15260 `__: MAINT: Remove FIXME comments introduced in the previous commit -* `#15261 `__: MAINT: Work with unicode strings in `dtype('i8,i8')` +* `#15261 `__: MAINT: Work with unicode strings in ``dtype('i8,i8')`` * `#15262 `__: BUG: Use PyDict_GetItemWithError() instead of PyDict_GetItem() * `#15263 `__: MAINT: Remove python2 array_{get,set}slice * `#15264 `__: DOC: Add some missing functions in the list of available ufuncs. @@ -248,8 +255,9 @@ A total of 452 pull requests were merged for this release. * `#15280 `__: BENCH: Add basic benchmarks for take and putmask * `#15281 `__: MAINT: Cleanup most PY3K #ifdef guards * `#15282 `__: DOC: BLD: add empty release notes for 1.19.0 to fix doc build... +* `#15283 `__: MAINT: Cleanup more NPY_PY3K * `#15284 `__: MAINT: Use a simpler return convention for internal functions -* `#15285 `__: MAINT: Simplify np.int_ inheritance +* `#15285 `__: MAINT: Simplify ``np.int_`` inheritance * `#15286 `__: DOC" Update np.full docstring. * `#15287 `__: MAINT: Express PyArray_DescrAlignConverter in terms of _convert_from_any * `#15288 `__: MAINT: Push down declarations in _convert_from_* @@ -261,7 +269,7 @@ A total of 452 pull requests were merged for this release. * `#15304 `__: MAINT: Remove NPY_PY3K constant * `#15305 `__: MAINT: Remove sys.version checks in tests * `#15307 `__: MAINT: cleanup sys.version dependant code -* `#15310 `__: MAINT: Ensure `_convert_from_*` functions set errors +* `#15310 `__: MAINT: Ensure ``_convert_from_*`` functions set errors * `#15312 `__: MAINT: Avoid escaping unicode in error messages * `#15315 `__: MAINT: Change file extension of ma README to rst. * `#15319 `__: BUG: fix NameError in clip nan propagation tests @@ -271,22 +279,25 @@ A total of 452 pull requests were merged for this release. * `#15329 `__: TST: move _no_tracing to testing._private, remove testing.support * `#15333 `__: BUG: Add some missing C error handling * `#15335 `__: MAINT: Remove sys.version checks -* `#15336 `__: DEP: Deprecate `->f->fastclip` at registration time +* `#15336 `__: DEP: Deprecate ``->f->fastclip`` at registration time * `#15338 `__: DOC: document site.cfg.example * `#15350 `__: MAINT: Fix mistype in histogramdd docstring * `#15351 `__: DOC, BLD: reword release note, upgrade sphinx version * `#15353 `__: MAINT: Remove unnecessary calls to PyArray_DATA from binomial... * `#15354 `__: MAINT: Bump pytest from 5.3.2 to 5.3.3 +* `#15355 `__: MAINT: Const qualify UFunc inner loops * `#15358 `__: MAINT: Remove six * `#15361 `__: MAINT: Revise imports from collections.abc module * `#15362 `__: MAINT: remove internal functions required to handle Python2/3... * `#15364 `__: MAINT: Remove other uses of six module * `#15366 `__: MAINT: resolve pyflake F403 'from module import *' used +* `#15367 `__: DOC: Fix Multithreaded Generation example docs * `#15368 `__: MAINT: Update tox for supported Python versions * `#15369 `__: MAINT: simd: Avoid signed comparison warning -* `#15370 `__: DOC: Updating Chararry Buffer datatypes #15360 +* `#15370 `__: DOC: Updating Chararry Buffer datatypes +* `#15373 `__: MAINT: Remove sys.version checks * `#15374 `__: TST: Simplify unicode test -* `#15375 `__: MAINT: Use `with open` when possible +* `#15375 `__: MAINT: Use ``with open`` when possible * `#15377 `__: MAINT: Cleanup python2 references * `#15379 `__: MAINT: Python2 Cleanups * `#15381 `__: DEP: add PendingDeprecation to matlib.py funky namespace @@ -303,11 +314,14 @@ A total of 452 pull requests were merged for this release. * `#15407 `__: MAINT: Replace basestring with str. * `#15408 `__: ENH: Use AVX-512F for complex number arithmetic, absolute, square... * `#15414 `__: MAINT: Remove Python2 workarounds +* `#15415 `__: MAINT: Revert f2py Python 2.6 workaround * `#15417 `__: MAINT: Cleanup references to python2 * `#15418 `__: MAINT, DOC: Remove use of old Python __builtin__, now known as... * `#15421 `__: ENH: Make use of ExitStack in npyio.py * `#15422 `__: MAINT: Inline gentype_getreadbuf * `#15423 `__: MAINT: Use f-strings for clarity. +* `#15425 `__: MAINT: dir(numpy) returns duplicate "testing" +* `#15426 `__: MAINT: Use the PyArrayScalar_VAL macro where possible * `#15427 `__: DEP: Schedule unused C-API functions for removal/disabling * `#15428 `__: DOC: Improve ndarray.ctypes example * `#15429 `__: DOC: distutils: Add a docstring to show_config(). @@ -315,14 +329,15 @@ A total of 452 pull requests were merged for this release. * `#15434 `__: MAINT: Updated polynomial to use fstrings * `#15435 `__: DOC: Fix Incorrect document in Beginner Docs * `#15436 `__: MAINT: Update core.py with fstrings (issue #15420) -* `#15439 `__: DOC: fix docstrings so `python tools/refguide-check --rst ... +* `#15439 `__: DOC: fix docstrings so ``python tools/refguide-check --rst ``... * `#15441 `__: MAINT: Tidy macros in scalar_new * `#15444 `__: MAINT: use 'yield from ' for simple cases * `#15445 `__: MAINT: Bump pytest from 5.3.3 to 5.3.4 * `#15446 `__: BUG: Reject nonsense arguments to scalar constructors * `#15449 `__: DOC: Update refguide_check note on how to skip code -* `#15451 `__: MAINT: Simplify `np.object_.__new__` +* `#15451 `__: MAINT: Simplify ``np.object_.__new__`` * `#15452 `__: STY,MAINT: avoid 'multiple imports on one line' +* `#15463 `__: ENH: expose ``bit_generator`` and random C-API to cython * `#15464 `__: MAINT: Cleanup duplicate line in refguide_check * `#15465 `__: MAINT: cleanup unused imports; avoid redefinition of imports * `#15468 `__: BUG: Fix for SVD not always sorted with hermitian=True @@ -330,21 +345,22 @@ A total of 452 pull requests were merged for this release. * `#15474 `__: MAINT: Eliminate messy _WORK macro * `#15476 `__: update result of rng.random(3) to current rng output * `#15480 `__: DOC: Correct get_state doc -* `#15482 `__: MAINT: Use `.identifier = val` to fill type structs +* `#15482 `__: MAINT: Use ``.identifier = val`` to fill type structs * `#15483 `__: [DOC] Mention behaviour of np.squeeze with one element * `#15484 `__: ENH: fixing generic error messages to be more specific in multiarray/descriptor.c * `#15487 `__: BUG: Fixing result of np quantile edge case * `#15491 `__: TST: mark the top 3 slowest tests to save ~10 seconds * `#15493 `__: MAINT: Bump pytest from 5.3.4 to 5.3.5 * `#15500 `__: MAINT: Use True/False instead of 1/0 in np.dtype.__reduce__ -* `#15503 `__: MAINT: Do not allow `copyswap` and friends to fail silently +* `#15503 `__: MAINT: Do not allow ``copyswap`` and friends to fail silently * `#15504 `__: DOC: Remove duplicated code in true_divide docstring * `#15505 `__: NEP 40: Informational NEP about current DTypes +* `#15506 `__: NEP 41: First steps towards improved Datatype Support * `#15510 `__: DOC: Update unique docstring example * `#15511 `__: MAINT: Large overhead in some random functions * `#15516 `__: TST: Fix missing output in refguide-check * `#15521 `__: MAINT: Simplify arraydescr_richcompare -* `#15522 `__: MAINT: Fix internal misuses of `NPY_TITLE_KEY` +* `#15522 `__: MAINT: Fix internal misuses of ``NPY_TITLE_KEY`` * `#15524 `__: DOC: Update instructions for building/archiving docs. * `#15526 `__: BUG: Fix inline assembly that detects cpu features on x86(32bit) * `#15532 `__: update doctests, small bugs and changes of repr @@ -354,13 +370,15 @@ A total of 452 pull requests were merged for this release. * `#15543 `__: NEP: edit and move NEP 38 to accepted status * `#15547 `__: MAINT: Refresh Doxyfile and modernize numpyfilter.py * `#15549 `__: TST: Accuracy test float32 sin/cos/exp/log for AVX platforms -* `#15550 `__: DOC: Improve the `numpy.linalg.eig` docstring. +* `#15550 `__: DOC: Improve the ``numpy.linalg.eig`` docstring. +* `#15553 `__: BUG: Added missing error check in ``ndarray.__contains__`` * `#15554 `__: NEP 44 - Restructuring the NumPy Documentation * `#15556 `__: TST: (Travis CI) Use full python3-dbg path for virtual env creation * `#15560 `__: BUG, DOC: restore missing import * `#15566 `__: DOC: Removing bad practices from quick start + some PEP8 * `#15574 `__: TST: Do not create symbolic link named gfortran. * `#15575 `__: DOC: Document caveat in random.uniform +* `#15577 `__: TST: Test division by zero both with scalar and with array * `#15579 `__: DOC: numpy.clip is equivalent to minimum(..., maximum(...)) * `#15582 `__: MAINT: Bump cython from 0.29.14 to 0.29.15 * `#15583 `__: MAINT: Bump hypothesis from 5.3.0 to 5.5.4 @@ -369,6 +387,7 @@ A total of 452 pull requests were merged for this release. * `#15600 `__: TST: use manylinux2010 docker instead of ubuntu * `#15610 `__: TST: mask DeprecationWarning in xfailed test * `#15612 `__: BUG: Fix bug in AVX-512F np.maximum and np.minimum +* `#15614 `__: DOC: Reword docstring for assert_equal * `#15615 `__: BUG: Remove check requiring natural alignment of float/double... * `#15616 `__: DOC: Add missing imports, definitions and dummy file * `#15619 `__: DOC: Fix documentation for apply_along_axis @@ -376,9 +395,10 @@ A total of 452 pull requests were merged for this release. * `#15631 `__: MAINT: Pull identical line out of conditional. * `#15633 `__: DOC: remove broken link in f2py tutorial * `#15639 `__: BLD: update openblas download to new location, use manylinux2010-base +* `#15644 `__: DOC: Update to clarify actual behavior real_if_(all elements)_close * `#15648 `__: MAINT: AVX512 implementation with intrinsic for float64 input... * `#15653 `__: BLD: update OpenBLAS to pre-0.3.9 version -* `#15662 `__: DOC: Refactor `np.polynomial` docs using `automodule` +* `#15662 `__: DOC: Refactor ``np.polynomial`` docs using ``automodule`` * `#15665 `__: BUG: fix doctest exception messages * `#15672 `__: MAINT: Added comment pointing FIXME to relevant PR. * `#15673 `__: DOC: Make extension module wording more clear @@ -386,16 +406,18 @@ A total of 452 pull requests were merged for this release. * `#15680 `__: DOC: Improve Benchmark README with environment setup and more... * `#15682 `__: MAINT: Bump hypothesis from 5.5.4 to 5.6.0 * `#15683 `__: NEP: move NEP 44 to accepted status +* `#15685 `__: ENH: Add ``subok`` parameter to np.copy function (cf. #6509) * `#15694 `__: DOC: Fix indexing docs to pass refguide * `#15695 `__: MAINT: Test during import to detect bugs with Accelerate(MacOS)... * `#15696 `__: MAINT: Add a fast path to var for complex input * `#15701 `__: MAINT: Convert shebang from python to python3 (#15687) * `#15702 `__: MAINT: replace optparse with argparse for 'doc' and 'tools' scripts * `#15703 `__: DOC: Fix quickstart doc to pass refguide +* `#15705 `__: DOC: Change list to tuple in example description. * `#15706 `__: MAINT: Fixing typos in f2py comments and code. * `#15710 `__: DOC: fix SVD tutorial to pass refguide * `#15714 `__: MAINT: use list-based APIs to call subprocesses -* `#15715 `__: ENH: update numpy.linalg.multi_dot to accept an `out` argument +* `#15715 `__: ENH: update numpy.linalg.multi_dot to accept an ``out`` argument * `#15716 `__: TST: always use 'python -mpip' not 'pip' * `#15717 `__: DOC: update datetime reference to pass refguide * `#15718 `__: DOC: Fix coremath.rst to fix refguide_check @@ -403,6 +425,7 @@ A total of 452 pull requests were merged for this release. * `#15723 `__: BUG: fix logic error when nm fails on 32-bit * `#15724 `__: TST: Remove nose from the test_requirements.txt file. * `#15733 `__: DOC: Allow NEPs to link to python, numpy, scipy, and matplotlib... +* `#15735 `__: DOC: LICENSE 2019 -> 2020 * `#15736 `__: BUG: Guarantee array is in valid state after memory error occurs... * `#15738 `__: MAINT: Remove non-native byte order from _var check. * `#15740 `__: MAINT: Add better error handling in linalg.norm for vectors and... @@ -418,28 +441,30 @@ A total of 452 pull requests were merged for this release. * `#15769 `__: ENH: Allow toggling madvise hugepage and fix default * `#15771 `__: DOC: Fix runtests example in developer docs * `#15773 `__: DEP: Make issubdtype consistent for types and dtypes -* `#15774 `__: MAINT: remove useless `global` statements +* `#15774 `__: MAINT: remove useless ``global`` statements * `#15778 `__: BLD: Add requirements.txt file for building docs * `#15781 `__: BUG: don't add 'public' or 'private' if the other one exists -* `#15784 `__: ENH: Use TypeError in `np.array` for python consistency +* `#15784 `__: ENH: Use TypeError in ``np.array`` for python consistency * `#15794 `__: BUG: Add basic __format__ for masked element to fix incorrect... * `#15797 `__: TST: Add unit test for out=None of np.einsum * `#15799 `__: MAINT: Cleanups to np.insert and np.delete * `#15800 `__: BUG: Add error-checking versions of strided casts. -* `#15802 `__: DEP: Make `np.insert` and `np.delete` on 0d arrays with an axis... -* `#15803 `__: DOC: correct possible list lengths for `extobj` in ufunc calls +* `#15802 `__: DEP: Make ``np.insert`` and ``np.delete`` on 0d arrays with an axis... +* `#15803 `__: DOC: correct possible list lengths for ``extobj`` in ufunc calls * `#15804 `__: DEP: Make np.delete on out-of-bounds indices an error -* `#15805 `__: DEP: Forbid passing non-integral index arrays to `insert` and... +* `#15805 `__: DEP: Forbid passing non-integral index arrays to ``insert`` and... * `#15806 `__: TST: Parametrize sort test * `#15809 `__: TST: switch PyPy job with CPython * `#15812 `__: TST: Remove code that is not supposed to warn out of warning... * `#15815 `__: DEP: Do not cast boolean indices to integers in np.delete * `#15816 `__: MAINT: simplify code that assumes str/unicode and int/long are... +* `#15827 `__: BUG: Break on all errors when performing strided casts. * `#15830 `__: MAINT: pathlib and hashlib are in stdlib in Python 3.5+ -* `#15832 `__: ENH: improved error message `IndexError: too many indices for... +* `#15832 `__: ENH: improved error message ``IndexError: too many indices for``... +* `#15834 `__: NEP: Add paragraph to NEP 41 about no array-object use and fix... * `#15836 `__: BUG: Fix IndexError for illegal axis in np.mean * `#15839 `__: DOC: Minor fix to _hist_bin_fd documentation -* `#15840 `__: BUG,DEP: Make `scalar.__round__()` behave like pythons round +* `#15840 `__: BUG,DEP: Make ``scalar.__round__()`` behave like pythons round * `#15843 `__: DOC: First steps towards docs restructuring (NEP 44) * `#15848 `__: DOC, TST: enable refguide_check in circleci * `#15850 `__: DOC: fix typo in C-API reference @@ -447,8 +472,9 @@ A total of 452 pull requests were merged for this release. * `#15866 `__: MAINT: Bump cython from 0.29.15 to 0.29.16 * `#15867 `__: DEP: Deprecate ndarray.tostring() * `#15868 `__: TST: use draft OpenBLAS build +* `#15870 `__: ENH: Add keepdims argument to count_nonzero * `#15872 `__: BUG: Fix eigh and cholesky methods of numpy.random.multivariate_normal -* `#15876 `__: BUG: Check that `pvals` is 1D in `_generator.multinomial`. +* `#15876 `__: BUG: Check that ``pvals`` is 1D in ``_generator.multinomial``. * `#15877 `__: DOC: Add missing signature from nditer docstring * `#15881 `__: BUG: Fix empty_like to respect shape=() * `#15882 `__: BUG: Do not ignore empty tuple of strides in ndarray.__new__ @@ -456,29 +482,34 @@ A total of 452 pull requests were merged for this release. * `#15884 `__: BUG: Setting a 0d array's strides to themselves should be legal * `#15885 `__: BUG: Respect itershape=() in nditer * `#15887 `__: MAINT: Clean-up 'next = __next__' used for Python 2 compatibility +* `#15891 `__: DOC: Clarify docs on mixed advanced indexing and slicing * `#15893 `__: TST: Run test_large_zip in a child process * `#15894 `__: DOC: Add missing doc of numpy.ma.apply_over_axes in API list. * `#15899 `__: DOC: Improve record module documentation * `#15901 `__: DOC: Fixed order of items and link to mailing list in dev docs... * `#15903 `__: BLD: report clang version on macOS -* `#15904 `__: MAINT: records: Remove private `format_parser._descr` attribute +* `#15904 `__: MAINT: records: Remove private ``format_parser._descr`` attribute +* `#15907 `__: DOC: Update documentation w.r.t. NPY_RELAXED_STRIDES_CHECKING * `#15914 `__: BUG: random: Disallow p=0 in negative_binomial +* `#15920 `__: DOC: Improve docstring for numpy.linalg.lstsq * `#15921 `__: ENH: Use sysconfig instead of probing Makefile * `#15928 `__: DOC: Update np.copy docstring to include ragged case * `#15931 `__: DOC: Correct private function name to PyArray_AdaptFlexibleDType -* `#15936 `__: MAINT: Fix capitalization in error message in `mtrand.pyx` +* `#15936 `__: MAINT: Fix capitalization in error message in ``mtrand.pyx`` +* `#15938 `__: BUG: Add _LARGE_FILES to def_macros[] when platform is AIX. * `#15939 `__: DOC: Update np.rollaxis docstring * `#15949 `__: BUG: fix AttributeError on accessing object in nested MaskedArray. -* `#15951 `__: BUG: Alpha parameter must be 1D in `generator.dirichlet` +* `#15951 `__: BUG: Alpha parameter must be 1D in ``generator.dirichlet`` * `#15953 `__: NEP: minor maintenance, update filename and fix a cross-reference * `#15964 `__: MAINT: Bump hypothesis from 5.8.0 to 5.8.3 * `#15967 `__: TST: Add slow_pypy support * `#15968 `__: DOC: Added note to angle function docstring about angle(0) being... * `#15982 `__: MAINT/BUG: Cleanup and minor fixes to conform_reduce_result -* `#15985 `__: BUG: Avoid duplication in stack trace of `linspace(a, b, num=1.5)` -* `#15988 `__: BUG: Fix inf and NaN-warnings in half float `nextafter` +* `#15985 `__: BUG: Avoid duplication in stack trace of ``linspace(a, b, num=1.5)`` +* `#15988 `__: BUG: Fix inf and NaN-warnings in half float ``nextafter`` * `#15989 `__: MAINT: Remove 0d check for PyArray_ISONESEGMENT * `#15990 `__: DEV: Pass additional runtests.py args to ASV +* `#15991 `__: BUG: max/min of a masked array dtype fix * `#15993 `__: DOC: Fix method documentation of function sort in MaskedArray * `#16000 `__: NEP: Improve Value Based Casting paragraph in NEP 40 * `#16001 `__: DOC: add note on flatten ordering in matlab page @@ -496,6 +527,8 @@ A total of 452 pull requests were merged for this release. * `#16038 `__: MAINT,TST: Move _repr_latex tests to test_printing. * `#16041 `__: BUG: missing 'f' prefix for fstring * `#16042 `__: ENH: Fix exception causes in build_ext.py +* `#16043 `__: DOC: Add converters example to the loadtxt docstring +* `#16051 `__: DOC: Add missing bracket * `#16053 `__: DOC: Small typo fixes to NEP 40. * `#16054 `__: DOC, BLD: update release howto and walkthrough for ananconda.org... * `#16061 `__: ENH: Chained exceptions in linalg.py and polyutils.py @@ -508,6 +541,7 @@ A total of 452 pull requests were merged for this release. * `#16077 `__: BLD: fix path to libgfortran on macOS * `#16078 `__: DOC: Add axis to random module "new or different" docs * `#16079 `__: DOC,BLD: Limit timeit iterations in random docs. +* `#16080 `__: BUG: numpy.einsum indexing arrays now accept numpy int type * `#16081 `__: DOC: add note on type casting to numpy.left_shift(). * `#16083 `__: DOC: improve development debugging doc * `#16084 `__: DOC: tweak neps/scope.rst @@ -517,10 +551,12 @@ A total of 452 pull requests were merged for this release. * `#16097 `__: MAINT, DOC: Improve grammar on a comment in the quickstart * `#16100 `__: NEP 41: Accept NEP 41 and add DType<->scalar duplication paragraph * `#16101 `__: BLD: put openblas library in local directory on windows +* `#16102 `__: ENH: correct identity for logaddexp2 ufunc: -inf * `#16113 `__: MAINT: Fix random.PCG64 signature * `#16119 `__: DOC: Move misplaced news fragment for gh-13421 * `#16122 `__: DOC: Fix links for NEP 40 in NEP 41 * `#16125 `__: BUG: lib: Fix a problem with vectorize with default parameters. +* `#16128 `__: ENH: Add equal_nan keyword argument to array_equal * `#16129 `__: ENH: Better error message when ``bins`` has float value in ``histogramdd``. * `#16133 `__: MAINT: Unify casting error creation (outside the iterator) * `#16141 `__: BENCH: Default to building HEAD instead of master @@ -571,7 +607,7 @@ A total of 452 pull requests were merged for this release. * `#16344 `__: BUG: Allow attaching documentation twice in add_docstring * `#16355 `__: MAINT: Remove f-strings in setup.py. (gh-16346) * `#16356 `__: BUG: Indentation for docstrings -* `#16358 `__: BUG: Fix dtype leak in `PyArray_FromAny` error path +* `#16358 `__: BUG: Fix dtype leak in ``PyArray_FromAny`` error path * `#16383 `__: ENH: Optimize Cpu feature detect in X86, fix for GCC on macOS... * `#16398 `__: MAINT: core: Use a raw string for the fromstring docstring. * `#16399 `__: MAINT: Make ctypes optional on Windows diff --git a/doc/changelog/1.19.5-changelog.rst b/doc/changelog/1.19.5-changelog.rst new file mode 100644 index 000000000000..f7cbd5377190 --- /dev/null +++ b/doc/changelog/1.19.5-changelog.rst @@ -0,0 +1,32 @@ + +Contributors +============ + +A total of 8 people contributed to this release. People with a "+" by their +names contributed a patch for the first time. + +* Charles Harris +* Christoph Gohlke +* Matti Picus +* Raghuveer Devulapalli +* Sebastian Berg +* Simon Graham + +* Veniamin Petrenko + +* Bernie Gray + + +Pull requests merged +==================== + +A total of 11 pull requests were merged for this release. + +* `#17756 `__: BUG: Fix segfault due to out of bound pointer in floatstatus... +* `#17774 `__: BUG: fix np.timedelta64('nat').__format__ throwing an exception +* `#17775 `__: BUG: Fixed file handle leak in array_tofile. +* `#17786 `__: BUG: Raise recursion error during dimension discovery +* `#17917 `__: BUG: Fix subarray dtype used with too large count in fromfile +* `#17918 `__: BUG: 'bool' object has no attribute 'ndim' +* `#17919 `__: BUG: ensure _UFuncNoLoopError can be pickled +* `#17924 `__: BLD: use BUFFERSIZE=20 in OpenBLAS +* `#18026 `__: BLD: update to OpenBLAS 0.3.13 +* `#18036 `__: BUG: make a variable volatile to work around clang compiler bug +* `#18114 `__: REL: Prepare for the NumPy 1.19.5 release. diff --git a/doc/changelog/1.20.0-changelog.rst b/doc/changelog/1.20.0-changelog.rst new file mode 100644 index 000000000000..f06bd8a8d22d --- /dev/null +++ b/doc/changelog/1.20.0-changelog.rst @@ -0,0 +1,913 @@ + +Contributors +============ + +A total of 184 people contributed to this release. People with a "+" by their +names contributed a patch for the first time. + +* Aaron Meurer + +* Abhilash Barigidad + +* Abhinav Reddy + +* Abhishek Singh + +* Al-Baraa El-Hag + +* Albert Villanova del Moral + +* Alex Leontiev + +* Alex Rockhill + +* Alex Rogozhnikov +* Alexander Belopolsky +* Alexander Kuhn-Regnier + +* Allen Downey + +* Andras Deak +* Andrea Olivo + +* Andrew Eckart + +* Anirudh Subramanian +* Anthony Byuraev + +* Antonio Larrosa + +* Ashutosh Singh + +* Bangcheng Yang + +* Bas van Beek + +* Ben Derrett + +* Ben Elliston + +* Ben Nathanson + +* Bernie Gray + +* Bharat Medasani + +* Bharat Raghunathan +* Bijesh Mohan + +* Bradley Dice + +* Brandon David + +* Brandt Bucher +* Brian Soto + +* Brigitta Sipocz +* Cameron Blocker + +* Carl Leake + +* Charles Harris +* Chris Brown + +* Chris Vavaliaris + +* Christoph Gohlke +* Chunlin Fang +* CloseChoice + +* Daniel G. A. Smith + +* Daniel Hrisca +* Daniel Vanzo + +* David Pitchford + +* Davide Dal Bosco + +* Derek Homeier +* Dima Kogan + +* Dmitry Kutlenkov + +* Douglas Fenstermacher + +* Dustin Spicuzza + +* E. Madison Bray + +* Elia Franzella + +* Enrique Matías Sánchez + +* Erfan Nariman | Veneficus + +* Eric Larson +* Eric Moore +* Eric Wieser +* Erik M. Bray +* EthanCJ-git + +* Etienne Guesnet + +* FX Coudert + +* Felix Divo +* Frankie Robertson + +* Ganesh Kathiresan +* Gengxin Xie +* Gerry Manoim + +* Guilherme Leobas +* Hassan Kibirige +* Hugo Mendes + +* Hugo van Kemenade +* Ian Thomas + +* InessaPawson + +* Isabela Presedo-Floyd + +* Isuru Fernando +* Jakob Jakobson + +* Jakub Wilk +* James Myatt + +* Jesse Li + +* John Hagen + +* John Zwinck +* Joseph Fox-Rabinovitz +* Josh Wilson +* Jovial Joe Jayarson + +* Julia Signell + +* Jun Kudo + +* Karan Dhir + +* Kaspar Thommen + +* Kerem Hallaç +* Kevin Moore + +* Kevin Sheppard +* Klaus Zimmermann + +* LSchroefl + +* Laurie + +* Laurie Stephey + +* Levi Stovall + +* Lisa Schwetlick + +* Lukas Geiger + +* Madhulika Jain Chambers + +* Matthias Bussonnier +* Matti Picus +* Melissa Weber Mendonça +* Michael Hirsch +* Nick R. Papior +* Nikola Forró +* Noman Arshad + +* Paul YS Lee + +* Pauli Virtanen +* Paweł Redzyński + +* Peter Andreas Entschev +* Peter Bell +* Philippe Ombredanne + +* Phoenix Meadowlark + +* Piotr Gaiński +* Raghav Khanna + +* Raghuveer Devulapalli +* Rajas Rade + +* Rakesh Vasudevan +* Ralf Gommers +* Raphael Kruse + +* Rashmi K A + +* Robert Kern +* Rohit Sanjay + +* Roman Yurchak +* Ross Barnowski +* Royston E Tauro + +* Ryan C Cooper + +* Ryan Soklaski +* Safouane Chergui + +* Sahil Siddiq + +* Sarthak Vineet Kumar + +* Sayed Adel +* Sebastian Berg +* Sergei Vorfolomeev + +* Seth Troisi +* Sidhant Bansal + +* Simon Gasse +* Simon Graham + +* Stefan Appelhoff + +* Stefan Behnel + +* Stefan van der Walt +* Steve Dower +* Steve Joachim + +* Steven Pitman + +* Stuart Archibald +* Sturla Molden +* Susan Chang + +* Takanori H + +* Tapajyoti Bose + +* Thomas A Caswell +* Tina Oberoi +* Tirth Patel +* Tobias Pitters + +* Tomoki, Karatsu + +* Tyler Reddy +* Veniamin Petrenko + +* Wansoo Kim + +* Warren Weckesser +* Wei Yang + +* Wojciech Rzadkowski +* Yang Hau + +* Yogesh Raisinghani + +* Yu Feng +* Yuya Unno + +* Zac Hatfield-Dodds +* Zuhair Ali-Khan + +* @abhilash42 + +* @danbeibei + +* @dojafrat +* @dpitch40 + +* @forfun + +* @iamsoto + +* @jbrockmendel + +* @leeyspaul + +* @mitch + +* @prateek arora + +* @serge-sans-paille + +* @skywalker + +* @stphnlyd + +* @xoviat +* @谭九鼎 + +* @JMFT + +* @Jack + +* @Neal C + + +Pull requests merged +==================== + +A total of 716 pull requests were merged for this release. + +* `#13516 `__: ENH: enable multi-platform SIMD compiler optimizations +* `#14779 `__: NEP 36 (fair play) +* `#14882 `__: DEP: Deprecate aliases of builtin types in python 3.7+ +* `#15037 `__: BUG: ``np.resize`` negative shape and subclasses edge case fixes +* `#15121 `__: ENH: random: Add the method ``permuted`` to Generator. +* `#15162 `__: BUG,MAINT: Fix issues with non-reduce broadcasting axes +* `#15471 `__: BUG: Ensure PyArray_FromScalar always returns the requested dtype +* `#15507 `__: NEP 42: Technical decisions for new DTypes +* `#15508 `__: API: Create Preliminary DTypeMeta class and np.dtype subclasses +* `#15551 `__: DOC: Simd optimization documentation +* `#15604 `__: MAINT: Avoid exception in NpzFile destructor if constructor raises... +* `#15666 `__: ENH: Improved ``__str__`` for polynomials +* `#15759 `__: BUILD: Remove Accelerate support +* `#15791 `__: [DOC] Added tutorial about the numpy.ma module. +* `#15852 `__: ENH: Add where argument to np.mean +* `#15886 `__: DEP: Deprecate passing shape=None to mean shape=() +* `#15900 `__: DEP: Ensure indexing errors will be raised even on empty results +* `#15997 `__: ENH: improve printing of arrays with multi-line reprs +* `#16056 `__: DEP: Deprecate inexact matches for mode, searchside +* `#16130 `__: DOC: Correct documentation of ``__array__`` when used as output... +* `#16134 `__: ENH: Implement concatenate dtype and casting keyword arguments +* `#16156 `__: DEP: Deprecate ``numpy.dual``. +* `#16161 `__: BUG: Potential fix for divmod(1.0, 0.0) to raise divbyzero and... +* `#16167 `__: DOC: Increase guidance and detail of np.polynomial docstring +* `#16174 `__: DOC: Add transition note to all lib/poly functions +* `#16200 `__: ENH: Rewrite of array-coercion to support new dtypes +* `#16205 `__: ENH: Add ``full_output`` argument to ``f2py.compile``. +* `#16207 `__: DOC: Add PyArray_ContiguousFromObject C docs +* `#16232 `__: DEP: Deprecate ufunc.outer with matrix inputs +* `#16237 `__: MAINT: precompute ``log(2.0 * M_PI)`` in ``random_loggam`` +* `#16238 `__: MAINT: Unify cached (C-level static) imports +* `#16239 `__: BUG,DOC: Allow attach docs twice but error if wrong +* `#16242 `__: BUG: Fix default fallback in genfromtxt +* `#16247 `__: ENH:Umath Replace raw SIMD of unary float point(32-64) with NPYV... +* `#16248 `__: MRG, ENH: added edge keyword argument to digitize +* `#16253 `__: DOC: Clarify tiny/xmin in finfo and machar +* `#16254 `__: MAINT: Chain exceptions in generate_umath.py +* `#16257 `__: DOC: Update the f2py section of the "Using Python as Glue" page. +* `#16260 `__: DOC: Improve ``rec.array`` function documentation +* `#16266 `__: ENH: include dt64/td64 isinstance checks in ``__init__.pxd`` +* `#16267 `__: DOC: Clarifications for np.std +* `#16273 `__: BUG: Order percentile monotonically +* `#16274 `__: MAINT: cleanups to quantile +* `#16275 `__: REL: Update master after 1.19.x branch. +* `#16276 `__: BUG: Ensure out argument is returned by identity for 0d arrays +* `#16278 `__: DOC: Clarifications for ``np.var``. +* `#16283 `__: DOC: Add a note about performance of isclose compared to math.isclose +* `#16284 `__: MAINT: Clean up the implementation of quantile +* `#16285 `__: MAINT: Bump hypothesis from 5.12.0 to 5.14.0 +* `#16288 `__: BLD: Avoid "visibility attribute not supported" warning +* `#16291 `__: DOC: Improve "tobytes" docstring. +* `#16292 `__: BUG: Fix tools/download-wheels.py. +* `#16295 `__: BUG: Require Python >= 3.6 in setup.py +* `#16296 `__: DOC: Fix malformed docstrings in ma. +* `#16297 `__: ENH: Optimize Cpu feature detect in X86, fix for GCC on macOS +* `#16298 `__: BUG: np.info does not show keyword-only arguments +* `#16300 `__: DOC: Fix bad reference in ``numpy.ma`` +* `#16304 `__: TST, MAINT: Fix detecting and testing armhf features +* `#16305 `__: DOC: Fix packbits documentation rendering, +* `#16306 `__: DOC: Fix troubleshooting code snippet when env vars are empty +* `#16308 `__: BUG: relpath fails for different drives on windows +* `#16311 `__: DOC: Fix ``np.ma.core.doc_note`` +* `#16316 `__: MAINT: Bump numpydoc version +* `#16318 `__: MAINT: Stop Using PyEval_Call* and simplify some uses +* `#16321 `__: ENH: Improve the ARM cpu feature detection by parsing /proc/cpuinfo +* `#16323 `__: DOC: Reconstruct Testing Guideline. +* `#16327 `__: BUG: Don't segfault on bad __len__ when assigning. +* `#16329 `__: MAINT: Cleanup 'tools/download-wheels.py' +* `#16332 `__: DOC: link np.interp to SciPy's interpolation functions (closes... +* `#16333 `__: DOC: Fix spelling typo - homogenous to homogeneous. (#16324) +* `#16334 `__: ENH: Use AVX-512 for np.isnan, np.infinite, np.isinf and np.signbit +* `#16336 `__: BUG: Fix refcounting in add_newdoc +* `#16337 `__: CI: Create a link for the circleCI artifact +* `#16346 `__: MAINT: Remove f-strings in setup.py. +* `#16348 `__: BUG: Fix dtype leak in ``PyArray_FromAny`` error path +* `#16349 `__: BUG: Indentation for docstrings +* `#16350 `__: BUG: Set readonly flag in array interface +* `#16351 `__: BUG: Fix small leaks in error path and ``empty_like`` with shape +* `#16362 `__: MAINT: Streamline download-wheels. +* `#16365 `__: DOC: Fix an obvious mistake in a message printed in doc/Makefile. +* `#16367 `__: MAINT: Bump cython from 0.29.17 to 0.29.19 +* `#16368 `__: MAINT: Bump hypothesis from 5.14.0 to 5.15.1 +* `#16369 `__: MAINT: Bump pytest-cov from 2.8.1 to 2.9.0 +* `#16371 `__: ENH: Use AVX-512 for np.frexp and np.ldexp +* `#16373 `__: MAINT, DOC: add index for user docs. +* `#16375 `__: ENH: ARM Neon implementation with intrinsic for np.argmax. +* `#16385 `__: DOC: Tighten howto-docs guide #16259 +* `#16387 `__: MAINT: Make ctypes optional on Windows +* `#16389 `__: ENH: Hardcode buffer handling for simple scalars +* `#16392 `__: MAINT: Stop uploading wheels to Rackspace. +* `#16393 `__: MAINT: Use a raw string for the fromstring docstring. +* `#16395 `__: ENH: Validate and disable CPU features in runtime +* `#16397 `__: ENH: Implement the NumPy C SIMD vectorization interface +* `#16404 `__: DOC,BLD: Update make dist html target. +* `#16408 `__: DOC,BLD: Update sphinx conf to use xelatex. +* `#16409 `__: TST, CI: turn on codecov patch diffs +* `#16411 `__: BUG: endpoints of array returned by geomspace() should match... +* `#16417 `__: MAINT: support python 3.10 +* `#16418 `__: MAINT: Chain some exceptions. +* `#16420 `__: DOC: Improve intersect1d docstring +* `#16422 `__: DOC: Update assert_warns parameter list +* `#16423 `__: TST: Simplify assert_warns in test_io.py +* `#16427 `__: DOC: make NEP 18 status Final +* `#16428 `__: DOC: Add style guide to howto_document +* `#16430 `__: DOC: NEP for C style guide +* `#16433 `__: DOC: Fix description of dtype default in linspace +* `#16435 `__: BUG: Add extern to PyArrayDTypeMeta_Type declaration +* `#16436 `__: DOC: Add a reference into NEP 29, +* `#16438 `__: MAINT: Catch remaining cases of Py_SIZE and Py_TYPE as lvalues +* `#16442 `__: ENH: Fix deprecated warn for Intel/Apple/Clang Compiler +* `#16444 `__: DOC: make clearer that sinc is normalized by a factor pi +* `#16445 `__: DOC: update roadmap +* `#16446 `__: BUG: fixes einsum output order with optimization (#14615) +* `#16447 `__: DOC: add a "make show" command to doc/Makefile +* `#16450 `__: DOC: Add a NEP link to all neps. +* `#16452 `__: DOC,ENH: extend error message when Accelerate is detected +* `#16454 `__: TST: Add tests for PyArray_IntpConverter +* `#16463 `__: DOC: Improve assert_warns docstring with example +* `#16464 `__: MAINT: Bump hypothesis from 5.15.1 to 5.16.0 +* `#16465 `__: DOC: Fix development_workflow links +* `#16468 `__: BUG: fix GCC 10 major version comparison +* `#16471 `__: BLD: install mingw32 v7.3.0 for win32 +* `#16472 `__: DOC: Fixes for 18 broken links +* `#16474 `__: MAINT: use zip instead of range in piecewise +* `#16476 `__: ENH: add ``norm=forward,backward`` to numpy.fft functions +* `#16482 `__: SIMD: Optimize the performace of np.packbits in ARM-based machine. +* `#16485 `__: BUG: Fix result when a gufunc output broadcasts the inputs. +* `#16500 `__: DOC: Point Contributing page to new NEP 45 +* `#16501 `__: MAINT: make Py_SET_SIZE and Py_SET_TYPE macros a bit safer +* `#16503 `__: BUG:random: Error when ``size`` is smaller than broadcast input... +* `#16504 `__: DOC: Correct MV Normal sig +* `#16505 `__: BUG: raise IEEE exception on AIX +* `#16506 `__: DOC: only single-polynomial fitting in np.polynomial.Polynomial.fit() +* `#16510 `__: DOC: Minor rounding correction in Generator.binomial +* `#16514 `__: STY: trivial doc style fix in NEP 45. +* `#16515 `__: ENH: add type stubs from numpy-stubs +* `#16519 `__: BUG: f2py: make callbacks threadsafe +* `#16520 `__: STY: f2py: replace \t by whitespace for readability +* `#16522 `__: MAINT:ARMHF Fix detecting feature groups NEON_HALF and NEON_VFPV4 +* `#16523 `__: MAINT: Improve buffer speed +* `#16524 `__: MAINT: f2py: move thread-local declaration definition to common... +* `#16529 `__: BUG: Fix cython warning in random/_common.pyx. +* `#16530 `__: MAINT: Bump pytest from 5.4.2 to 5.4.3 +* `#16532 `__: BUG: Remove non-threadsafe sigint handling from fft calculation +* `#16540 `__: SIMD: SSE2 intrinsic implementation for float64 input of np.enisum +* `#16551 `__: BUG: Ensure SeedSequence 0-padding does not collide with spawn... +* `#16554 `__: DEP: Remove deprecated numeric types and deprecate remaining +* `#16555 `__: CI: drop win32 3.7, 3.6 builds +* `#16556 `__: MAINT: simplifying annotations for np.core.from_numeric +* `#16558 `__: ENH: make typing module available at runtime +* `#16570 `__: ENH: Throw TypeError on operator concat on Numpy Arrays +* `#16571 `__: TST: Add new tests for array coercion +* `#16572 `__: BUG: fix sin/cos bug when input is strided array +* `#16574 `__: MAINT: fix name of first parameter to dtype constructor in type... +* `#16581 `__: DOC: Added an example for np.transpose(4d_array) +* `#16583 `__: MAINT: changed np.generic arguments to positional-only +* `#16589 `__: MAINT: Remove nickname from polynomial classes. +* `#16590 `__: DOC: Clarify dtype default for logspace and geomspace +* `#16591 `__: DOC: Disallow complex args in arange +* `#16592 `__: BUG: Raise TypeError for float->timedelta promotion +* `#16594 `__: ENH: Add ``__f2py_numpy_version__`` attribute to Fortran modules. +* `#16596 `__: BUG: Fix reference count leak in mapping.c +* `#16601 `__: MAINT: Move and improve ``test_ignore_nan_ulperror``. +* `#16603 `__: DOC: make addition of types a "new feature" in release notes +* `#16605 `__: MAINT: Avx512 intrinsics implementation for float64 input np.log +* `#16606 `__: MAINT: Bump pytest-cov from 2.9.0 to 2.10.0 +* `#16607 `__: MAINT: Bump hypothesis from 5.16.0 to 5.16.1 +* `#16613 `__: MAINT: bump mypy version to 0.780 +* `#16617 `__: BLD: Openblas 0.3.10 +* `#16618 `__: ENH: add annotation for abs +* `#16619 `__: BLD: check if std=c99 is really required +* `#16620 `__: MAINT, CI: disable Shippable cache +* `#16621 `__: BENCH: Expand array-creation benchmarks +* `#16622 `__: MAINT: Implemented two dtype-related TODO's +* `#16623 `__: BUG: Initialize stop-reading in array_from_text +* `#16627 `__: DOC: Updated documentation for numpy.squeeze +* `#16629 `__: ENH: add tool to find functions missing types +* `#16630 `__: ENH,BUG:distutils Remove the origins from the implied features +* `#16633 `__: MAINT: lib: Some code clean up in loadtxt +* `#16635 `__: BENCH: remove obsolete goal_time param +* `#16639 `__: BUG: Fix uint->timedelta promotion to raise TypeError +* `#16642 `__: MAINT: Replace ``PyUString_GET_SIZE`` with ``PyUnicode_GetLength``. +* `#16643 `__: REL: Fix outdated docs link +* `#16644 `__: MAINT: Improve performance of np.full +* `#16646 `__: TST: add a static typing test for memoryviews as ArrayLikes +* `#16647 `__: ENH: Added annotations to 8 functions from np.core.fromnumeric +* `#16648 `__: REL: Update master after 1.19.0 release. +* `#16650 `__: ENH: Allow genfromtxt to unpack structured arrays +* `#16651 `__: MAINT: Prefer generator expressions over list comprehensions... +* `#16653 `__: DOC: cross-reference numpy.dot and numpy.linalg.multi_dot +* `#16658 `__: MAINT: Bump hypothesis from 5.16.1 to 5.16.3 +* `#16659 `__: MAINT: Bump mypy from 0.780 to 0.781 +* `#16664 `__: DOC: Add lib.format.open_memmap to autosummary. +* `#16666 `__: BUG: Fix bug in AVX complex absolute while processing array of... +* `#16669 `__: MAINT: remove blacklist/whitelist terms +* `#16671 `__: DOC: Simplify and update git setup page +* `#16674 `__: TST: Add extra debugging information to CPU features detection +* `#16675 `__: ENH: Add support for file like objects to np.core.records.fromfile +* `#16683 `__: DOC: updated gcc minimum recommend version to build from source +* `#16684 `__: MAINT: Allow None to be passed to certain generic subclasses +* `#16690 `__: DOC: fixed docstring for descr_to_dtype +* `#16691 `__: DOC: Remove "matrix" from ``triu`` docstring. +* `#16696 `__: MAINT: add py.typed sentinel to package manifest +* `#16699 `__: MAINT: Fixup quantile tests to not use ``np.float`` +* `#16702 `__: BLD: Add CPU entry for Emscripten / WebAssembly +* `#16704 `__: TST: Disable Python 3.9-dev testing. +* `#16706 `__: DOC: Add instruction about stable symlink +* `#16708 `__: MAINT: Disable use_hugepages in case of ValueError +* `#16709 `__: DOC: Add dep directive to alen docstring. +* `#16710 `__: ENH, BLD: Add RPATH support for AIX +* `#16718 `__: DOC: fix typo +* `#16720 `__: BUG: Fix PyArray_SearchSorted signature. +* `#16723 `__: NEP: Initial draft for NEP 43 for extensible ufuncs +* `#16729 `__: ENH: Add annotations to the last 8 functions in numpy.core.fromnumeric +* `#16730 `__: ENH: Use f90 compiler specified in f2py command line args for... +* `#16731 `__: DOC: reword random c-api introduction, cython is documented in... +* `#16735 `__: DOC: Tweak a sentence about broadcasting. +* `#16736 `__: DOC: Prepend ``ma.`` to references in ``numpy.ma`` +* `#16738 `__: DOC: Remove redundant word +* `#16742 `__: DOC: add unique() to See Also of repeat() +* `#16743 `__: DOC: add example to unique() and make connection to repeat() +* `#16747 `__: MAINT: Chaining exceptions in numpy/core/_internal.py +* `#16752 `__: BLD: add manylinux1 OpenBlAS 0.3.10 hashes and test for them +* `#16757 `__: DOC: Add Matti Picus to steering council page +* `#16759 `__: ENH: make dtype generic over scalar type +* `#16760 `__: DOC: Added a section in the 'Iterating over arrays' doc page... +* `#16761 `__: MAINT: Tidy exception chaining in _datasource.py +* `#16762 `__: MAINT: Fixes for deprecated functions in scalartypes.c.src +* `#16764 `__: MAINT: Bump mypy from 0.781 to 0.782 +* `#16765 `__: MAINT: Bump hypothesis from 5.16.3 to 5.19.0 +* `#16767 `__: ENH: Update NumPy logos +* `#16770 `__: MAINT: Remove unneeded call to PyUnicode_READY +* `#16771 `__: MAINT: Fix deprecated functions in scalarapi.c +* `#16775 `__: DOC: switch to logo with text +* `#16777 `__: BUG: Added missing return after raising error in methods.c +* `#16778 `__: NEP: Update NEP 42 to note the issue of circular references +* `#16782 `__: ENH, TST: Bring the NumPy C SIMD vectorization interface "NPYV"... +* `#16786 `__: BENCH: Add basic benchmarks for scalar indexing and assignment +* `#16789 `__: BUG: fix decode error when building and get rid of warn +* `#16792 `__: DOC: Minor RST formatting. +* `#16793 `__: BLD, MAINT: update cython to 0.29.21 +* `#16794 `__: TST: Upgrade to Python 3.8 for DEBUG testing. +* `#16798 `__: DOC: Fix RST/numpydoc standard. +* `#16800 `__: MAINT: Move typing tests +* `#16802 `__: MAINT: Explicitly disallow object user dtypes +* `#16805 `__: DOC: add example to corrcoef function +* `#16806 `__: DOC: adding docs on passing dimensions as tuple to ndindex +* `#16807 `__: BUG, MAINT: Remove overzealous automatic RST link +* `#16811 `__: DOC: Add explanation of 'K' and 'A' layout options to 'asarray*'... +* `#16814 `__: DOC: Add a reST label to /user/building.rst +* `#16815 `__: BUG: fix mgrid output for lower precision float inputs +* `#16816 `__: BLD: temporarily disable OpenBLAS hash checks +* `#16817 `__: BUG: Do not inherit flags from the structured part of a union... +* `#16819 `__: DOC: replace dec.slow with pytest.mark.slow +* `#16820 `__: MAINT: Make void scalar to array creation copy when dtype is... +* `#16821 `__: DOC: fix inconsistent parameter name in np.ndindex docstring +* `#16822 `__: MAINT: setuptools 49.2.0 emits a warning, avoid it +* `#16824 `__: DOC: add examples to random number generator pages +* `#16826 `__: DOC: describe ufunc copy behavior when input and output overlap +* `#16827 `__: MAINT: Fix ``runtest.py`` warning. +* `#16829 `__: DOC,BLD: Add pandas to doc_requirements.txt +* `#16831 `__: MAINT: fix sphinx deprecation +* `#16834 `__: Avoid using uninitialized bytes in getlimits.py. +* `#16835 `__: DOC: Explaining why datetime64 doesn't work for allclose + isclose +* `#16836 `__: DOC: improve SIMD features tables +* `#16837 `__: BLD: update openblas hashes, re-enable check +* `#16838 `__: MAINT: Remove code that will never run +* `#16840 `__: MAINT: Bump hypothesis from 5.19.0 to 5.19.1 +* `#16841 `__: BUG: linspace should round towards -infinity +* `#16845 `__: TST: Disable shippable until we can fix it. +* `#16847 `__: MAINT: Remove Duplicated Code (function extract rmap) +* `#16848 `__: MAINT: Remove Duplicated Code +* `#16849 `__: MAINT: Change for loop (range -> for each) +* `#16850 `__: DEP: Deprecate NumPy object scalars +* `#16854 `__: DOC: clarify whats required for new features see #13924 +* `#16857 `__: MAINT: fix new compiler warnings on clang +* `#16858 `__: BUG: fix the search dir of dispatch-able sources +* `#16860 `__: MAINT: Remove deprecated python function 'file()' +* `#16868 `__: BUG: Validate output size in bin- and multinomial +* `#16870 `__: BLD, MAINT: Pin setuptools +* `#16871 `__: BUG: Update compiler check for AVX-512F +* `#16874 `__: TST, MAINT: fix the test for ``np.ones`` +* `#16878 `__: DOC: edit to the documentation of lib/polynomial.py/polyfit +* `#16879 `__: MAINT: Configure hypothesis in ``np.test()`` for determinism,... +* `#16882 `__: BLD: Remove unused pip install +* `#16883 `__: BUG,DOC: Fix bad MPL kwarg in docs +* `#16886 `__: DOC: Fix types including curly braces +* `#16887 `__: DOC: Remove the links for ``True`` and ``False`` +* `#16888 `__: ENH: Integrate the new CPU dispatcher with umath generator +* `#16890 `__: TST, BUG: Re-raise MemoryError exception in test_large_zip's... +* `#16894 `__: DOC: Fix wrong markups in ``arrays.dtypes`` +* `#16896 `__: DOC: Remove links for C codes +* `#16897 `__: DOC: Fix the declarations of C fuctions +* `#16899 `__: MNT: also use Py_SET_REFCNT instead of Py_REFCNT +* `#16900 `__: MAINT: Chaining exceptions in numpy/__init__.py +* `#16907 `__: DOC: update val to be scalar or array like optional closes #16901 +* `#16910 `__: MAINT: Bump hypothesis from 5.19.1 to 5.20.2 +* `#16911 `__: ENH: Speed up trim_zeros +* `#16914 `__: BUG: Fix string/bytes to complex assignment +* `#16917 `__: DOC: Add correctness vs strictness consideration for np.dtype +* `#16919 `__: DOC: Add ufunc docstring to generated docs. +* `#16925 `__: REL: Update master after 1.19.1 release. +* `#16931 `__: Revert "Merge pull request #16248 from alexrockhill/edge" +* `#16935 `__: ENH: implement NEP-35's ``like=`` argument +* `#16936 `__: BUG: Fix memory leak of buffer-info cache due to relaxed strides +* `#16938 `__: ENH,API: Store exported buffer info on the array +* `#16940 `__: BLD: update OpenBLAS build +* `#16941 `__: BUG: Allow array-like types to be coerced as object array elements +* `#16943 `__: DEP: Deprecate size-one ragged array coercion +* `#16944 `__: Change the name of the folder "icons" to "logo". +* `#16949 `__: ENH: enable colors for ``runtests.py --ipython`` +* `#16950 `__: DOC: Clarify input to irfft/irfft2/irfftn +* `#16952 `__: MAINT: Bump hypothesis from 5.20.2 to 5.23.2 +* `#16953 `__: update numpy/lib/arraypad.py with appropriate chain exception +* `#16957 `__: MAINT: Use arm64 instead of aarch64 on travisCI. +* `#16962 `__: MAINT: Chain exception in ``distutils/fcompiler/environment.py``. +* `#16966 `__: MAINT: Added the ``order`` parameter to ``np.array()`` +* `#16969 `__: ENH: Add Neon SIMD implementations for add, sub, mul, and div +* `#16973 `__: DOC: Fixed typo in lib/recfunctions.py +* `#16974 `__: TST: Add pypy win32 CI testing. +* `#16982 `__: ENH: Increase the use of ``Literal`` types +* `#16986 `__: ENH: Add NumPy declarations to be used by Cython 3.0+ +* `#16988 `__: DOC: Add the new NumPy logo to Sphinx pages +* `#16991 `__: MAINT: Bump hypothesis from 5.23.2 to 5.23.9 +* `#16992 `__: MAINT: Bump pytest from 5.4.3 to 6.0.1 +* `#16993 `__: BLD: pin setuptools < 49.2.0 +* `#16996 `__: DOC: Revise glossary page +* `#17002 `__: DOC: clip() allows arguments. +* `#17009 `__: NEP: Updated NEP-35 with keyword-only instruction +* `#17010 `__: BUG: Raise correct errors in boolean indexing fast path +* `#17013 `__: MAINT: Simplify scalar power +* `#17014 `__: MAINT: Improve error handling in umathmodule setup +* `#17022 `__: DOC: Fix non-matching pronoun. +* `#17028 `__: DOC: Disclaimer for FFT library +* `#17029 `__: MAINT: Add error return to all casting functionality and NpyIter +* `#17033 `__: BUG: fix a compile and a test warning +* `#17036 `__: DOC: Clarify that ``np.char`` comparison functions always return... +* `#17039 `__: DOC: Use a less ambiguous example for array_split +* `#17041 `__: MAINT: Bump hypothesis from 5.23.9 to 5.23.12 +* `#17048 `__: STY: core._internal style fixups +* `#17050 `__: MAINT: Remove _EXTRAFLAGS variable +* `#17050 `__: MAINT: change ``for line in open()`` to ``with open() as f`` +* `#17052 `__: MAINT: Delete obsolete conversion to list +* `#17053 `__: BUG: fix typo in polydiv that prevented promotion to poly1d +* `#17055 `__: MAINT: Replace lambda function by list comprehension +* `#17058 `__: MAINT: Revert boolean casting back to elementwise comparisons... +* `#17059 `__: BUG: fix pickling of arrays larger than 2GiB +* `#17062 `__: API, BUG: Raise error on complex input to i0 +* `#17063 `__: MAINT: Remove obsolete conversion to set +* `#17067 `__: DEP: lib: Remove the deprecated financial functions. +* `#17068 `__: MAINT, BUG: Remove uses of PyString_FromString. +* `#17074 `__: DOC: use the pydata_sphinx_theme +* `#17078 `__: DOC: Fixes duplication of toctree content (Closes #17077) +* `#17091 `__: MAINT: Bump pytest-cov from 2.10.0 to 2.10.1 +* `#17092 `__: MAINT: Bump hypothesis from 5.23.12 to 5.26.0 +* `#17093 `__: NEP: Adjust NEP-35 to make it more user-accessible +* `#17104 `__: ENH: Add placeholder stubs for all sub-modules +* `#17109 `__: MAINT: Split einsum into multiple files +* `#17112 `__: BUG: Handle errors from the PyCapsule API +* `#17115 `__: DOC: Fix spacing in vectorize doc +* `#17116 `__: API: Remove ``np.ctypeslib.ctypes_load_library`` +* `#17119 `__: DOC: make spacing consistent in NEP 41 bullet points +* `#17121 `__: BUG: core: fix ilp64 blas dot/vdot/... for strides > int32 max +* `#17123 `__: ENH: allow running mypy through runtests.py +* `#17127 `__: MAINT: Remove duplicated symbols from link step +* `#17129 `__: BLD: Check for reduce intrinsics and AVX512BW mask operations +* `#17132 `__: MAINT: Chain some exceptions in arraysetops. +* `#17133 `__: MAINT: Chain ValueError in ma.timer_comparison +* `#17137 `__: API,MAINT: Rewrite promotion using common DType and common instance +* `#17141 `__: MAINT: Make arrayprint str and repr the ndarray defaults. +* `#17142 `__: DOC: NEP-42: Fix a few typos. +* `#17143 `__: MAINT: Change handling of the expired financial functions. +* `#17144 `__: ENH: Add annotations to 3 functions in ``np.core.function_base`` +* `#17145 `__: MAINT, BUG: Replace uses of PyString_AsString. +* `#17146 `__: MAINT: ``Replace PyUString_*`` by ``PyUnicode_*`` equivalents. +* `#17149 `__: MAINT: Replace PyInt macros with their PyLong replacement +* `#17150 `__: ENH: Add support for the abstract scalars to cython code +* `#17151 `__: BUG: Fix incorrect cython definition of npy_cfloat +* `#17152 `__: MAINT: Clean up some ``Npy_`` vs ``Py_`` macro usage +* `#17154 `__: DOC: Remove references to PyCObject +* `#17159 `__: DOC: Update numpy4matlab +* `#17160 `__: Clean up some more bytes vs unicode handling +* `#17161 `__: BUG: Remove Void special case for "safe casting" +* `#17163 `__: MAINT: Remove redundant headers +* `#17164 `__: MAINT: Remove NPY_COPY_PYOBJECT_PTR +* `#17167 `__: BLD: Merge the npysort library into multiarray +* `#17168 `__: TST: Add tests mapping out the rules for metadata in promotion +* `#17171 `__: BUG: revert trim_zeros changes from gh-16911 +* `#17172 `__: ENH: Make ``np.complexfloating`` generic w.r.t. ``np.floating`` +* `#17176 `__: MAINT/ENH: datetime: remove calls to PyUnicode_AsASCIIString,... +* `#17180 `__: ENH: Added missing methods to ``np.flatiter`` +* `#17181 `__: DOC: Correct error in description of ndarray.base +* `#17182 `__: DOC: Document ``dtype.metadata`` +* `#17186 `__: MAINT: Use utf8 strings in more of datetime +* `#17188 `__: MAINT: Add placeholder stubs for ``ndarray`` and ``generic`` +* `#17191 `__: MAINT: Bump hypothesis from 5.26.0 to 5.30.0 +* `#17193 `__: MAINT: Remove some callers of functions in numpy.compat +* `#17195 `__: ENH: Make the window functions exactly symmetric +* `#17197 `__: MAINT: Improve error handling in npy_cpu_init +* `#17199 `__: DOC: Fix the documented signatures of four ``ufunc`` methods +* `#17201 `__: MAINT: Make the ``NPY_CPU_DISPATCH_CALL`` macros expressions not... +* `#17204 `__: DOC: Fixed headings for tutorials so they appear at new theme... +* `#17210 `__: DOC: Canonical_urls +* `#17214 `__: MAINT: Fix various issues with the ``np.generic`` annotations +* `#17215 `__: DOC: Use official MATLAB spelling in numpy-for-matlab-users.rst +* `#17219 `__: BLD: enabled negation of library choices in NPY_*_ORDER +* `#17220 `__: BUG, DOC: comment out metadata added via javascript +* `#17222 `__: MAINT, DOC: move informational files from numpy.doc.*.py to their... +* `#17223 `__: MAINT: use sysconfig not distutils.sysconfig where possible +* `#17225 `__: BUG: Fix dimension discovery of within array ragged cases +* `#17227 `__: DOC: Added templates for different types of issues. +* `#17233 `__: DEP: Deprecated ndindex.ndincr +* `#17235 `__: MAINT: Remove old PY_VERSION_HEX and sys.version_info code +* `#17237 `__: BUG: Avoid using ``np.random`` in typing tests. +* `#17238 `__: DOC: Use SPDX license expressions with correct license +* `#17239 `__: DOC: Fix link quick-start in old random API functions +* `#17240 `__: MAINT: added exception chaining in shape_base.py +* `#17241 `__: MAINT: ``__array_interface__`` data address cannot be bytes +* `#17242 `__: MAINT: Run slow CI jobs earlier so builds finishes sooner +* `#17247 `__: ENH: Add tool to help speed up Travis CI +* `#17250 `__: DOC: Fix docstring cross-referencing +* `#17252 `__: DOC: Added a PR "Reviewer guidelines" document. +* `#17257 `__: DOC: work around a bug in the new theme +* `#17258 `__: SIMD: add fused multiply subtract/add intrinics for all supported... +* `#17259 `__: MAINT: Bump hypothesis from 5.30.0 to 5.33.0 +* `#17260 `__: MAINT: Bump pydata-sphinx-theme from 0.3.2 to 0.4.0 +* `#17263 `__: DOC: add new glossary terms +* `#17264 `__: DOC: remove some glosssary terms +* `#17267 `__: TST: Fix the path to ``mypy.ini`` in ``runtests.py`` +* `#17268 `__: BUG: sysconfig attributes/distutils issue +* `#17273 `__: ENH: Annotate the arithmetic operations of ``ndarray`` and ``generic`` +* `#17278 `__: MAINT: Merge together index page content into a single file +* `#17279 `__: DOC: Fix a typo in shape_base. +* `#17284 `__: ENH: Pass optimizations arguments to asv build +* `#17285 `__: DEP: Change the financial name access warning to DeprecationWarning +* `#17288 `__: REL: Update master after 1.19.2 release. +* `#17289 `__: MAINT: Simplify ufunc pickling +* `#17290 `__: MAINT: Cleanup some pystring macros +* `#17292 `__: MAINT: Replace remaining PyString macros. +* `#17293 `__: MAINT: Replace PyUString_Check by PyUnicode_Check. +* `#17295 `__: BUG,ENH: fix pickling user-scalars by allowing non-format buffer... +* `#17296 `__: MAINT: Replace some ``pyint_*`` macros defined in ``npy_3kcompat``. +* `#17297 `__: BLD: set upper versions for build dependencies +* `#17299 `__: MAINT: (dtype-transfer) make copyswapn and legacy cast wrapper... +* `#17300 `__: MAINT: Replace PyBaseString_Check by PyUnicode_Check +* `#17302 `__: MAINT: Replace a couple of missed npy_3kcompat macros +* `#17304 `__: BUILD: pin pygments to 2.6.1, 2.7.0 breaks custom NumPyC lexer +* `#17307 `__: MAINT: Bump hypothesis from 5.33.0 to 5.35.1 +* `#17308 `__: MAINT: Bump pytest from 6.0.1 to 6.0.2 +* `#17309 `__: MAINT: Move the ``fromnumeric`` annotations to their own stub file +* `#17312 `__: MAINT: Syntax-highlight .src files on github +* `#17313 `__: MAINT: Mark vendored/generated files in .gitattributes +* `#17315 `__: MAINT: Cleanup f2py/cfuncs.py +* `#17319 `__: BUG: Set deprecated fields to null in PyArray_InitArrFuncs +* `#17320 `__: BUG: allow registration of hard-coded structured dtypes +* `#17326 `__: ENH: Add annotations for five array construction functions +* `#17329 `__: DOC: Fix incorrect ``.. deprecated::`` syntax that led to this... +* `#17330 `__: DOC: improve ``issubdtype`` and scalar type docs +* `#17331 `__: DOC: Remove the tables of scalar types, and use ``..autoclass``... +* `#17332 `__: DOC, BLD: update lexer highlighting and make numpydocs a regular... +* `#17334 `__: MAINT: Chaining exceptions in npyio.py +* `#17337 `__: NEP: Regenerate table in NEP 29 (add numpy 1.18 and 1.19 to list) +* `#17338 `__: DOC: Fix syntax errors in docstrings for versionchanged, versionadded +* `#17340 `__: SIMD: Add partial/non-contig load and store intrinsics for 32/64-bit +* `#17344 `__: ENH, BLD: Support for the NVIDIA HPC SDK nvfortran compiler +* `#17346 `__: BLD,BUG: Fix a macOS build failure when ``NPY_BLAS_ORDER=""`` +* `#17350 `__: DEV: Add PR prefix labeler and numpy prefix mapping +* `#17352 `__: DOC: Guide to writing how-tos +* `#17353 `__: DOC: How-to guide for I/O +* `#17354 `__: DOC: clarify residuals return param +* `#17356 `__: ENH: Add Npy__PyLong_AsInt function. +* `#17357 `__: MAINT: Bump hypothesis from 5.35.1 to 5.35.3 +* `#17364 `__: MAINT: Finish replacing PyInt_Check +* `#17369 `__: DOC: distutils: Remove an obsolete paragraph. +* `#17370 `__: NEP: Edit nep-0042 for more clarity +* `#17372 `__: ENH: Add annotations for remaining ``ndarray`` / ``generic`` non-magic... +* `#17373 `__: BUG: Fixes module data docstrings. +* `#17375 `__: DOC: Fix default_rng docstring +* `#17377 `__: BUG: ensure _UFuncNoLoopError can be pickled +* `#17380 `__: Minor grammatical correction in quickstart doc. +* `#17382 `__: DOC: NumPy restyling for pydata theme +* `#17383 `__: MAINT: Fix docstring for np.matmul +* `#17386 `__: MAINT: Bump hypothesis from 5.35.3 to 5.36.1 +* `#17388 `__: MAINT: Remove old debug print statement. +* `#17391 `__: DOC: Replace "About NumPy" with "Document conventions" +* `#17392 `__: DOC: Update info on doc style rules +* `#17393 `__: BUG: Fix default void, datetime, and timedelta in array coercion +* `#17394 `__: ENH: Implement sliding window +* `#17396 `__: MAINT: Replace append_metastr_to_string function. +* `#17399 `__: BLD: Fixed ARGOUTVIEWM memory deallocation. Closes #17398. +* `#17400 `__: DOC: rm incorrect alias from recarray user article. +* `#17401 `__: MAINT: Rewrite can-cast logic in terms of NEP 42 +* `#17402 `__: DOC: Add arraysetops to an autosummary +* `#17404 `__: MAINT: Replace PyUString_ConcatAndDel in nditer_constr.c. +* `#17405 `__: MAINT: Replace PyUString_ConcatAndDel in mapping.c. +* `#17406 `__: ENH: Replace the module-level ``__getattr__`` with explicit type... +* `#17407 `__: DOC: in PR template, set expectations for PR review timeline +* `#17409 `__: MAINT: Cleanup remaining PyUString_ConcatAndDel use. +* `#17410 `__: API: Special case how numpy scalars are coerced to signed integer +* `#17411 `__: TST: Mark the typing tests as slow +* `#17412 `__: DOC: Fix a parameter type in the ``putmask`` docs +* `#17418 `__: DOC: adding operational form documentation for array ops +* `#17419 `__: DEP: Deprecate coercion to subarray dtypes +* `#17421 `__: BUG: Fix memory leak in array-coercion error paths +* `#17422 `__: MAINT: chains nested try-except in numpy/ma/core.py +* `#17423 `__: DOC: Remove bogus reference to _a_ +* `#17424 `__: DOC: Fix formatting issues in description of .c.src files +* `#17427 `__: NEP: nep-0029 typo correction +* `#17429 `__: MAINT: Move aliases for common scalar unions to ``numpy.typing`` +* `#17430 `__: BUG: Fix memoryleaks related to NEP 37 function overrides +* `#17431 `__: DOC: Fix the links for ``Ellipsis`` +* `#17432 `__: DOC: add references to einops and opt_einsum +* `#17433 `__: MAINT : Disable 32 bit PyPy CI testing on Windows. +* `#17435 `__: DOC: Security warning for issues template +* `#17436 `__: DOC: Fix "Feature request" spelling in issue templates +* `#17438 `__: MAINT: Chaining exception in numpy\numpy\ma\mrecords.py +* `#17440 `__: DOC: Cleaner template for PRs +* `#17442 `__: MAINT: fix exception chaining in format.py +* `#17443 `__: ENH: Warn on unsupported Python 3.10+ +* `#17444 `__: ENH: Add ``Typing :: Typed`` to the PyPi classifier +* `#17445 `__: DOC: Fix the references for macros +* `#17447 `__: NEP: update NEP 42 with discussion of type hinting applications +* `#17448 `__: DOC: Remove CoC pages from Sphinx +* `#17453 `__: MAINT: Chain exceptions in "_polybase.py" +* `#17455 `__: MAINT: Bump hypothesis from 5.36.1 to 5.37.0 +* `#17456 `__: ENH: add dtype option to numpy.lib.function_base.cov and corrcoef +* `#17457 `__: BUG: Fixes incorrect error message in numpy.ediff1d +* `#17459 `__: DOC: update code of conduct URL +* `#17464 `__: DOC: Add some entries for C types and macros +* `#17465 `__: ENH: Add annotations for bitwise operations +* `#17468 `__: DOC: add some missing scalar aliases +* `#17472 `__: TST: Fix doctest for full_like +* `#17473 `__: MAINT: py3k: remove os.fspath and os.PathLike backports +* `#17474 `__: MAINT: Move the ``np.core.numeric`` annotations to their own stub... +* `#17479 `__: ENH: type ``np.unicode_`` as ``np.str_`` +* `#17481 `__: DOC: Fix the entries for members of structures +* `#17483 `__: DOC: Fix the references for ``random.*`` +* `#17485 `__: BLD: circleCI- merge before build, add -n to sphinx +* `#17487 `__: MAINT: Remove duplicate placeholder annotations +* `#17493 `__: DOC: New round of NEP 42 edits +* `#17497 `__: DOC: Use consistent lowercase on docs landing page +* `#17498 `__: MAINT: fix incompatible type comparison in numpy.lib.utils.info +* `#17501 `__: BUG: Fix failures in master related to userdtype registeration +* `#17502 `__: BUG: remove ``sys`` from the type stubs +* `#17503 `__: DOC: Fix empty 'C style guide' page +* `#17504 `__: DOC: Rename 'Quickstart tutorial' +* `#17508 `__: ENH: Added the Final feature for all constants +* `#17510 `__: DOC: Fewer blank lines in PR template +* `#17520 `__: DOC: Display real license on license page +* `#17521 `__: DOC: Add docstrings for some scalar types +* `#17523 `__: DOC: Update top links in landing page +* `#17525 `__: CI: Make merge ref grabbing conditional on the PR being active +* `#17527 `__: DOC: Fix Bool types in C functions +* `#17528 `__: Doc: Fix some links and typos +* `#17529 `__: MAINT: Cleanup compatibility code for pathlib +* `#17534 `__: DOC: Fix a typo +* `#17535 `__: ENH: add function to get broadcast shape from a given set of... +* `#17536 `__: BUG: Fixed crash on self-referential dtypes +* `#17537 `__: MAINT: Bump hypothesis from 5.37.0 to 5.37.1 +* `#17538 `__: MAINT: Bump pydata-sphinx-theme from 0.4.0 to 0.4.1 +* `#17539 `__: MAINT: Bump mypy from 0.782 to 0.790 +* `#17540 `__: ENH: Make ``np.number`` generic with respect to its precision +* `#17541 `__: CI: fix conditional for PR merge command +* `#17546 `__: MAINT: explicit disabling ``CCompilerOpt`` in F2PY +* `#17548 `__: BUG: Cygwin Workaround for #14787 on affected platforms +* `#17549 `__: DOC: Fix the entries of C functions +* `#17555 `__: DOC: Fix wrong blockquotes +* `#17558 `__: DOC: MAINT: Add NEP 43 links to NEP 42 +* `#17559 `__: DOC: Remove directives for some constants +* `#17564 `__: MAINT: Update the annotations in ``np.core.numeric`` +* `#17570 `__: DOC: Add the entry for ``NPY_FEATURE_VERSION`` +* `#17571 `__: DOC: Fix typos +* `#17572 `__: ENH: Add annotations for three new constants +* `#17576 `__: DOC: Fix Boolean array indexing typo +* `#17577 `__: BUG: Respect dtype of all-zero argument to poly1d +* `#17578 `__: NEP36: include additional feedback +* `#17580 `__: MAINT: Cleanup swig for Python 3. +* `#17581 `__: MAINT: Move the ``np.core.numerictypes`` annotations to their own... +* `#17583 `__: MAINT: Bump hypothesis from 5.37.1 to 5.37.3 +* `#17584 `__: ENH: Add annotations for ``np.core._type_aliases`` +* `#17594 `__: DOC: Typo in lexsort docstring +* `#17596 `__: DEP,BUG: Coercion/cast of array to a subarray dtype will be fixed +* `#17597 `__: TST: Clean up the errors of the typing tests +* `#17598 `__: BUG: Fixed file handle leak in array_tofile. +* `#17601 `__: TST: Fix a broken ``np.core.numeric`` test +* `#17603 `__: MAINT: Mark dead code as intentional for clang. +* `#17607 `__: DOC: removed old references to submodule licenses +* `#17608 `__: DOC: Fix typos (general documentation) +* `#17610 `__: Fully qualify license trove classifier +* `#17611 `__: BUG: mac dylib treated as part of extra objects by f2py +* `#17613 `__: ENH: Add annotations for 9 ``ndarray``/``generic`` magic methods +* `#17614 `__: DOC: Fix the document for arrays interface +* `#17618 `__: MAINT: Conversion of some strings to f-strings +* `#17619 `__: DOC: Fix some references +* `#17621 `__: TST: Valid docstring for config_py function show() +* `#17622 `__: MAINT: Conversion of some strings to fstrings, part II +* `#17623 `__: MAINT: Conversion of some strings to fstrings, part III +* `#17624 `__: DOC: Tidy up references to ``str_`` / ``bytes_`` +* `#17625 `__: MAINT: Conversion of some strings to fstrings, part iv +* `#17627 `__: DOC: Fix the references for ``__array_*__`` +* `#17628 `__: DOC: Add entries for macros +* `#17629 `__: DOC: Add ``identity_value`` to ``PyUFuncObject`` +* `#17630 `__: DOC: Replace ``PyCObject`` with ``PyCapsule`` +* `#17633 `__: DOC: Don't use Python highlighting for non-python code +* `#17638 `__: DOC: Fix some references +* `#17639 `__: MAINT: Bump hypothesis from 5.37.3 to 5.38.0 +* `#17641 `__: MAINT, BLD: update to OpenBLAS v0.3.12 +* `#17642 `__: DOC: Fix reference to atleast_1d +* `#17643 `__: ENH: Add annotations for ``np.core._ufunc_config`` +* `#17644 `__: ENH: Add annotations for ``np.core.shape_base`` +* `#17645 `__: BUG: fix np.timedelta64('nat').__format__ throwing an exception +* `#17654 `__: BUG: f2py incorrectly translates dimension declarations. +* `#17655 `__: BLD: Fix installing Numpy on z/OS +* `#17657 `__: NEP: Ensure inner loop signature is complete everywhere +* `#17658 `__: TST: simplify source path names in compilation test +* `#17662 `__: TST: f2py: Add a doctest for ``getlincoef`` +* `#17666 `__: REL: Update master after 1.19.3 release. +* `#17668 `__: TST: Make test suite work in FIPS (140-2) Mode +* `#17670 `__: DOC: f2py: Add a docstring for getarrlen +* `#17672 `__: DOC: Update README badge for travis-ci.com +* `#17673 `__: MAINT: Refine a number of ``np.generic`` annotations +* `#17675 `__: MAINT: Update release documentation and software +* `#17681 `__: SIMD: Add sum intrinsics for float/double. +* `#17682 `__: BUG: (nditer_impl.h) Use ``intp`` instead of ``char *`` for offset... +* `#17689 `__: BUG: Fix small bug in ``make_lite.py``. +* `#17691 `__: DOC: Modify Templates +* `#17692 `__: MAINT: Bump hypothesis from 5.38.0 to 5.41.0 +* `#17693 `__: MAINT: Bump pytz from 2020.1 to 2020.4 +* `#17695 `__: TST: use a more standard workflow for PyPy +* `#17696 `__: REL: Update master after 1.19.4 release. +* `#17699 `__: MAINT: Rename ``DtypeLike`` to ``DTypeLike`` +* `#17700 `__: Fix small typos. +* `#17701 `__: BUG: Fixed an issue where ``.pyi`` files were ignored by numpy... +* `#17703 `__: Fix Doc Typos & Added Example +* `#17706 `__: BUG: Raise promotion error if a DType was provided in array coercion +* `#17708 `__: Improve the einsum bench by adding new bench cases and variable... +* `#17711 `__: ENH: adds type hints to numpy.version +* `#17715 `__: REV: Revert gh-17654 - f2py incorrectly translates dimension... +* `#17717 `__: MAINT: Add more files to ``.gitgnore`` +* `#17720 `__: API: Do not import sliding_window_view to main namespace +* `#17723 `__: MAINT: Do not override ``sliding_window_view`` module to ``numpy`` +* `#17725 `__: NEP: Add NEP-35 instructions on reading like= downstream +* `#17729 `__: BLD: Use importlib to find numpy root directory in distutils +* `#17733 `__: MAINT: ma: Remove unused ``**options`` from MaskedArray ``__new__``... +* `#17735 `__: TST: Remove Python 3.6 CI testing. +* `#17738 `__: BLD, TST: move linux jobs to github actions +* `#17740 `__: MAINT: Bump hypothesis from 5.41.0 to 5.41.2 +* `#17743 `__: BLD, BUG: Fix cblas detection on windows +* `#17745 `__: TST: add pypy3.7 +* `#17748 `__: BLD: compare platform.architecture() correctly +* `#17749 `__: DOC: Add "performance" category to the release notes +* `#17751 `__: BUG: Fix segfault due to out of bound pointer in floatstatus... +* `#17753 `__: BUG: Fix buffer export dtype references +* `#17755 `__: BUG: Fix memory leaks found using valgrind +* `#17758 `__: BLD: Lazy load f2py test utilities +* `#17759 `__: BLD: use BUFFERSIZE=20 in OpenBLAS +* `#17763 `__: SIMD, BUG: fix reuses the previous values during the fallback... +* `#17768 `__: MAINT: update link to website in FUNDING.yml +* `#17773 `__: MAINT: Add BLD and STY to labeler prefixes. +* `#17776 `__: MAINT: Simplify Hypothesis configuration +* `#17787 `__: NEP: Make like= argument added in NEP-35 strict +* `#17788 `__: DOC: Fix up links, code blocks of release note fragments +* `#17796 `__: MAINT: Minor touchups in npyio +* `#17802 `__: MAINT: Update mailmap. +* `#17805 `__: MAINT: Set the ufunc and ndarray ops return type to ``Any`` +* `#17812 `__: Update linalg.py +* `#17815 `__: DOC: Fix empty_like docstring +* `#17823 `__: DOC: Add missing release fragments to ``upcoming_changes``. +* `#17828 `__: BUG: Fix incorrectly passed size in masked processing +* `#17829 `__: MAINT: Bump hypothesis from 5.41.2 to 5.41.3 +* `#17830 `__: TST: Add back durations flag for DEBUG builds. +* `#17832 `__: BUG: Fix subarray dtype used with too large count in fromfile +* `#17833 `__: BUG: Fix pickling of scalars with NPY_LISTPICKLE +* `#17838 `__: DOC: Update the ``numpy.typing`` documentation +* `#17841 `__: DOC: Fixing boilerplate code example +* `#17844 `__: MAINT: Add ``__all__`` to ``numpy.typing`` +* `#17848 `__: DOC: Add release note for gh-16161. +* `#17855 `__: BUG: Fix incorrect C function prototypes/declarations. +* `#17857 `__: MAINT: Prepare for the NumPy 1.20.x branch. +* `#17869 `__: BUG, TST: use python-version not PYTHON_VERSION +* `#17879 `__: BUG: Fix buffer readflag errors and small leaks +* `#17893 `__: DOC: Prepare for 1.20.0 release +* `#17898 `__: MAINT: Remove remaining uses of Python 3.6. +* `#17899 `__: TST: use latest pypy37 not pypy36 +* `#17901 `__: MAINT: clean up a spurious warning in numpy/typing/setup.py +* `#17904 `__: ENH: Speed up default ``where`` in the reduce-like method +* `#17915 `__: TST: remove stray '+' from f-string upgrade +* `#17916 `__: ENH: add support for fujitsu compiler to numpy. +* `#17922 `__: BUG: 'bool' object has no attribute 'ndim' +* `#17931 `__: DOC: Update release notes to mention ``type(dtype) is not np.dtype`` +* `#17990 `__: BUG: Replace f-string in setup.py +* `#18015 `__: BUG: Ignore fewer errors during array-coercion +* `#18016 `__: BUG: Fix a MacOS build failure +* `#18017 `__: TST: Fix crosstalk issues with polynomial str tests. +* `#18018 `__: TST: Ensure tests are not sensitive to execution order +* `#18019 `__: BLD: update to OpenBLAS 0.3.13 +* `#18024 `__: DEP: Futurewarn on requiring __len__ on array-likes +* `#18035 `__: BUG: make a variable volatile to work around clang compiler bug +* `#18049 `__: TST: add back sdist test run +* `#18063 `__: BUG: Fix concatenation when the output is "S" or "U" +* `#18064 `__: BLD, BUG: Fix detecting aarch64 on macOS +* `#18068 `__: REL: Prepare for 1.20.0rc2 release. +* `#18108 `__: BUG, BLD: Generate the main dispatcher config header into the... +* `#18120 `__: BUG, SIMD: Fix _simd module build for 64bit ARM/NEON clang +* `#18127 `__: REL: Update 1.20.x after 1.19.5 release. +* `#18130 `__: BUG: Fix promotion of half and string +* `#18146 `__: BUG, MAINT: improve avx512 mask logical operations +* `#18154 `__: BUG: Promotion between strings and objects was assymetric +* `#18192 `__: MAINT: Use explicit reexports for numpy.typing objects +* `#18201 `__: BUG: Keep ignoring most errors during array-protocol lookup +* `#18219 `__: MAINT: random shuffle: warn on unrecognized objects, fix empty... +* `#18231 `__: BLD: update OpenBLAS to af2b0d02 +* `#18237 `__: DOC: Clarify the type alias deprecation message +* `#18257 `__: BUG: Ensure too many advanced indices raises an exception +* `#18258 `__: MAINT: add an 'apt update' +* `#18259 `__: DOC: Prepare for the NumPy 1.20.0 release. diff --git a/doc/changelog/1.20.1-changelog.rst b/doc/changelog/1.20.1-changelog.rst new file mode 100644 index 000000000000..215cdca3c5e0 --- /dev/null +++ b/doc/changelog/1.20.1-changelog.rst @@ -0,0 +1,36 @@ + +Contributors +============ + +A total of 8 people contributed to this release. People with a "+" by their +names contributed a patch for the first time. + +* Bas van Beek +* Charles Harris +* Nicholas McKibben + +* Pearu Peterson +* Ralf Gommers +* Sebastian Berg +* Tyler Reddy +* @Aerysv + + +Pull requests merged +==================== + +A total of 15 pull requests were merged for this release. + +* `#18306 `__: MAINT: Add missing placeholder annotations +* `#18310 `__: BUG: Fix typo in ``numpy.__init__.py`` +* `#18326 `__: BUG: don't mutate list of fake libraries while iterating over... +* `#18327 `__: MAINT: gracefully shuffle memoryviews +* `#18328 `__: BUG: Use C linkage for random distributions +* `#18336 `__: CI: fix when GitHub Actions builds trigger, and allow ci skips +* `#18337 `__: BUG: Allow unmodified use of isclose, allclose, etc. with timedelta +* `#18345 `__: BUG: Allow pickling all relevant DType types/classes +* `#18351 `__: BUG: Fix missing signed_char dependency. Closes #18335. +* `#18352 `__: DOC: Change license date 2020 -> 2021 +* `#18353 `__: CI: CircleCI seems to occasionally time out, increase the limit +* `#18354 `__: BUG: Fix f2py bugs when wrapping F90 subroutines. +* `#18356 `__: MAINT: crackfortran regex simplify +* `#18357 `__: BUG: threads.h existence test requires GLIBC > 2.12. +* `#18359 `__: REL: Prepare for the NumPy 1.20.1 release. diff --git a/doc/changelog/1.20.2-changelog.rst b/doc/changelog/1.20.2-changelog.rst new file mode 100644 index 000000000000..831cf03324de --- /dev/null +++ b/doc/changelog/1.20.2-changelog.rst @@ -0,0 +1,40 @@ + +Contributors +============ + +A total of 7 people contributed to this release. People with a "+" by their +names contributed a patch for the first time. + +* Allan Haldane +* Bas van Beek +* Charles Harris +* Christoph Gohlke +* Mateusz Sokół + +* Michael Lamparski +* Sebastian Berg + +Pull requests merged +==================== + +A total of 20 pull requests were merged for this release. + +* `#18382 `__: MAINT: Update f2py from master. +* `#18459 `__: BUG: ``diagflat`` could overflow on windows or 32-bit platforms +* `#18460 `__: BUG: Fix refcount leak in f2py ``complex_double_from_pyobj``. +* `#18461 `__: BUG: Fix tiny memory leaks when ``like=`` overrides are used +* `#18462 `__: BUG: Remove temporary change of descr/flags in VOID functions +* `#18469 `__: BUG: Segfault in nditer buffer dealloc for Object arrays +* `#18485 `__: BUG: Remove suspicious type casting +* `#18486 `__: BUG: remove nonsensical comparison of pointer < 0 +* `#18487 `__: BUG: verify pointer against NULL before using it +* `#18488 `__: BUG: check if PyArray_malloc succeeded +* `#18546 `__: BUG: incorrect error fallthrough in nditer +* `#18559 `__: CI: Backport CI fixes from main. +* `#18599 `__: MAINT: Add annotations for ``dtype.__getitem__``, ``__mul__`` and... +* `#18611 `__: BUG: NameError in numpy.distutils.fcompiler.compaq +* `#18612 `__: BUG: Fixed ``where`` keyword for ``np.mean`` & ``np.var`` methods +* `#18617 `__: CI: Update apt package list before Python install +* `#18636 `__: MAINT: Ensure that re-exported sub-modules are properly annotated +* `#18638 `__: BUG: Fix ma coercion list-of-ma-arrays if they do not cast to... +* `#18661 `__: BUG: Fix small valgrind-found issues +* `#18671 `__: BUG: Fix small issues found with pytest-leaks diff --git a/doc/changelog/1.20.3-changelog.rst b/doc/changelog/1.20.3-changelog.rst new file mode 100644 index 000000000000..df7f1056521a --- /dev/null +++ b/doc/changelog/1.20.3-changelog.rst @@ -0,0 +1,35 @@ + +Contributors +============ + +A total of 7 people contributed to this release. People with a "+" by their +names contributed a patch for the first time. + +* Anne Archibald +* Bas van Beek +* Charles Harris +* Dong Keun Oh + +* Kamil Choudhury + +* Sayed Adel +* Sebastian Berg + +Pull requests merged +==================== + +A total of 15 pull requests were merged for this release. + +* `#18763 `__: BUG: Correct ``datetime64`` missing type overload for ``datetime.date``... +* `#18764 `__: MAINT: Remove ``__all__`` in favor of explicit re-exports +* `#18768 `__: BLD: Strip extra newline when dumping gfortran version on MacOS +* `#18769 `__: BUG: fix segfault in object/longdouble operations +* `#18794 `__: MAINT: Use towncrier build explicitly +* `#18887 `__: MAINT: Relax certain integer-type constraints +* `#18915 `__: MAINT: Remove unsafe unions and ABCs from return-annotations +* `#18921 `__: MAINT: Allow more recursion depth for scalar tests. +* `#18922 `__: BUG: Initialize the full nditer buffer in case of error +* `#18923 `__: BLD: remove unnecessary flag ``-faltivec`` on macOS +* `#18924 `__: MAINT, CI: treats _SIMD module build warnings as errors through... +* `#18925 `__: BUG: for MINGW, threads.h existence test requires GLIBC > 2.12 +* `#18941 `__: BUG: Make changelog recognize gh- as a PR number prefix. +* `#18948 `__: REL, DOC: Prepare for the NumPy 1.20.3 release. +* `#18953 `__: BUG: Fix failing mypy test in 1.20.x. diff --git a/doc/changelog/1.21.0-changelog.rst b/doc/changelog/1.21.0-changelog.rst new file mode 100644 index 000000000000..947da4da740e --- /dev/null +++ b/doc/changelog/1.21.0-changelog.rst @@ -0,0 +1,769 @@ + +Contributors +============ + +A total of 175 people contributed to this release. People with a "+" by their +names contributed a patch for the first time. + +* @8bitmp3 + +* @DWesl + +* @Endolith +* @Illviljan + +* @Lbogula + +* @Lisa + +* @Patrick + +* @Scian + +* @h-vetinari + +* @h6197627 + +* @jbCodeHub + +* @legoffant + +* @sfolje0 + +* @tautaus + +* @yetanothercheer + +* Abhay Raghuvanshi + +* Adrian Price-Whelan + +* Aerik Pawson + +* Agbonze Osazuwa + +* Aitik Gupta + +* Al-Baraa El-Hag +* Alex Henrie +* Alexander Hunt + +* Alizé Papp + +* Allan Haldane +* Amarnath1904 + +* Amrit Krishnan + +* Andras Deak +* AngelGris + +* Anne Archibald +* Anthony Vo + +* Antony Lee +* Atharva-Vidwans + +* Ayush Verma + +* Bas van Beek +* Bharat Raghunathan +* Bhargav V + +* Brian Soto +* Carl Michal + +* Charles Harris +* Charles Stern + +* Chiara Marmo + +* Chris Barnes + +* Chris Vavaliaris +* Christina Hedges + +* Christoph Gohlke +* Christopher Dahlin + +* Christos Efstathiou + +* Chunlin Fang +* Constanza Fierro + +* Daniel Evans + +* Daniel Montes + +* Dario Mory + +* David Carlier + +* David Stansby +* Deepyaman Datta + +* Derek Homeier +* Dong Keun Oh + +* Dylan Cutler + +* Eric Larson +* Eric Wieser +* Eva Jau + +* Evgeni Burovski +* FX Coudert + +* Faris A Chugthai + +* Filip Ter + +* Filip Trojan + +* François Le Lay + +* Ganesh Kathiresan +* Giannis Zapantis + +* Giulio Procopio + +* Greg Lucas + +* Hollow Man + +* Holly Corbett + +* I-Shen Leong + +* Inessa Pawson +* Isabela Presedo-Floyd +* Ismael Jimenez + +* Isuru Fernando +* Jakob Jakobson +* James Gerity + +* Jamie Macey + +* Jasmin Classen + +* Jody Klymak + +* Joseph Fox-Rabinovitz +* Jérome Eertmans + +* Jérôme Kieffer + +* Kamil Choudhury + +* Kasia Leszek + +* Keller Meier + +* Kenichi Maehashi +* Kevin Sheppard +* Kulin Seth + +* Kumud Lakara + +* Laura Kopf + +* Laura Martens + +* Leo Singer + +* Leonardus Chen + +* Lima Tango + +* Lumir Balhar + +* Maia Kaplan + +* Mainak Debnath + +* Marco Aurélio da Costa + +* Marta Lemanczyk + +* Marten van Kerkwijk +* Mary Conley + +* Marysia Winkels + +* Mateusz Sokół + +* Matt Haberland +* Matt Hall + +* Matt Ord + +* Matthew Badin + +* Matthias Bussonnier +* Matthias Geier +* Matti Picus +* Matías Ríos + +* Maxim Belkin + +* Melissa Weber Mendonça +* Meltem Eren Copur + +* Michael Dubravski + +* Michael Lamparski +* Michal W. Tarnowski + +* Michał Górny + +* Mike Boyle + +* Mike Toews +* Misal Raj + +* Mitchell Faas + +* Mukulikaa Parhari + +* Neil Girdhar + +* Nicholas McKibben + +* Nico Schlömer +* Nicolas Hug + +* Nilo Kruchelski + +* Nirjas Jakilim + +* Ohad Ravid + +* Olivier Grisel +* Pamphile ROY + +* Panos Mavrogiorgos + +* Patrick T. Komiske III + +* Pearu Peterson +* Peter Hawkins + +* Raghuveer Devulapalli +* Ralf Gommers +* Raúl Montón Pinillos + +* Rin Arakaki + +* Robert Kern +* Rohit Sanjay +* Roman Yurchak +* Ronan Lamy +* Ross Barnowski +* Ryan C Cooper +* Ryan Polley + +* Ryan Soklaski +* Sabrina Simao + +* Sayed Adel +* Sebastian Berg +* Shen Zhou + +* Stefan van der Walt +* Sylwester Arabas + +* Takanori Hirano +* Tania Allard + +* Thomas J. Fan + +* Thomas Orgis + +* Tim Hoffmann +* Tomoki, Karatsu + +* Tong Zou + +* Touqir Sajed + +* Tyler Reddy +* Wansoo Kim +* Warren Weckesser +* Weh Andreas + +* Yang Hau +* Yashasvi Misra + +* Zolboo Erdenebaatar + +* Zolisa Bleki + +Pull requests merged +==================== + +A total of 581 pull requests were merged for this release. + +* `#13578 `__: DEP: Deprecate `data_type.dtype` if attribute is not already... +* `#15269 `__: ENH: Implement faster keyword argument parsing capable of ``METH_FASTCALL`` +* `#15271 `__: ENH: Optimize and cleanup ufunc calls and ufunc CheckOverrides +* `#15392 `__: BUG: Remove temporary change of descr/flags in VOID functions +* `#16164 `__: DOC: Add more information about poly1d -> polynomial to reference... +* `#16241 `__: ENH: Warn when reloading numpy or using numpy in sub-interpreter +* `#16370 `__: DOC: Fix for building with sphinx 3 +* `#16588 `__: DOC: unify the docs for np.transpose and ndarray.transpose +* `#16818 `__: DOC: added examples section for rfft2 and irfft2 docstring +* `#16855 `__: DOC: Fix Typo (Wrong argument name) +* `#16987 `__: ENH: Phase unwrapping generalized to arbitrary interval size +* `#17102 `__: SIMD: Optimize the performance of np.packbits in AVX2/AVX512F/VSX. +* `#17122 `__: MAINT: Use numpy version for f2py version. +* `#17492 `__: DEP: Shift correlate mode parsing to C and deprecate inexact... +* `#17586 `__: DEP: Formally deprecate `np.typeDict` +* `#17587 `__: SIMD: Replace raw SIMD of sin/cos with NPYV(universal intrinsics) +* `#17636 `__: MAINT: Bump pydata-sphinx-theme and set logo link to index +* `#17637 `__: DOC: Add module template +* `#17719 `__: ENH: Make `ndarray` generic w.r.t. its shape and dtype +* `#17727 `__: ENH: Added libdivide for floor divide +* `#17736 `__: BUG, Benchmark: fix passing optimization build options to asv +* `#17737 `__: MAINT, Benchmark: print the supported CPU features during the... +* `#17778 `__: ENH: Add annotations for comparison operations +* `#17782 `__: SIMD: Optimize the performance of einsum's submodule multiply... +* `#17789 `__: ENH, SIMD: Add new NPYV intrinsics pack(0) +* `#17790 `__: ENH, SIMD: Add new NPYV intrinsics pack(1) +* `#17791 `__: BLD: Enable Werror=undef in travis +* `#17792 `__: ENH: add support for fujitsu compiler to numpy. +* `#17795 `__: ENH: Add two new `_Like` unions +* `#17817 `__: BUG: Ignore fewer errors during array-coercion +* `#17836 `__: MAINT: Add git rules to ignore all SIMD generated files +* `#17843 `__: ENH: Add a mypy plugin for inferring platform-specific `np.number`... +* `#17847 `__: TST: use latest pypy37 not pypy36 +* `#17852 `__: DOC: Doc for deprecate_with_doc +* `#17853 `__: DOC: Clarify docs of np.resize(). +* `#17861 `__: MAINT: Update master after 1.20.x branch. +* `#17862 `__: Make it clearer that np.interp input must be monotonically increasing +* `#17863 `__: MAINT: Implement new casting loops based on NEP 42 and 43 +* `#17866 `__: DOC: fix typo in glossary.rst +* `#17868 `__: BUG, TST: use python-version not PYTHON_VERSION +* `#17872 `__: DOC: update the release howto for oldest-supported-numpy +* `#17874 `__: MAINT: clean up a spurious warning in numpy/typing/setup.py +* `#17875 `__: DOC: Prepare for 1.20.0 release +* `#17876 `__: DOC: fixed typo in np-indexing.png explaining [-2:] slice in... +* `#17877 `__: BUG: Fix buffer readflag errors and small leaks +* `#17878 `__: BUG: np.arange: Allow `stop` not `start` as sole kwargs. +* `#17881 `__: MAINT: Bump hypothesis from 5.41.3 to 5.41.4 +* `#17883 `__: MAINT: Remove duplicate dictionary entry +* `#17884 `__: BUG: numpy.putmask not respecting writeable flag +* `#17886 `__: ENH: Timestamp development versions. +* `#17887 `__: DOC: Update arraycreation +* `#17888 `__: DOC: Correct sentence/statement composition +* `#17889 `__: DOC: Rename basics to fundamentals + added description +* `#17895 `__: MAINT: Remove remaining uses of Python 3.6. +* `#17896 `__: ENH: Speed up default `where` in the reduce-like method +* `#17897 `__: BUG: merging PR to use -Werror=undef broke another PR +* `#17900 `__: DEP: Finalize unravel_index `dims` alias for `shape` keyword +* `#17906 `__: BUG: Fix a MacOS build failure +* `#17907 `__: BUG: 'bool' object has no attribute 'ndim' +* `#17912 `__: BUG: remove stray '+' from f-string upgrade in numba/extending.py +* `#17914 `__: DOC: Update release notes to mention `type(dtype) is not np.dtype` +* `#17920 `__: NEP: Update NEP 42 and 43 according to the current implementation +* `#17921 `__: BUG: Enforce high >= low on uniform number generators +* `#17929 `__: MAINT: Replace `contextlib_nullcontext` with `contextlib.nullcontext` +* `#17934 `__: DOC: Add information about leak checking and valgrind +* `#17936 `__: TST: Fixed an issue where the typing tests would fail for comparison... +* `#17942 `__: DOC: Clarify savez documentation of naming arrays in output file +* `#17943 `__: [DOC]: Wrong length for underline in docstring. +* `#17945 `__: MAINT: Bump hypothesis from 5.41.4 to 5.41.5 +* `#17950 `__: BUG: Removed empty String from Nag Compiler's Flags +* `#17953 `__: NEP: Accept NEP 42 -- New and extensible DTypes +* `#17955 `__: DOC: Replace {var} in docstrings type annotation with `scalar... +* `#17956 `__: ENH: Use versioneer to manage numpy versions. +* `#17957 `__: TST: Fix crosstalk issues with polynomial str tests. +* `#17958 `__: MAINT: Optimize the performance of count_nonzero by using universal... +* `#17960 `__: TST, BUILD: Add a native x86 baseline build running on ubuntu-20.04 +* `#17962 `__: TST: Ensure tests are not sensitive to execution order +* `#17966 `__: BUG: Add missing decref to arange +* `#17968 `__: ENH: Use more typevars in `np.dtype` +* `#17971 `__: BUG, SIMD: Fix direactive check for AVX512BW of intrinsics npyv_tobits_* +* `#17973 `__: DEP: Futurewarn on requiring __len__ on array-likes +* `#17974 `__: BLD: Fixes for versioneer and setup.py sdist. +* `#17976 `__: DOC: Add/remove spaces in snippets and re-format here and there +* `#17978 `__: MAINT: Update test_requirements and release_requirements. +* `#17981 `__: ENH: Add proper dtype-support to `np.flatiter` +* `#17985 `__: ENH, SIMD: Ditching the old CPU dispatcher(Arithmetic) +* `#17992 `__: DOC: Replace verbatim with reference to local parameter +* `#17993 `__: [DOC] np.kron use double backticks for non-references +* `#17994 `__: SIMD: Optimize the performance of einsum's submodule dot . +* `#17995 `__: MAINT: Bump pytest from 6.0.2 to 6.2.0 +* `#17996 `__: MAINT: Update wheel requirement from <=0.35.1 to <0.36.3 +* `#17997 `__: MAINT: Bump hypothesis from 5.41.5 to 5.43.3 +* `#17998 `__: TST: ignore pytest warning +* `#17999 `__: Replace Numpy with NumPy +* `#18001 `__: BLD, BUG: Fix detecting aarch64 on macOS +* `#18002 `__: DOC: Fix and extend the docstring for np.inner +* `#18007 `__: DOC: Add a brief explanation of float printing +* `#18008 `__: DOC: fix for doctests +* `#18011 `__: BLD: update to OpenBLAS 0.3.13 +* `#18012 `__: SIMD: Optimize the performance of einsum's submodule sum. +* `#18014 `__: DOC: random: add some examples for SeedSequence +* `#18027 `__: DOC, MAINT: Minor fixes to refguide_check.py documentation. +* `#18030 `__: BUG: make a variable volatile to work around clang compiler bug +* `#18031 `__: DOC: Parameter name typo axes -> axis in numpy.fft._pocketfft. +* `#18032 `__: ENH: Add annotations for `np.core.arrayprint` +* `#18034 `__: DOC: Fix a couple of reference to verbatim and vice versa +* `#18042 `__: MAINT: Add dist_info to "other" setup.py commands. +* `#18045 `__: MAINT: Bump pytest from 6.2.0 to 6.2.1 +* `#18046 `__: TST: add back sdist test run +* `#18047 `__: BLD,DOC: pin sphinx to 3.3.1 +* `#18048 `__: DOC: Update TESTS.rst.txt +* `#18050 `__: MAINT: Add aliases for commonly used `ArrayLike` objects +* `#18051 `__: DEP: deprecate np.testing.dec +* `#18052 `__: BUG: Fix concatenation when the output is "S" or "U" +* `#18054 `__: DOC: Update stack docstrings +* `#18057 `__: BLD: ensure we give the right error message for old Python versions +* `#18062 `__: DOC: add missing details to linalg.lstsq docstring +* `#18065 `__: MAINT: CPUs that support unaligned access. +* `#18066 `__: TST: Allow mypy output types to be specified via aliases +* `#18067 `__: MAINT: Remove obsolete workaround to set ndarray.__hash__ = None +* `#18070 `__: BUG: Fix unique handling of nan entries. +* `#18072 `__: MAINT: crackfortran regex simplify +* `#18074 `__: MAINT: exprtype regex simplify +* `#18075 `__: ENH, SIMD: Dispatch for unsigned floor division +* `#18077 `__: NEP: mark NEP 28 on website redesign as final +* `#18078 `__: Fix build warnings in NEPs +* `#18079 `__: MAINT: Bump sphinx from 3.3.1 to 3.4.1 +* `#18080 `__: MAINT: Bump pytz from 2020.4 to 2020.5 +* `#18081 `__: MAINT: Bump hypothesis from 5.43.3 to 5.43.4 +* `#18082 `__: DOC: roadmap update +* `#18083 `__: MAINT: regex char class improve +* `#18084 `__: NEP: NumPy sponsorship guidelines (NEP 46) +* `#18085 `__: DOC: replace 'this platform' with the actual platform in the... +* `#18086 `__: BUG, SIMD: Fix _simd module build for 64bit Arm/neon clang +* `#18088 `__: DOC: Update reference to verbatim in a few location. +* `#18090 `__: MAINT: multiline regex class simplify +* `#18091 `__: DOC: Avoid using "set of" when talking about an ordered list. +* `#18097 `__: NEP: update backwards compatibility and deprecation policy NEP +* `#18100 `__: BUG, BLD: Generate the main dispatcher config header into the... +* `#18101 `__: ENH: move exp, log, frexp, ldexp to SIMD dispatching +* `#18103 `__: TST: Avoid changing odd tempfile names in tests' site.cfg +* `#18104 `__: TST: Turn some tests with loops into parametrized tests. +* `#18109 `__: MAINT: Fix exception cause in mingw32ccompiler.py +* `#18110 `__: API: make piecewise subclass safe using use zeros_like. +* `#18111 `__: MAINT: Bump hypothesis from 5.43.4 to 5.46.0 +* `#18115 `__: BUG: Fix promotion of half and string +* `#18116 `__: DEP: Deprecate promotion of numbers and bool to string +* `#18118 `__: BUG, MAINT: improve avx512 mask logical operations +* `#18126 `__: REL: Update master after 1.19.5 release. +* `#18128 `__: ENH: Add dtype support to the array comparison ops +* `#18136 `__: ENH: Adding keyboard interrupt support for array creation +* `#18144 `__: BLD: add found Cython version to check in cythonize.py +* `#18148 `__: MAINT: Bump sphinx from 3.4.1 to 3.4.3 +* `#18149 `__: MAINT: Bump hypothesis from 5.46.0 to 6.0.0 +* `#18150 `__: BUG: Ensure too many advanced indices raises an exception +* `#18152 `__: BUG: Promotion between strings and objects was assymetric +* `#18156 `__: MAINT: Remove redundant null check before free +* `#18157 `__: BUG: Initialize value of no_castable_output used in ufunc_loop_matches +* `#18161 `__: MAINT: Make keyword arrays static +* `#18164 `__: TST: add a pypy37 windows 64-bit build +* `#18166 `__: Use sinus based formula for ``chebpts1`` +* `#18169 `__: ENH: cpu features detection implementation on FreeBSD ARM +* `#18173 `__: TST: Clear the mypy cache before running any typing tests +* `#18174 `__: MAINT: Changed the `NBitBase` variancy in `number` from co- to... +* `#18176 `__: ENH: Improve performance of tril_indices and triu_indices +* `#18178 `__: SIMD: add fast integer division intrinsics for all supported... +* `#18180 `__: BUG: threads.h existence test requires GLIBC > 2.12. +* `#18181 `__: ENH: [f2py] Add external attribute support. +* `#18182 `__: MAINT: Bump hypothesis from 6.0.0 to 6.0.2 +* `#18183 `__: MAINT: Optimize numpy.count_nonzero for int types using SIMD... +* `#18184 `__: BUG: Fix f2py bugs when wrapping F90 subroutines. +* `#18185 `__: MAINT: Give the `_Like` and `_ArrayLike` type aliases a... +* `#18187 `__: STY: unify imports in __init__.py +* `#18191 `__: STY: Use explicit reexports for numpy.typing objects +* `#18193 `__: MAINT: Fix typo in docstring example +* `#18194 `__: MAINT: einsum: Optimize the sub function two-operands by using... +* `#18196 `__: BLD: update OpenBLAS to af2b0d02 +* `#18197 `__: BUG: Keep ignoring most errors during array-protocol lookup +* `#18200 `__: ENH: Add new intrinsics sum_u8/u16/u64. +* `#18204 `__: TST: Speed up the typing tests +* `#18205 `__: MAINT: Update pavement.py to work with versioneer. +* `#18208 `__: TST: raise memory limit for test +* `#18210 `__: DOC: typo in post-loop return +* `#18211 `__: MAINT: random shuffle: warn on unrecognized objects, fix empty... +* `#18213 `__: DOC: Formatting consistency. +* `#18214 `__: DOC: Double backticks for inline code example. +* `#18217 `__: MAINT: Ignore ComplexWarning in ``test_iter_copy_casts``. +* `#18221 `__: DOC: Misc single to double backticks fixes. +* `#18223 `__: DOC: Improve doc for numpy.random.Generator.choice +* `#18224 `__: MAINT: Bump pydata-sphinx-theme from 0.4.1 to 0.4.2 +* `#18225 `__: MAINT: Bump mypy from 0.790 to 0.800 +* `#18226 `__: MAINT: Bump hypothesis from 6.0.2 to 6.0.3 +* `#18227 `__: MAINT: Bump pytest-cov from 2.10.1 to 2.11.1 +* `#18228 `__: ENH: Add dtype-support to the ufunc-based `ndarray` magic methods... +* `#18229 `__: MAINT: Clean up all module-level dunders +* `#18230 `__: DOC: Clarify the type alias deprecation message +* `#18232 `__: DOC: lib/shape_base numpydoc formatting. +* `#18233 `__: NEP: accept NEP 23 (backwards compatibility policy) +* `#18234 `__: NEP: accept NEP 46 (sponsorship guidelines) +* `#18235 `__: DOC: Fix command in "Writing custom array containers" guide +* `#18236 `__: ENH: Add aliases for commonly used dtype-like objects +* `#18238 `__: DOC: __array__ accepts a dtype argument +* `#18245 `__: BLD: fix issue with `bdist_egg`, which made `make dist` in doc/... +* `#18247 `__: DOC: Misc numpydoc format fixes +* `#18248 `__: DOC: See also -> See Also (casing) +* `#18251 `__: DOC: more misc fixes of syntax +* `#18252 `__: DOC: cleanup of numpy/polynomial. +* `#18253 `__: DOC: improve description of `_NoValue` +* `#18255 `__: MAINT: add an 'apt update' +* `#18262 `__: REL: Update master after 1.20.0 release. +* `#18263 `__: ENH: Added sanity check to printoptions +* `#18264 `__: BUG: Use C linkage for random distributions +* `#18269 `__: DOC: Numpydoc format space before `:` in Parameters +* `#18272 `__: DOC: Numpydoc warning incorrect underline length. +* `#18274 `__: MAINT: Chain exceptions in linalg +* `#18275 `__: MAINT: Bump hypothesis from 6.0.3 to 6.1.1 +* `#18276 `__: MAINT: Bump pytest from 6.2.1 to 6.2.2 +* `#18277 `__: MAINT: Bump pydata-sphinx-theme from 0.4.2 to 0.4.3 +* `#18278 `__: MAINT: defer the import of shutil +* `#18282 `__: MAINT: gracefully shuffle memoryviews +* `#18284 `__: ENH: Add annotations for the remaining `np.generic` aliases +* `#18285 `__: TST: Pin `typing_extensions` to the latest version +* `#18289 `__: MAINT: Move transferdata into buffer-wise struct +* `#18293 `__: BUG: Fix typo in ``numpy.__init__.py`` +* `#18295 `__: BUG: don't mutate list of fake libraries while iterating over... +* `#18301 `__: MAINT: avoid chaining exceptions in conv_template.py +* `#18302 `__: MAINT: Add missing placeholder annotations +* `#18303 `__: MAINT: Fix typo in PyArray_RegisterDataType error +* `#18307 `__: DOC: Corrected numpy.power example. +* `#18313 `__: Numpy logo fix on README +* `#18315 `__: CI: rearrange Azure build jobs +* `#18317 `__: MAINT: Fixed chain exception for array_split func +* `#18320 `__: DOC: add links to polynomial function/class listing +* `#18322 `__: ENH: Add a mypy plugin for exposing platform-specific extended-precision... +* `#18323 `__: ENH: Add dtype-support to the ufunc-based `ndarray` magic methods... +* `#18324 `__: MAINT: Avoid moveaxis overhead in median. +* `#18329 `__: BUG: Allow unmodified use of isclose, allclose, etc. with timedelta +* `#18331 `__: MAINT: Update openblas_support for macosx-arm64 +* `#18332 `__: BUG: Allow pickling all relevant DType types/classes +* `#18333 `__: CI: fix when GitHub Actions builds trigger, and allow ci skips +* `#18334 `__: TST: use setup-python action for pypy, disable win64 pypy +* `#18338 `__: DOC: Fix whitespace before "last updated" on overview page +* `#18339 `__: DOC: Discussion on the @ operator and the matrix class +* `#18340 `__: DOC: remove pygments_style from conf.py +* `#18342 `__: DOC: Specified all possible return types for trapz function #18140 +* `#18344 `__: DOC: Added sentence to docstring of histogram_bin_edges to explain... +* `#18346 `__: DOC: Change license date 2020 -> 2021 +* `#18347 `__: MAINT: Delete unused "dst" clearing functions +* `#18348 `__: DEP: doc-deprecate BLAS_SRC/LAPACK_SRC +* `#18349 `__: CI: CircleCI seems to occasionally time out, increase the limit +* `#18350 `__: BUG: Fix missing signed_char dependency. +* `#18361 `__: ENH: Share memory of read-only intent(in) arrays. +* `#18362 `__: REL: Update master after 1.20.1 release. +* `#18364 `__: DOC: Update landing page to match table of contents +* `#18366 `__: MAINT: Disable TravisCI git clone depth. +* `#18367 `__: MAINT: Bump pytz from 2020.5 to 2021.1 +* `#18369 `__: BUG: np.in1d bug on the object array (issue 17923) +* `#18372 `__: DOC: improve standard_t example in numpy.random. +* `#18374 `__: TST: Add a test for nditer write masked with references +* `#18375 `__: BUG: fix regression in a hidden callback use case in f2py. +* `#18377 `__: ENH: Add annotations for `np.lib.ufunclike` +* `#18379 `__: DOC: Fix docstring of _median_nancheck. +* `#18384 `__: BUG: improve the interface of `tofile` method +* `#18389 `__: MAINT: Fix version of wheel to support Python 3.10 +* `#18390 `__: ENH: Add annotations for `np.core.einsumfunc` +* `#18392 `__: BUG: Remove check in shuffle for non-ndarrays +* `#18394 `__: MAINT: Added Chain exceptions where appropriate +* `#18395 `__: ENH: Initial typing of random +* `#18396 `__: MAINT: Threading and Unicode strings +* `#18397 `__: ENH: Add annotations for `np.lib.index_tricks` +* `#18398 `__: MAINT: Fix casting signatures to align with NEP 43 signature +* `#18400 `__: MAINT: Added Chain exceptions where appropriate +* `#18402 `__: BUG: Fix typo in char_codes +* `#18404 `__: BUG: Fix iterator shape in advanced index assignment broadcast... +* `#18405 `__: DOC: Mention `scipy.signal.correlate` and FFT method in `np.correlate`closes... +* `#18413 `__: MAINT: Bump sphinx from 3.4.3 to 3.5.0 +* `#18414 `__: MAINT: Bump hypothesis from 6.1.1 to 6.2.0 +* `#18415 `__: MAINT: Update END statements parsing for recent Fortran standards. +* `#18416 `__: BUG: Fix f2py parsing continued lines that follow comment lines. +* `#18417 `__: ENH: Add dtype-support to the ufunc-based `ndarray` magic methods... +* `#18418 `__: DOC: remove layout overrides for headers +* `#18420 `__: BUG: Fix tiny memory leaks when ``like=`` overrides are used +* `#18423 `__: ENH: Lint checks for PR diffs +* `#18428 `__: DOC: remove explanations.rst +* `#18429 `__: DOC: point intersphinx to matplotlib/stable... +* `#18432 `__: MAINT: Correct code producing warnings +* `#18433 `__: ENH: Add typing for RandomState +* `#18436 `__: BUG: Fix refcount leak in f2py `complex_double_from_pyobj` +* `#18437 `__: TST: Fix some uninitialized memory in the tests +* `#18438 `__: BUG: Correct shuffling of objects in 1-d array likes +* `#18439 `__: MAINT: random: Use 'from exc' when raising a ValueError in choice. +* `#18443 `__: BUG: fix stacklevel in warning within random.shuffle +* `#18448 `__: DOC: Remove unfinished Linear Algebra section from Quickstart... +* `#18450 `__: BUG: Segfault in nditer buffer dealloc for Object arrays +* `#18454 `__: NEP: add Spending NumPy Project Funds (NEP 48) +* `#18455 `__: BUG: ``diagflat`` could overflow on windows or 32-bit platforms +* `#18456 `__: NEP: array API standard adoption (NEP 47) +* `#18458 `__: DOC: update NEP status for accepted/finished NEPs +* `#18463 `__: MAINT: Bump mypy from 0.800 to 0.812 +* `#18464 `__: MAINT: Bump sphinx from 3.5.0 to 3.5.1 +* `#18465 `__: MAINT: Bump cython from 0.29.21 to 0.29.22 +* `#18466 `__: MAINT: Bump hypothesis from 6.2.0 to 6.3.0 +* `#18475 `__: ENH: Added type annotations to eye() function +* `#18476 `__: BUG: Remove suspicious type casting +* `#18477 `__: BUG: remove nonsensical comparison of pointer < 0 +* `#18478 `__: BUG: verify pointer against NULL before using it +* `#18479 `__: BUG: check if PyArray_malloc succeeded +* `#18481 `__: DOC: Generator and RandomState doc improvements +* `#18482 `__: ENH: Improve error message in multinomial +* `#18489 `__: DOC: Rename "Ones and zeros" section in array-creation documentation. +* `#18493 `__: BUG: Fix non-versioneer uses of numpy.distutils +* `#18497 `__: TST: Remove the `einsum` typing tests reliance on issuing a `ComplexWarning` +* `#18498 `__: BUG: Fixed Von Mises distribution for big values of kappa +* `#18499 `__: TST: Branch coverage improvement for `np.polynomial` +* `#18502 `__: DOC: Fix links to landing page +* `#18505 `__: DOC: add guide for downstream package authors +* `#18509 `__: DOC: trunc, floor, ceil, rint, fix should all link to each other +* `#18513 `__: BLD: add _2_24 to valid manylinux names +* `#18515 `__: MAINT: Improve error message when common type not found. +* `#18517 `__: MAINT: Bump hypothesis from 6.3.0 to 6.3.4 +* `#18518 `__: DOC Improve formatting in the depending_on_numpy documentation +* `#18522 `__: BUG: remove extraneous ARGOUTVIEWM dim. 4 typemaps +* `#18526 `__: MAINT: Specify color in RGB in the docs about the new NumPy logo +* `#18530 `__: BUG: incorrect error fallthrough in nditer +* `#18531 `__: CI: Use Ubuntu 18.04 to run "full" test. +* `#18537 `__: [BLD] use the new openblas lib +* `#18538 `__: Fix the numpy Apple M1 build +* `#18539 `__: BUG: NameError in numpy.distutils.fcompiler.compaq +* `#18544 `__: MAINT: Update master to main after branch rename +* `#18545 `__: ENH: Add annotations for `np.lib.arrayterator` +* `#18554 `__: CI: Pin docker image for Linux_Python_38_32bit_full_with_asserts... +* `#18560 `__: BUG: Fixed ``where`` keyword for ``np.mean`` & ``np.var`` methods +* `#18566 `__: CI: another master -> main fix +* `#18567 `__: CI: skip lint check on merges with main +* `#18569 `__: CI: Ensure that doc-build uses "main" as branch name +* `#18570 `__: CI: Use `git branch -m` instead of `--initial-branch=main` +* `#18571 `__: BUG: Fix overflow warning on apple silicon +* `#18572 `__: CI: Set git default branch to "main" in CircleCI. +* `#18574 `__: MAINT: Update the Call for Contributions section +* `#18575 `__: MAINT: Bump sphinx from 3.5.1 to 3.5.2 +* `#18576 `__: MAINT: Bump hypothesis from 6.3.4 to 6.6.0 +* `#18578 `__: MAINT: Bump pycodestyle from 2.5.0 to 2.6.0 +* `#18579 `__: MAINT: OrderedDict is no longer necessary from Python 3.7 +* `#18582 `__: BLD, TST: use pypy nightly to work around bug +* `#18583 `__: DOC: Clarify docs for fliplr() / flipud() +* `#18584 `__: DOC: Added documentation for linter (#18423) +* `#18593 `__: MAINT: Do not claim input to binops is `self` (array object) +* `#18594 `__: MAINT: Remove strange `op == NULL` check +* `#18596 `__: MAINT: Chain exceptions in index_tricks.py and mrecords.py +* `#18598 `__: MAINT: Add annotations for `dtype.__getitem__`, `__mul__` and... +* `#18602 `__: CI: Do not fail CI on lint error +* `#18605 `__: BUG: Fix ma coercion list-of-ma-arrays if they do not cast to... +* `#18614 `__: MAINT: Bump pycodestyle from 2.6.0 to 2.7.0 +* `#18615 `__: MAINT: Bump hypothesis from 6.6.0 to 6.8.1 +* `#18616 `__: CI: Update apt package list before Python install +* `#18618 `__: MAINT: Ensure that re-exported sub-modules are properly annotated +* `#18622 `__: DOC: Consistently use rng as variable name for random generators +* `#18629 `__: BUG, ENH: fix array2string rounding bug by adding min_digits... +* `#18630 `__: DOC: add note to numpy.rint() docstrings +* `#18634 `__: BUG: Use npy_log1p where appropriate in random generation +* `#18635 `__: ENH: Improve the exception for default low in Generator.integers +* `#18641 `__: MAINT: Remove useless declarations in `bad_commands` +* `#18642 `__: ENH: Use new argument parsing for array creation functions +* `#18643 `__: DOC: Remove mention of nose from README +* `#18645 `__: DOC: Minor fix in inline code example of ufunc reference +* `#18648 `__: MAINT: use super() as described by PEP 3135 +* `#18649 `__: MAINT: Add missing type to cdef statement +* `#18651 `__: BUG: Fix small valgrind-found issues +* `#18652 `__: DOC: Update some plotting code to current Matplotlib idioms +* `#18657 `__: ENH: Improve performance of `np.save` for small arrays +* `#18658 `__: BLD: remove /usr/include from default include dirs +* `#18659 `__: DEV: add a conda environment.yml with all development dependencies +* `#18660 `__: DOC: add release note for removal of /usr/include from include... +* `#18664 `__: MAINT: Bump sphinx from 3.5.2 to 3.5.3 +* `#18666 `__: ENH: Use exponentials in place of inversion in Rayleigh and geometric +* `#18670 `__: BUG: Fix small issues found with pytest-leaks +* `#18676 `__: MAINT: Implement new style promotion for `np.result_type`, etc. +* `#18679 `__: BUG: Changed METH_VARARGS to METH_NOARGS +* `#18680 `__: Docs: simd-optimizations.rst: fix typo (basline ~> baseline) +* `#18685 `__: REL: Update main after 1.20.2 release. +* `#18686 `__: BUG: Fix test_ccompiler_opt when path contains dots +* `#18689 `__: DOC: Change matrix size in absolute beginners doc. +* `#18690 `__: BUG: Correct datetime64 missing type overload for datetime.date... +* `#18691 `__: BUG: fix segfault in object/longdouble operations +* `#18692 `__: MAINT: Bump pydata-sphinx-theme from 0.5.0 to 0.5.2 +* `#18693 `__: MAINT: Bump hypothesis from 6.8.1 to 6.8.3 +* `#18694 `__: TST: pin pypy version to 7.3.4rc1 +* `#18695 `__: ENH: Support parsing Fortran abstract interface blocks. +* `#18697 `__: DEP: Disable PyUFunc_GenericFunction and PyUFunc_SetUsesArraysAsData +* `#18698 `__: MAINT: Specify the color space in all new NumPy logo files +* `#18701 `__: BLD: Strip extra newline when dumping gfortran version on MacOS +* `#18705 `__: DOC: update Steering Council membership and people on governance... +* `#18706 `__: DOC: Add release notes to upcoming_changes +* `#18708 `__: TST: add tests for using np.meshgrid for higher dimensional grids. +* `#18712 `__: DOC: Simplifies Mandelbrot set plot in Quickstart guide +* `#18718 `__: API, DEP: Move ufunc signature parsing to the start +* `#18722 `__: DOC: deduplicate dtype basic types (2) +* `#18725 `__: MAINT: Bump pytest from 6.2.2 to 6.2.3 +* `#18726 `__: MAINT: Bump hypothesis from 6.8.3 to 6.8.4 +* `#18728 `__: MAINT: Add exception chaining where appropriate +* `#18731 `__: BUG: Check out requirements and raise when not satisfied +* `#18733 `__: DEV: Adds gitpod to numpy +* `#18737 `__: BLD: introduce use of BLAS_LIBS and LAPACK_LIBS in distutils/system_info +* `#18739 `__: MAINT: Add exception chaining where appropriate +* `#18741 `__: DOC: Emphasize distinctions between np.copy and ndarray.copy +* `#18745 `__: CI: remove shippable CI +* `#18750 `__: MAINT: Allow more recursion depth for scalar tests. +* `#18751 `__: BUG: Regression #18075 | Fixing Ufunc TD generation order +* `#18753 `__: BLD: Negative zero handling with ifort +* `#18755 `__: MAINT: Bump sphinx from 3.5.3 to 3.5.4 +* `#18757 `__: MAINT: Bump hypothesis from 6.8.4 to 6.9.1 +* `#18758 `__: DOC: Update howto-docs with link to NumPy tutorials. +* `#18761 `__: DOC: Small fixes (including formatting) for NEP 43 +* `#18765 `__: ENH: Improve the placeholder annotations for the main numpy namespace +* `#18766 `__: ENH, SIMD: Replace libdivide functions of signed integer division... +* `#18770 `__: DOC: More concise "How to import NumPy" description +* `#18771 `__: DOC: Use: from numpy.testing import ... +* `#18772 `__: CI: Use informational mode for codecov +* `#18773 `__: CI: Fixing typo in Azure job run +* `#18777 `__: DOC: update random and asserts in test guidelines +* `#18778 `__: MAINT: Relax the integer-type-constraint of `npt._ShapeLike` +* `#18779 `__: DOC: fix spelling of "reccomended" ("recommended") +* `#18780 `__: ENH: Improve the placeholder annotations for the main numpy namespace... +* `#18781 `__: ENH: Add `__all__` to a number of public modules +* `#18785 `__: DOC: change `dec.parametrize` to `pytest.mark.parametrize` +* `#18786 `__: DOC: add note for clip() special case a_min > a_max See #18782 +* `#18787 `__: DOC: Document newer pytest conventions +* `#18789 `__: DEV: Pin pydata-sphinx-theme to 0.5.2. +* `#18790 `__: CI: Use `towncrier build` explicitly +* `#18791 `__: DOC: Fixes small things in the genfromtext docstring +* `#18792 `__: MAINT: Use recent towncrier releases on PyPI. +* `#18795 `__: SIMD, TEST: Workaround for misaligned stack GCC BUG ABI on WIN64 +* `#18796 `__: DOC: Misc Numpydoc and formatting for proper parsing. +* `#18797 `__: DOC: Update random c-api documentation +* `#18799 `__: MAINT: Improve the placeholder annotations for the main numpy... +* `#18800 `__: MAINT: Relax miscellaneous integer-type constraints +* `#18801 `__: DOC: fix typo in frexp docstring +* `#18802 `__: DOC: Improve random.choice() documentation +* `#18805 `__: NEP: propose new nep for allocator policies +* `#18806 `__: MAINT: Bump hypothesis from 6.9.1 to 6.10.0 +* `#18807 `__: MAINT: Bump cython from 0.29.22 to 0.29.23 +* `#18809 `__: MAINT: runtests help text cleanup +* `#18812 `__: DOC: Document howto build documentation in a virtual environment +* `#18813 `__: BUG: Initialize the full nditer buffer in case of error +* `#18818 `__: ENH: Add annotations for 4 objects in `np.core.numerictypes` +* `#18820 `__: MAINT: Remove incorrect inline +* `#18822 `__: DEV: general Gitpod enhancements +* `#18823 `__: MAINT: Minor fix to add reference link to numpy.fill_diagonal... +* `#18825 `__: MAINT: Update README.md +* `#18831 `__: BUG: Prevent nan being used in percentile +* `#18834 `__: DOC: Fix typo in random docs +* `#18836 `__: MAINT: Generalize and shorten the ufunc "trivially iterable"... +* `#18837 `__: ENH, SIMD: Add support for dispatching C++ sources +* `#18839 `__: DOC: Add Gitpod development documentation +* `#18841 `__: DOC: Add favicon +* `#18842 `__: ENH: Improve the placeholder annotations within sub-modules +* `#18843 `__: DOC: Clarify isreal docstring +* `#18845 `__: DOC: Move Sphinx numpy target in reference index. +* `#18851 `__: MAINT: Disable pip version check for azure lint check. +* `#18853 `__: ENH: Improve the placeholder annotations within sub-modules (part... +* `#18855 `__: STY: change CRLF line terminators to Unix +* `#18856 `__: MAINT: Fix the typo "implment" +* `#18862 `__: TST: Skip f2py TestSharedMemory for LONGDOUBLE on macos/arm64 +* `#18863 `__: ENH: Add max values comparison for floating point +* `#18864 `__: MAINT: Remove dead codepath in generalized ufuncs +* `#18868 `__: Upgrade to GitHub-native Dependabot +* `#18869 `__: MAINT: Fix azure linter problems with pip 21.1 +* `#18871 `__: MAINT: Bump hypothesis from 6.10.0 to 6.10.1 +* `#18874 `__: BLD, ENH: Enable Accelerate Framework +* `#18877 `__: MAINT: Update PyPy version used by CI +* `#18880 `__: API: Ensure that casting does not affect ufunc loop +* `#18882 `__: ENH: Add min values comparison for floating point +* `#18885 `__: MAINT: Remove unsafe unions and ABCs from return-annotations +* `#18889 `__: ENH: Add SIMD operations for min and max value comparision +* `#18890 `__: MAINT: ssize_t -> Py_ssize_t and other fixes for Python v3.10.0 +* `#18891 `__: MAINT: Bump typing-extensions from 3.7.4.3 to 3.10.0.0 +* `#18893 `__: DOC: Add a set of standard replies. +* `#18895 `__: DOC: Improve cumsum documentation +* `#18896 `__: MAINT: Explicitly mark text files in .gitattributes. +* `#18897 `__: MAINT: Add ".csv" some data file names. +* `#18899 `__: BLD, BUG: Fix compiler optimization log AttributeError +* `#18900 `__: BLD: remove unnecessary flag `-faltivec` on macOS +* `#18903 `__: MAINT, CI: treats _SIMD module build warnings as errors through... +* `#18906 `__: ENH: Add PCG64DXSM BitGenerator +* `#18908 `__: MAINT: Adjust NumPy float hashing to Python's slightly changed... +* `#18909 `__: ENH: Improve the placeholder annotations within sub-modules (part... +* `#18910 `__: BUG : for MINGW, threads.h existence test requires GLIBC > 2.12 +* `#18911 `__: BLD, BUG: Fix bdist_wheel duplicate building +* `#18912 `__: CI: fix the GitHub Actions trigger in docker.yml +* `#18918 `__: DOC: fix documentation of cloning over ssh +* `#18919 `__: ENH: Add placeholder annotations for two missing `np.testing`... +* `#18920 `__: BUG: Report underflow condition in AVX implementation of np.exp +* `#18927 `__: NEP: add mailing list thread, fixes from review +* `#18930 `__: BUG: Make changelog recognize ``gh-`` as a PR number prefix. +* `#18931 `__: BUG: Fix refcounting in string-promotion deprecation code path +* `#18933 `__: BUG: Fix underflow error in AVX512 implementation of ufunc exp/f64 +* `#18934 `__: DOC: Add a release note for the improved placeholder annotations +* `#18935 `__: API: Add `npt.NDArray`, a runtime-subscriptable alias for `np.ndarray` +* `#18936 `__: DOC: Update performance for new PRNG +* `#18940 `__: ENH: manually inline PCG64DXSM code for performance. +* `#18943 `__: TST: xfail `TestCond.test_nan` unconditionally +* `#18944 `__: ENH: Add annotations for `np.lib.utils` +* `#18954 `__: DOC: Update beginners docu for sum function with axis +* `#18955 `__: DOC: add an extra example in runtests.py help test +* `#18956 `__: DOC: change copyright SciPy to NumPy +* `#18957 `__: DOC: Improve datetime64 docs. +* `#18958 `__: MAINT: Do not use deprecated ``mktemp()`` +* `#18959 `__: DOC: improve numpy.histogram2d() documentation +* `#18960 `__: BUG: fixed ma.average ignoring masked weights +* `#18961 `__: DOC: add note and examples to `isrealobj` docstring +* `#18962 `__: DOC: Update a page title with proper case +* `#18963 `__: DEP: remove PolyBase from np.polynomial.polyutils +* `#18965 `__: DOC: Improve description of array scalar in glossary +* `#18967 `__: BUG: fix np.ma.masked_where(copy=False) when input has no mask +* `#18970 `__: MAINT, SIMD: Hardened the AVX compile-time tests +* `#18972 `__: ENH: Include co-authors in changelog. +* `#18973 `__: MAINT: Bump sphinx from 3.5.4 to 4.0.0 +* `#18974 `__: MAINT: Bump hypothesis from 6.10.1 to 6.12.0 +* `#18976 `__: MAINT: Bump pytest from 6.2.3 to 6.2.4 +* `#18980 `__: DOC: Gitpod documentation enhancements +* `#18982 `__: MAINT: Cleanup tools/changelog.py +* `#18983 `__: REL: Update main after 1.20.3 release. +* `#18985 `__: MAINT: Remove usage of the PEP 604 pipe operator +* `#18987 `__: BUG: Update coordinates in PyArray_ITER_GOTO1D +* `#18989 `__: BUG: fix potential buffer overflow(#18939) +* `#18990 `__: ENH: Add annotations for `np.lib.NumpyVersion` +* `#18996 `__: MAINT: Remove warning when checking AVX512f on MSVC +* `#18998 `__: ENH: Improve annotations of the `item`, `tolist`, `take` and... +* `#18999 `__: DEP: Ensure the string promotion FutureWarning is raised +* `#19001 `__: DEP: Deprecate error clearing for special method in array-coercion +* `#19002 `__: ENH: Add annotations for `np.broadcast` and `np.DataSource` +* `#19005 `__: ENH: Add dtype-support to 11 `ndarray` / `generic` methods +* `#19007 `__: BUG: fix potential use of null pointer in nditer buffers +* `#19008 `__: BUG: fix variable misprint in multiarray test code +* `#19009 `__: BUG: fix variable misprint checking wrong variable in umath tests +* `#19011 `__: BUG: fix ValueError in PyArray_Std on win_amd64 +* `#19012 `__: MAINT: Small cleanups in `PyArray_NewFromDescr_int` +* `#19014 `__: Revert "BUG: Update coordinates in PyArray_ITER_GOTO1D" +* `#19018 `__: DOC: "NumPy" <- "numpy" in NumPy Fundamentals - Indexing +* `#19021 `__: DOC: Add comment for ifdef macro guard +* `#19024 `__: MAINT: Bump pytest-cov from 2.11.1 to 2.12.0 +* `#19025 `__: MAINT: Bump sphinx from 4.0.0 to 4.0.1 +* `#19026 `__: DOC: Clarify minimum numpy version needed to use random c-api +* `#19029 `__: ENH: Improve the annotations of `np.core._internal` +* `#19031 `__: DEP: Deprecate 4 `ndarray.ctypes` methods +* `#19035 `__: MAINT: Python3 classes do not need to inherit from object +* `#19037 `__: BUG: do not use PyLong_FromLong for intp +* `#19041 `__: DOC: Improve trapz docstring +* `#19043 `__: DOC: Fix typo in release notes for v1.21 +* `#19046 `__: BUG, SIMD: Fix unexpected result of uint8 division on X86 +* `#19047 `__: BUG, SIMD: Fix NumPy build on ppc64le(IBM/Power) for old versions... +* `#19048 `__: BUG: Fix duplicate variable names in compiler check for AVX512_SKX +* `#19049 `__: BLD,API: (distutils) Force strict floating point error model... +* `#19052 `__: ENH: Improve the `np.ufunc` annotations +* `#19055 `__: DOC: Forward port missing 1.18.5 release note. +* `#19063 `__: ENH: Stubs for array_equal appear out of date. +* `#19066 `__: BUG: Fixed an issue wherein `nanmedian` could return an array... +* `#19068 `__: MAINT: Update mailmap +* `#19073 `__: REL: Prepare 1.21.0 release +* `#19074 `__: BUG: Fix compile-time test of POPCNT +* `#19075 `__: BUG: Fix test_numpy_version. +* `#19094 `__: BUG: Fixed an issue wherein `_GenericAlias.__getitem__` would... +* `#19100 `__: BUG: Linter should only run on pull requests. +* `#19120 `__: BUG: Fix setup.py to work in maintenance branches. +* `#19144 `__: BUG: expose short_version as previously in version.py +* `#19175 `__: API: Delay string and number promotion deprecation/future warning +* `#19178 `__: BUG, SIMD: Fix detect host/native CPU features on ICC at compile-time +* `#19180 `__: BUG: Add -std=c99 to intel icc compiler flags on linux +* `#19193 `__: NEP: Accept NEP 35 as final +* `#19194 `__: MAINT, BUG: Adapt `castingimpl.casting` to denote a minimal level +* `#19197 `__: REL: Prepare for NumPy 1.20.0rc2 release. +* `#19213 `__: MAINT: Add annotations for the missing `period` parameter to... +* `#19219 `__: MAINT: Add `complex` as allowed type for the `np.complexfloating`... +* `#19233 `__: TST: Ignore exp FP exceptions test for glibc ver < 2.17 +* `#19238 `__: MAINT: replace imgmath with mathjax for docs +* `#19239 `__: BUG: Fix out-of-bounds access in convert_datetime_divisor_to_multiple +* `#19240 `__: ENH: Support major version larger than 9 in NumpyVersion +* `#19268 `__: DOC: fix duplicate navbar in development documentation index +* `#19269 `__: BUG: Invalid dtypes comparison should not raise TypeError +* `#19280 `__: BUG: Add missing DECREF in new path +* `#19283 `__: REL: Prepare for 1.21.0 release diff --git a/doc/neps/_static/nep-0047-casting-rules-lattice.png b/doc/neps/_static/nep-0047-casting-rules-lattice.png new file mode 100644 index 000000000000..669d3047683d Binary files /dev/null and b/doc/neps/_static/nep-0047-casting-rules-lattice.png differ diff --git a/doc/neps/_static/nep-0047-library-dependencies.png b/doc/neps/_static/nep-0047-library-dependencies.png new file mode 100644 index 000000000000..4eab600a5382 Binary files /dev/null and b/doc/neps/_static/nep-0047-library-dependencies.png differ diff --git a/doc/neps/_static/nep-0047-scope-of-array-API.png b/doc/neps/_static/nep-0047-scope-of-array-API.png new file mode 100644 index 000000000000..55253288c3a2 Binary files /dev/null and b/doc/neps/_static/nep-0047-scope-of-array-API.png differ diff --git a/doc/neps/nep-0000.rst b/doc/neps/nep-0000.rst index 590976081723..7f841b7e28fb 100644 --- a/doc/neps/nep-0000.rst +++ b/doc/neps/nep-0000.rst @@ -278,7 +278,7 @@ References and Footnotes .. [1] This historical record is available by the normal git commands for retrieving older revisions, and can also be browsed on - `GitHub `_. + `GitHub `_. .. [2] The URL for viewing NEPs on the web is https://www.numpy.org/neps/. diff --git a/doc/neps/nep-0001-npy-format.rst b/doc/neps/nep-0001-npy-format.rst index 3a28247ab9ed..fdf4ae47ae26 100644 --- a/doc/neps/nep-0001-npy-format.rst +++ b/doc/neps/nep-0001-npy-format.rst @@ -292,7 +292,7 @@ included in the 1.9.0 release of numpy. Specifically, the file format.py in this directory implements the format as described here. - https://github.com/numpy/numpy/blob/master/numpy/lib/format.py + https://github.com/numpy/numpy/blob/main/numpy/lib/format.py References diff --git a/doc/neps/nep-0010-new-iterator-ufunc.rst b/doc/neps/nep-0010-new-iterator-ufunc.rst index 358018c46417..4e7fdfdf5769 100644 --- a/doc/neps/nep-0010-new-iterator-ufunc.rst +++ b/doc/neps/nep-0010-new-iterator-ufunc.rst @@ -575,12 +575,16 @@ ndim, and niter will produce slightly different layouts. intp shape; /* The current coordinate along this axis */ intp coord; - /* The operand and index strides for this axis + /* The operand and index strides for this axis */ intp stride[niter]; - {intp indexstride;} #if (flags&FLAGS_HASINDEX); + #if (flags&FLAGS_HASINDEX) + intp indexstride; + #endif /* The operand pointers and index values for this axis */ char* ptr[niter]; - {intp index;} #if (flags&FLAGS_HASINDEX); + #if (flags&FLAGS_HASINDEX) + intp index; + #endif }[ndim]; }; diff --git a/doc/neps/nep-0013-ufunc-overrides.rst b/doc/neps/nep-0013-ufunc-overrides.rst index 698e45738708..ceb8b23e9587 100644 --- a/doc/neps/nep-0013-ufunc-overrides.rst +++ b/doc/neps/nep-0013-ufunc-overrides.rst @@ -46,8 +46,8 @@ right behaviour, hence the change in name.) The ``__array_ufunc__`` as described below requires that any corresponding Python binary operations (``__mul__`` et al.) should be -implemented in a specific way and be compatible with Numpy's ndarray -semantics. Objects that do not satisfy this cannot override any Numpy +implemented in a specific way and be compatible with NumPy's ndarray +semantics. Objects that do not satisfy this cannot override any NumPy ufuncs. We do not specify a future-compatible path by which this requirement can be relaxed --- any changes here require corresponding changes in 3rd party code. @@ -132,7 +132,7 @@ However, this behavior is more confusing than useful, and having a :exc:`TypeError` would be preferable. This proposal will *not* resolve the issue with scipy.sparse matrices, -which have multiplication semantics incompatible with numpy arrays. +which have multiplication semantics incompatible with NumPy arrays. However, the aim is to enable writing other custom array types that have strictly ndarray compatible semantics. @@ -246,7 +246,7 @@ three groups: - *Incompatible*: neither above nor below A; types for which no (indirect) upcasting is possible. -Note that the legacy behaviour of numpy ufuncs is to try to convert +Note that the legacy behaviour of NumPy ufuncs is to try to convert unknown objects to :class:`ndarray` via :func:`np.asarray`. This is equivalent to placing :class:`ndarray` above these objects in the graph. Since we above defined :class:`ndarray` to return `NotImplemented` for @@ -454,7 +454,7 @@ implements the following behavior: A class wishing to modify the interaction with :class:`ndarray` in binary operations therefore has two options: -1. Implement ``__array_ufunc__`` and follow Numpy semantics for Python +1. Implement ``__array_ufunc__`` and follow NumPy semantics for Python binary operations (see below). 2. Set ``__array_ufunc__ = None``, and implement Python binary @@ -478,7 +478,7 @@ are not compatible, i.e., implementations should be something like:: except AttributeError: return False - class ArrayLike(object): + class ArrayLike: ... def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): ... @@ -516,7 +516,7 @@ does not know how to deal with arrays and ufuncs, and thus has set ``__array_ufunc__`` to :obj:`None`, but does know how to do multiplication:: - class MyObject(object): + class MyObject: __array_ufunc__ = None def __init__(self, value): self.value = value @@ -678,7 +678,7 @@ NA ``abs`` :func:`absolute` Future extensions to other functions ------------------------------------ -Some numpy functions could be implemented as (generalized) Ufunc, in +Some NumPy functions could be implemented as (generalized) Ufunc, in which case it would be possible for them to be overridden by the ``__array_ufunc__`` method. A prime candidate is :func:`~numpy.matmul`, which currently is not a Ufunc, but could be relatively easily be diff --git a/doc/neps/nep-0014-dropping-python2.7-proposal.rst b/doc/neps/nep-0014-dropping-python2.7-proposal.rst index dfc09d2543c2..e14a173e2032 100644 --- a/doc/neps/nep-0014-dropping-python2.7-proposal.rst +++ b/doc/neps/nep-0014-dropping-python2.7-proposal.rst @@ -4,7 +4,7 @@ NEP 14 — Plan for dropping Python 2.7 support ============================================= -:Status: Accepted +:Status: Final :Resolution: https://mail.python.org/pipermail/numpy-discussion/2017-November/077419.html The Python core team plans to stop supporting Python 2 in 2020. The NumPy diff --git a/doc/neps/nep-0016-abstract-array.rst b/doc/neps/nep-0016-abstract-array.rst index 63ad600e9b3e..9d21abe6f4bb 100644 --- a/doc/neps/nep-0016-abstract-array.rst +++ b/doc/neps/nep-0016-abstract-array.rst @@ -141,7 +141,7 @@ Notes: In practice, either way we'd only do the full test after first checking for well-known types like ``ndarray``, ``list``, etc. `This is how NumPy currently checks for other double-underscore attributes -`__ +`__ and the same idea applies here to either approach. So these numbers won't affect the common case, just the case where we actually have an ``AbstractArray``, or else another third-party object that will end up diff --git a/doc/neps/nep-0023-backwards-compatibility.rst b/doc/neps/nep-0023-backwards-compatibility.rst index 158f46273f00..8b6f4cd1186a 100644 --- a/doc/neps/nep-0023-backwards-compatibility.rst +++ b/doc/neps/nep-0023-backwards-compatibility.rst @@ -5,10 +5,11 @@ NEP 23 — Backwards compatibility and deprecation policy ======================================================= :Author: Ralf Gommers -:Status: Draft +:Status: Final :Type: Process :Created: 2018-07-14 -:Resolution: (required for Accepted | Rejected | Withdrawn) +:Resolution: https://mail.python.org/pipermail/numpy-discussion/2021-January/081423.html + Abstract -------- @@ -19,46 +20,222 @@ processes for individual cases where breaking backwards compatibility is considered. -Detailed description +Motivation and Scope -------------------- NumPy has a very large user base. Those users rely on NumPy being stable and the code they write that uses NumPy functionality to keep working. NumPy is also actively maintained and improved -- and sometimes improvements -require, or are made much easier, by breaking backwards compatibility. +require, or are made easier, by breaking backwards compatibility. Finally, there are trade-offs in stability for existing users vs. avoiding errors or having a better user experience for new users. These competing -needs often give rise to heated debates and delays in accepting or rejecting +needs often give rise to long debates and delay accepting or rejecting contributions. This NEP tries to address that by providing a policy as well as examples and rationales for when it is or isn't a good idea to break backwards compatibility. -General principles: - -- Aim not to break users' code unnecessarily. -- Aim never to change code in ways that can result in users silently getting - incorrect results from their previously working code. -- Backwards incompatible changes can be made, provided the benefits outweigh - the costs. -- When assessing the costs, keep in mind that most users do not read the mailing - list, do not look at deprecation warnings, and sometimes wait more than one or - two years before upgrading from their old version. And that NumPy has - many hundreds of thousands or even a couple of million users, so "no one will - do or use this" is very likely incorrect. -- Benefits include improved functionality, usability and performance (in order - of importance), as well as lower maintenance cost and improved future - extensibility. -- Bug fixes are exempt from the backwards compatibility policy. However in case - of serious impact on users (e.g. a downstream library doesn't build anymore), - even bug fixes may have to be delayed for one or more releases. -- The Python API and the C API will be treated in the same way. - - -Examples -^^^^^^^^ - -We now discuss a number of concrete examples to illustrate typical issues -and trade-offs. +In addition, this NEP can serve as documentation for users about how the NumPy +project treats backwards compatibility, and the speed at which they can expect +changes to be made. + +In scope for this NEP are: + +- Principles of NumPy's approach to backwards compatibility. +- How to deprecate functionality, and when to remove already deprecated + functionality. +- Decision making process for deprecations and removals. +- How to ensure that users are well informed about any change. + +Out of scope are: + +- Making concrete decisions about deprecations of particular functionality. +- NumPy's versioning scheme. + + +General principles +------------------ + +When considering proposed changes that are backwards incompatible, the +main principles the NumPy developers use when making a decision are: + +1. Changes need to benefit more than they harm users. +2. NumPy is widely used, so breaking changes should be assumed by default to be + harmful. +3. Decisions should be based on how they affect users and downstream packages + and should be based on usage data where possible. It does not matter whether + this use contradicts the documentation or best practices. +4. The possibility of an incorrect result is worse than an error or even crash. + +When assessing the costs of proposed changes, keep in mind that most users do +not read the mailing list, do not notice deprecation warnings, and sometimes +wait more than one or two years before upgrading from their old version. And +that NumPy has millions of users, so "no one will do or use this" is likely +incorrect. + +Benefits of proposed changes can include improved functionality, usability and +performance, as well as lower maintenance cost and improved future +extensibility. + +Fixes for clear bugs are exempt from this backwards compatibility policy. +However, in case of serious impact on users even bug fixes may have to be +delayed for one or more releases. For example, if a downstream library would no +longer build or would give incorrect results. + + +Strategies related to deprecations +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Impact assessment +````````````````` + +Getting hard data on the impact of a deprecation of often difficult. Strategies +that can be used to assess such impact include: + +- Use a code search engine ([1]_, [2]_) or static ([3]_) or dynamic ([4]_) code + analysis tools to determine where and how the functionality is used. +- Test prominent downstream libraries against a development build of NumPy + containing the proposed change to get real-world data on its impact. +- Make a change on the main branch and revert it before release if it + causes problems. We encourage other packages to test against + NumPy's main branch and if that's too burdensome, then at least to + test pre-releases. This often turns up issues quickly. + +Alternatives to deprecations +```````````````````````````` + +If the impact is unclear or significant, it is often good to consider +alternatives to deprecations. For example, discouraging use in documentation +only, or moving the documentation for the functionality to a less prominent +place or even removing it completely. Commenting on open issues related to it +that they are low-prio or labeling them as "wontfix" will also be a signal to +users, and reduce the maintenance effort needing to be spent. + + +Implementing deprecations and removals +-------------------------------------- + +Deprecation warnings are necessary in all cases where functionality +will eventually be removed. If there is no intent to remove functionality, +then it should not be deprecated. A "please don't use this for new code" +in the documentation or other type of warning should be used instead, and the +documentation can be organized such that the preferred alternative is more +prominently shown. + +Deprecations: + +- shall include the version number of the release in which the functionality + was deprecated. +- shall include information on alternatives to the deprecated functionality, or a + reason for the deprecation if no clear alternative is available. Note that + release notes can include longer messages if needed. +- shall use ``DeprecationWarning`` by default, and ``VisibleDeprecation`` + for changes that need attention again after already having been deprecated or + needing extra attention for some reason. +- shall be listed in the release notes of the release where the deprecation is + first present. +- shall not be introduced in micro (bug fix) releases. +- shall set a ``stacklevel``, so the warning appears to come from the correct + place. +- shall be mentioned in the documentation for the functionality. A + ``.. deprecated::`` directive can be used for this. + +Examples of good deprecation warnings (also note standard form of the comments +above the warning, helps when grepping): + +.. code-block:: python + + # NumPy 1.15.0, 2018-09-02 + warnings.warn('np.asscalar(a) is deprecated since NumPy 1.16.0, use ' + 'a.item() instead', DeprecationWarning, stacklevel=3) + + # NumPy 1.15.0, 2018-02-10 + warnings.warn("Importing from numpy.testing.utils is deprecated " + "since 1.15.0, import from numpy.testing instead.", + DeprecationWarning, stacklevel=2) + + # NumPy 1.14.0, 2017-07-14 + warnings.warn( + "Reading unicode strings without specifying the encoding " + "argument is deprecated since NumPy 1.14.0. Set the encoding, " + "use None for the system default.", + np.VisibleDeprecationWarning, stacklevel=2) + +.. code-block:: C + + /* DEPRECATED 2020-05-13, NumPy 1.20 */ + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + matrix_deprecation_msg, ufunc->name, "first") < 0) { + return NULL; + } + +Removal of deprecated functionality: + +- shall be done after at least 2 releases assuming the current 6-monthly + release cycle; if that changes, there shall be at least 1 year between + deprecation and removal. +- shall be listed in the release notes of the release where the removal happened. +- can be done in any minor, but not bugfix, release. + +For backwards incompatible changes that aren't "deprecate and remove" but for +which code will start behaving differently, a ``FutureWarning`` should be +used. Release notes, mentioning version number and using ``stacklevel`` should +be done in the same way as for deprecation warnings. A ``.. versionchanged::`` +directive shall be used in the documentation after the behaviour change was +made to indicate when the behavior changed: + +.. code-block:: python + + def argsort(self, axis=np._NoValue, ...): + """ + Parameters + ---------- + axis : int, optional + Axis along which to sort. If None, the default, the flattened array + is used. + + .. versionchanged:: 1.13.0 + Previously, the default was documented to be -1, but that was + in error. At some future date, the default will change to -1, as + originally intended. + Until then, the axis should be given explicitly when + ``arr.ndim > 1``, to avoid a FutureWarning. + """ + ... + warnings.warn( + "In the future the default for argsort will be axis=-1, not the " + "current None, to match its documentation and np.argsort. " + "Explicitly pass -1 or None to silence this warning.", + MaskedArrayFutureWarning, stacklevel=3) + + +Decision making +--------------- + +In concrete cases where this policy needs to be applied, decisions are made according +to the `NumPy governance model +`_. + +All deprecations must be proposed on the mailing list in order to give everyone +with an interest in NumPy development a chance to comment. Removal of +deprecated functionality does not need discussion on the mailing list. + + +Functionality with more strict deprecation policies +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``numpy.random`` has its own backwards compatibility policy with additional + requirements on top of the ones in this NEP, see + `NEP 19 `_. +- The file format of ``.npy`` and ``.npz`` files is strictly versioned + independent of the NumPy version; existing format versions must remain + backwards compatible even if a newer format version is introduced. + + +Example cases +------------- + +We now discuss a few concrete examples from NumPy's history to illustrate +typical issues and trade-offs. **Changing the behavior of a function** @@ -89,21 +266,6 @@ forces users to change their code more than once, which is almost never the right thing to do. Instead, a better approach here would have been to deprecate ``histogram`` and introduce a new function ``hist`` in its place. -**Returning a view rather than a copy** - -The ``ndarray.diag`` method used to return a copy. A view would be better for -both performance and design consistency. This change was warned about -(``FutureWarning``) in v.8.0, and in v1.9.0 ``diag`` was changed to return -a *read-only* view. The planned change to a writeable view in v1.10.0 was -postponed due to backwards compatibility concerns, and is still an open issue -(gh-7661). - -What should have happened instead: nothing. This change resulted in a lot of -discussions and wasted effort, did not achieve its final goal, and was not that -important in the first place. Finishing the change to a *writeable* view in -the future is not desired, because it will result in users silently getting -different results if they upgraded multiple versions or simply missed the -warnings. **Disallowing indexing with floats** @@ -117,131 +279,33 @@ introduced for v1.11.0 and turned into a hard error for v1.12.0. This change was disruptive, however it did catch real bugs in, e.g., SciPy and scikit-learn. Overall the change was worth the cost, and introducing it in -master first to allow testing, then removing it again before a release, is a -useful strategy. +the main branch first to allow testing, then removing it again before +a release, is a useful strategy. -Similar recent deprecations also look like good examples of +Similar deprecations that also look like good examples of cleanups/improvements: -- removing deprecated boolean indexing (gh-8312) -- deprecating truth testing on empty arrays (gh-9718) -- deprecating ``np.sum(generator)`` (gh-10670, one issue with this one is that - its warning message is wrong - this should error in the future). +- removing deprecated boolean indexing (in 2016, see `gh-8312 `__) +- deprecating truth testing on empty arrays (in 2017, see `gh-9718 `__) + **Removing the financial functions** -The financial functions (e.g. ``np.pmt``) are badly named, are present in the -main NumPy namespace, and don't really fit well within NumPy's scope. -They were added in 2008 after +The financial functions (e.g. ``np.pmt``) had short non-descriptive names, were +present in the main NumPy namespace, and didn't really fit well within NumPy's +scope. They were added in 2008 after `a discussion `_ on the mailing list where opinion was divided (but a majority in favor). -At the moment these functions don't cause a lot of overhead, however there are -multiple issues and PRs a year for them which cost maintainer time to deal -with. And they clutter up the ``numpy`` namespace. Discussion in 2013 happened -on removing them again (gh-2880). - -This case is borderline, but given that they're clearly out of scope, -deprecation and removal out of at least the main ``numpy`` namespace can be -proposed. Alternatively, document clearly that new features for financial -functions are unwanted, to keep the maintenance costs to a minimum. - -**Examples of features not added because of backwards compatibility** - -TODO: do we have good examples here? Possibly subclassing related? - - -Removing complete submodules -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -This year there have been suggestions to consider removing some or all of -``numpy.distutils``, ``numpy.f2py``, ``numpy.linalg``, and ``numpy.random``. -The motivation was that all these cost maintenance effort, and that they slow -down work on the core of Numpy (ndarrays, dtypes and ufuncs). - -The impact on downstream libraries and users would be very large, and -maintenance of these modules would still have to happen. Therefore this is -simply not a good idea; removing these submodules should not happen even for -a new major version of NumPy. - - -Subclassing of ndarray -^^^^^^^^^^^^^^^^^^^^^^ - -Subclassing of ``ndarray`` is a pain point. ``ndarray`` was not (or at least -not well) designed to be subclassed. Despite that, a lot of subclasses have -been created even within the NumPy code base itself, and some of those (e.g. -``MaskedArray``, ``astropy.units.Quantity``) are quite popular. The main -problems with subclasses are: - -- They make it hard to change ``ndarray`` in ways that would otherwise be - backwards compatible. -- Some of them change the behavior of ndarray methods, making it difficult to - write code that accepts array duck-types. - -Subclassing ``ndarray`` has been officially discouraged for a long time. Of -the most important subclasses, ``np.matrix`` will be deprecated (see gh-10142) -and ``MaskedArray`` will be kept in NumPy (`NEP 17 -`_). -``MaskedArray`` will ideally be rewritten in a way such that it uses only -public NumPy APIs. For subclasses outside of NumPy, more work is needed to -provide alternatives (e.g. mixins, see gh-9016 and gh-10446) or better support -for custom dtypes (see gh-2899). Until that is done, subclasses need to be -taken into account when making change to the NumPy code base. A future change -in NumPy to not support subclassing will certainly need a major version -increase. - - -Policy ------- - -1. Code changes that have the potential to silently change the results of a users' - code must never be made (except in the case of clear bugs). -2. Code changes that break users' code (i.e. the user will see a clear exception) - can be made, *provided the benefit is worth the cost* and suitable deprecation - warnings have been raised first. -3. Deprecation warnings are in all cases warnings that functionality will be removed. - If there is no intent to remove functionality, then deprecation in documentation - only or other types of warnings shall be used. -4. Deprecations for stylistic reasons (e.g. consistency between functions) are - strongly discouraged. - -Deprecations: - -- shall include the version numbers of both when the functionality was deprecated - and when it will be removed (either two releases after the warning is - introduced, or in the next major version). -- shall include information on alternatives to the deprecated functionality, or a - reason for the deprecation if no clear alternative is available. -- shall use ``VisibleDeprecationWarning`` rather than ``DeprecationWarning`` - for cases of relevance to end users (as opposed to cases only relevant to - libraries building on top of NumPy). -- shall be listed in the release notes of the release where the deprecation happened. - -Removal of deprecated functionality: +The financial functions didn't cause a lot of overhead, however there were +still multiple issues and PRs a year for them which cost maintainer time to +deal with. And they cluttered up the ``numpy`` namespace. Discussion on +removing them was discussed in 2013 (gh-2880, rejected) and in 2019 +(:ref:`NEP32`, accepted without significant complaints). -- shall be done after 2 releases (assuming a 6-monthly release cycle; if that changes, - there shall be at least 1 year between deprecation and removal), unless the - impact of the removal is such that a major version number increase is - warranted. -- shall be listed in the release notes of the release where the removal happened. - -Versioning: - -- removal of deprecated code can be done in any minor (but not bugfix) release. -- for heavily used functionality (e.g. removal of ``np.matrix``, of a whole submodule, - or significant changes to behavior for subclasses) the major version number shall - be increased. - -In concrete cases where this policy needs to be applied, decisions are made according -to the `NumPy governance model -`_. - -Functionality with more strict policies: - -- ``numpy.random`` has its own backwards compatibility policy, - see `NEP 19 `_. -- The file format for ``.npy`` and ``.npz`` files must not be changed in a backwards - incompatible way. +Given that they were clearly outside of NumPy's scope, moving them to a +separate ``numpy-financial`` package and removing them from NumPy after a +deprecation period made sense. That also gave users an easy way to update +their code by doing `pip install numpy-financial`. Alternatives @@ -257,34 +321,31 @@ ecosystem - being fairly conservative is required in order to not increase the extra maintenance for downstream libraries and end users to an unacceptable level. -**Semantic versioning.** - -This would change the versioning scheme for code removals; those could then -only be done when the major version number is increased. Rationale for -rejection: semantic versioning is relatively common in software engineering, -however it is not at all common in the Python world. Also, it would mean that -NumPy's version number simply starts to increase faster, which would be more -confusing than helpful. gh-10156 contains more discussion on this alternative. - Discussion ---------- -TODO - -This section may just be a bullet list including links to any discussions -regarding the NEP: - -- This includes links to mailing list threads or relevant GitHub issues. +- `Mailing list discussion on the first version of this NEP in 2018 `__ +- `Mailing list discussion on the Dec 2020 update of this NEP `__ +- `PR with review comments on the the Dec 2020 update of this NEP `__ References and Footnotes ------------------------ -.. [1] TODO +- `Issue requesting semantic versioning `__ + +- `PEP 387 - Backwards Compatibility Policy `__ + +.. [1] https://searchcode.com/ + +.. [2] https://sourcegraph.com/search + +.. [3] https://github.com/Quansight-Labs/python-api-inspect +.. [4] https://github.com/data-apis/python-record-api Copyright --------- -This document has been placed in the public domain. [1]_ +This document has been placed in the public domain. diff --git a/doc/neps/nep-0024-missing-data-2.rst b/doc/neps/nep-0024-missing-data-2.rst index 8e63629f32be..903ece1ba8e0 100644 --- a/doc/neps/nep-0024-missing-data-2.rst +++ b/doc/neps/nep-0024-missing-data-2.rst @@ -14,7 +14,7 @@ Abstract -------- *Context: this NEP was written as an alternative to NEP 12, which at the time of writing -had an implementation that was merged into the NumPy master branch.* +had an implementation that was merged into the NumPy main branch.* The principle of this NEP is to separate the APIs for masking and for missing values, according to diff --git a/doc/neps/nep-0025-missing-data-3.rst b/doc/neps/nep-0025-missing-data-3.rst index ffe208c98070..1756ce491188 100644 --- a/doc/neps/nep-0025-missing-data-3.rst +++ b/doc/neps/nep-0025-missing-data-3.rst @@ -14,7 +14,7 @@ Abstract *Context: this NEP was written as an additional alternative to NEP 12 (NEP 24 is another alternative), which at the time of writing had an implementation -that was merged into the NumPy master branch.* +that was merged into the NumPy main branch.* To try and make more progress on the whole missing values/masked arrays/... debate, it seems useful to have a more technical discussion of the pieces @@ -62,7 +62,7 @@ values, (4) it is compatible with the common practice of using NaN to indicate missingness when working with floating point numbers, (5) the dtype is already a place where "weird things can happen" -- there are a wide variety of dtypes that don't act like ordinary numbers (including structs, Python objects, -fixed-length strings, ...), so code that accepts arbitrary numpy arrays already +fixed-length strings, ...), so code that accepts arbitrary NumPy arrays already has to be prepared to handle these (even if only by checking for them and raising an error). Therefore adding yet more new dtypes has less impact on extension authors than if we change the ndarray object itself. @@ -96,7 +96,7 @@ for consistency. General strategy ================ -Numpy already has a general mechanism for defining new dtypes and slotting them +NumPy already has a general mechanism for defining new dtypes and slotting them in so that they're supported by ndarrays, by the casting machinery, by ufuncs, and so on. In principle, we could implement NA-dtypes just using these existing interfaces. But we don't want to do that, because defining all those new ufunc @@ -271,7 +271,7 @@ below. Casting ------- -FIXME: this really needs attention from an expert on numpy's casting rules. But +FIXME: this really needs attention from an expert on NumPy's casting rules. But I can't seem to find the docs that explain how casting loops are looked up and decided between (e.g., if you're casting from dtype A to dtype B, which dtype's loops are used?), so I can't go into details. But those details are tricky and @@ -338,7 +338,7 @@ Printing -------- FIXME: There should be some sort of mechanism by which values which are NA are -automatically repr'ed as NA, but I don't really understand how numpy printing +automatically repr'ed as NA, but I don't really understand how NumPy printing works, so I'll let someone else fill in this section. Indexing @@ -364,10 +364,10 @@ own global singleton.) So for now we stick to scalar indexing just returning Python API for generic NA support ================================= -NumPy will gain a global singleton called numpy.NA, similar to None, but with +NumPy will gain a global singleton called ``numpy.NA``, similar to None, but with semantics reflecting its status as a missing value. In particular, trying to treat it as a boolean will raise an exception, and comparisons with it will -produce numpy.NA instead of True or False. These basics are adopted from the +produce ``numpy.NA`` instead of True or False. These basics are adopted from the behavior of the NA value in the R project. To dig deeper into the ideas, http://en.wikipedia.org/wiki/Ternary_logic#Kleene_logic provides a starting point. @@ -453,8 +453,8 @@ The NEP also contains a proposal for a somewhat elaborate domain-specific-language for describing NA dtypes. I'm not sure how great an idea that is. (I have a bias against using strings as data structures, and find the already existing strings confusing enough as it is -- also, apparently the -NEP version of numpy uses strings like 'f8' when printing dtypes, while my -numpy uses object names like 'float64', so I'm not sure what's going on there. +NEP version of NumPy uses strings like 'f8' when printing dtypes, while my +NumPy uses object names like 'float64', so I'm not sure what's going on there. ``withNA(float64, arg1=value1)`` seems like a more pleasant way to print a dtype than "NA[f8,value1]", at least to me.) But if people want it, then cool. diff --git a/doc/neps/nep-0026-missing-data-summary.rst b/doc/neps/nep-0026-missing-data-summary.rst index f25ce9b91274..49d89d828449 100644 --- a/doc/neps/nep-0026-missing-data-summary.rst +++ b/doc/neps/nep-0026-missing-data-summary.rst @@ -17,7 +17,7 @@ The debate about how NumPy should handle missing data, a subject with many preexisting approaches, requirements, and conventions, has been long and contentious. There has been more than one proposal for how to implement support into NumPy, and there is a testable implementation which is -merged into NumPy's current master. The vast number of emails and differing +merged into NumPy's current main. The vast number of emails and differing points of view has made it difficult for interested parties to understand the issues and be comfortable with the direction NumPy is going. @@ -565,7 +565,7 @@ Recommendations for Moving Forward we're going to have to figure out how to experiment with such changes out-of-core if NumPy is to continue to evolve without forking -- might as well do it now. The existing code can live in - master, disabled, or it can live in a branch -- it'll still be there + the main branch, be disabled, or live its own branch -- it'll still be there once we know what we're doing. **Mark** thinks we should: @@ -576,8 +576,8 @@ Recommendations for Moving Forward A more detailed rationale for this recommendation is: * A solid preliminary NA-mask implementation is currently in NumPy - master. This implementation has been extensively tested - against scipy and other third-party packages, and has been in master + main. This implementation has been extensively tested + against scipy and other third-party packages, and has been in main in a stable state for a significant amount of time. * This implementation integrates deeply with the core, providing an interface which is usable in the same way R's NA support is. It diff --git a/doc/neps/nep-0027-zero-rank-arrarys.rst b/doc/neps/nep-0027-zero-rank-arrarys.rst index 2d152234cf44..cb39726759ba 100644 --- a/doc/neps/nep-0027-zero-rank-arrarys.rst +++ b/doc/neps/nep-0027-zero-rank-arrarys.rst @@ -57,7 +57,7 @@ However there are some important differences: Motivation for Array Scalars ---------------------------- -Numpy's design decision to provide 0-d arrays and array scalars in addition to +NumPy's design decision to provide 0-d arrays and array scalars in addition to native python types goes against one of the fundamental python design principles that there should be only one obvious way to do it. In this section we will try to explain why it is necessary to have three different ways to @@ -109,7 +109,7 @@ arrays to scalars were summarized as follows: are something like Python lists (which except for Object arrays they are not). -Numpy implements a solution that is designed to have all the pros and none of the cons above. +NumPy implements a solution that is designed to have all the pros and none of the cons above. Create Python scalar types for all of the 21 types and also inherit from the three that already exist. Define equivalent diff --git a/doc/neps/nep-0028-website-redesign.rst b/doc/neps/nep-0028-website-redesign.rst index e27da91c6c8b..592209a5ff89 100644 --- a/doc/neps/nep-0028-website-redesign.rst +++ b/doc/neps/nep-0028-website-redesign.rst @@ -7,7 +7,7 @@ NEP 28 — numpy.org website redesign :Author: Ralf Gommers :Author: Joe LaChance :Author: Shekhar Rajak -:Status: Accepted +:Status: Final :Type: Informational :Created: 2019-07-16 :Resolution: https://mail.python.org/pipermail/numpy-discussion/2019-August/079889.html @@ -323,7 +323,9 @@ Alternatives we considered for the overall design of the website: Discussion ---------- -Mailing list thread discussing this NEP: TODO +- Pull request for this NEP (with a good amount of discussion): https://github.com/numpy/numpy/pull/14032 +- Email about NEP for review: https://mail.python.org/pipermail/numpy-discussion/2019-July/079856.html +- Proposal to accept this NEP: https://mail.python.org/pipermail/numpy-discussion/2019-August/079889.html References and Footnotes diff --git a/doc/neps/nep-0029-deprecation_policy.rst b/doc/neps/nep-0029-deprecation_policy.rst index 957674ee6e20..a50afcb98f9d 100644 --- a/doc/neps/nep-0029-deprecation_policy.rst +++ b/doc/neps/nep-0029-deprecation_policy.rst @@ -1,7 +1,7 @@ .. _NEP29: ================================================================================== -NEP 29 — Recommend Python and Numpy version support as a community policy standard +NEP 29 — Recommend Python and NumPy version support as a community policy standard ================================================================================== @@ -124,14 +124,14 @@ Drop Schedule :: On next release, drop support for Python 3.5 (initially released on Sep 13, 2015) - On Jan 07, 2020 drop support for Numpy 1.14 (initially released on Jan 06, 2018) + On Jan 07, 2020 drop support for NumPy 1.14 (initially released on Jan 06, 2018) On Jun 23, 2020 drop support for Python 3.6 (initially released on Dec 23, 2016) - On Jul 23, 2020 drop support for Numpy 1.15 (initially released on Jul 23, 2018) - On Jan 13, 2021 drop support for Numpy 1.16 (initially released on Jan 13, 2019) - On Jul 26, 2021 drop support for Numpy 1.17 (initially released on Jul 26, 2019) - On Dec 22, 2021 drop support for Numpy 1.18 (initially released on Dec 22, 2019) + On Jul 23, 2020 drop support for NumPy 1.15 (initially released on Jul 23, 2018) + On Jan 13, 2021 drop support for NumPy 1.16 (initially released on Jan 13, 2019) + On Jul 26, 2021 drop support for NumPy 1.17 (initially released on Jul 26, 2019) + On Dec 22, 2021 drop support for NumPy 1.18 (initially released on Dec 22, 2019) On Dec 26, 2021 drop support for Python 3.7 (initially released on Jun 27, 2018) - On Jun 21, 2022 drop support for Numpy 1.19 (initially released on Jun 20, 2020) + On Jun 21, 2022 drop support for NumPy 1.19 (initially released on Jun 20, 2020) On Apr 14, 2023 drop support for Python 3.8 (initially released on Oct 14, 2019) @@ -249,18 +249,18 @@ Code to generate support and drop schedule tables :: from datetime import datetime, timedelta - data = """Jan 15, 2017: Numpy 1.12 + data = """Jan 15, 2017: NumPy 1.12 Sep 13, 2015: Python 3.5 Dec 23, 2016: Python 3.6 Jun 27, 2018: Python 3.7 - Jun 07, 2017: Numpy 1.13 - Jan 06, 2018: Numpy 1.14 - Jul 23, 2018: Numpy 1.15 - Jan 13, 2019: Numpy 1.16 - Jul 26, 2019: Numpy 1.17 + Jun 07, 2017: NumPy 1.13 + Jan 06, 2018: NumPy 1.14 + Jul 23, 2018: NumPy 1.15 + Jan 13, 2019: NumPy 1.16 + Jul 26, 2019: NumPy 1.17 Oct 14, 2019: Python 3.8 - Dec 22, 2019: Numpy 1.18 - Jun 20, 2020: Numpy 1.19 + Dec 22, 2019: NumPy 1.18 + Jun 20, 2020: NumPy 1.19 """ releases = [] @@ -284,7 +284,7 @@ Code to generate support and drop schedule tables :: py_major,py_minor = sorted([int(x) for x in r[2].split('.')] for r in releases if r[1] == 'Python')[-1] minpy = f"{py_major}.{py_minor+1}+" - num_major,num_minor = sorted([int(x) for x in r[2].split('.')] for r in releases if r[1] == 'Numpy')[-1] + num_major,num_minor = sorted([int(x) for x in r[2].split('.')] for r in releases if r[1] == 'NumPy')[-1] minnum = f"{num_major}.{num_minor+1}+" toprint_drop_dates = [''] diff --git a/doc/neps/nep-0032-remove-financial-functions.rst b/doc/neps/nep-0032-remove-financial-functions.rst index 1c3722f46cb3..b57ae943fa96 100644 --- a/doc/neps/nep-0032-remove-financial-functions.rst +++ b/doc/neps/nep-0032-remove-financial-functions.rst @@ -5,7 +5,7 @@ NEP 32 — Remove the financial functions from NumPy ================================================== :Author: Warren Weckesser -:Status: Accepted +:Status: Final :Type: Standards Track :Created: 2019-08-30 :Resolution: https://mail.python.org/pipermail/numpy-discussion/2019-September/080074.html @@ -174,19 +174,19 @@ References and footnotes .. [1] Financial functions, https://numpy.org/doc/1.17/reference/routines.financial.html -.. [2] Numpy-discussion mailing list, "Simple financial functions for NumPy", +.. [2] NumPy-Discussion mailing list, "Simple financial functions for NumPy", https://mail.python.org/pipermail/numpy-discussion/2008-April/032353.html -.. [3] Numpy-discussion mailing list, "add xirr to numpy financial functions?", +.. [3] NumPy-Discussion mailing list, "add xirr to numpy financial functions?", https://mail.python.org/pipermail/numpy-discussion/2009-May/042645.html -.. [4] Numpy-discussion mailing list, "Definitions of pv, fv, nper, pmt, and rate", +.. [4] NumPy-Discussion mailing list, "Definitions of pv, fv, nper, pmt, and rate", https://mail.python.org/pipermail/numpy-discussion/2009-June/043188.html .. [5] Get financial functions out of main namespace, https://github.com/numpy/numpy/issues/2880 -.. [6] Numpy-discussion mailing list, "Deprecation of financial routines", +.. [6] NumPy-Discussion mailing list, "Deprecation of financial routines", https://mail.python.org/pipermail/numpy-discussion/2013-August/067409.html .. [7] ``component: numpy.lib.financial`` issues, @@ -198,7 +198,7 @@ References and footnotes .. [9] Quansight-Labs/python-api-inspect, https://github.com/Quansight-Labs/python-api-inspect/ -.. [10] Numpy-discussion mailing list, "NEP 32: Remove the financial functions +.. [10] NumPy-Discussion mailing list, "NEP 32: Remove the financial functions from NumPy" https://mail.python.org/pipermail/numpy-discussion/2019-September/079965.html @@ -206,7 +206,7 @@ References and footnotes remove the financial functions. https://mail.google.com/mail/u/0/h/1w0mjgixc4rpe/?&th=16d5c38be45f77c4&q=nep+32&v=c&s=q -.. [12] Numpy-discussion mailing list, "Proposal to accept NEP 32: Remove the +.. [12] NumPy-Discussion mailing list, "Proposal to accept NEP 32: Remove the financial functions from NumPy" https://mail.python.org/pipermail/numpy-discussion/2019-September/080074.html diff --git a/doc/neps/nep-0035-array-creation-dispatch-with-array-function.rst b/doc/neps/nep-0035-array-creation-dispatch-with-array-function.rst index 5ec01081a9b0..3a689a4dcd24 100644 --- a/doc/neps/nep-0035-array-creation-dispatch-with-array-function.rst +++ b/doc/neps/nep-0035-array-creation-dispatch-with-array-function.rst @@ -5,11 +5,11 @@ NEP 35 — Array Creation Dispatching With __array_function__ =========================================================== :Author: Peter Andreas Entschev -:Status: Draft +:Status: Final :Type: Standards Track :Created: 2019-10-15 :Updated: 2020-11-06 -:Resolution: +:Resolution: https://mail.python.org/pipermail/numpy-discussion/2021-May/081761.html Abstract -------- @@ -327,7 +327,7 @@ The first version of this proposal suggested the implementation above as one viable solution for NumPy functions implemented in C. However, due to the downsides pointed out above we have decided to discard any changes on the Python side and resolve those issues with a pure-C implementation. Please refer to -[implementation]_ for details. +[7]_ for details. Reading the Reference Array Downstream ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -344,6 +344,7 @@ An example of such use is to create a new Dask array while preserving its backend type: .. code:: python + # Returns dask.array np.asarray([1, 2, 3], like=da.array(cp.array(()))) @@ -357,6 +358,7 @@ not use the ``like=`` argument via the ``self`` attribute from instead: .. code:: python + # Returns dask.array np.asarray([1, 2, 3], like=da.array(cp.array(()))) @@ -379,6 +381,7 @@ implemented in Dask. The current relevant part of ``__array_function__`` definition in Dask is seen below: .. code:: python + def __array_function__(self, func, types, args, kwargs): # Code not relevant for this example here @@ -388,6 +391,7 @@ definition in Dask is seen below: And this is how the updated code would look like: .. code:: python + def __array_function__(self, func, types, args, kwargs): # Code not relevant for this example here @@ -419,8 +423,9 @@ by downstream libraries is beyond the scope of the present proposal. Discussion ---------- -.. [implementation] `Implementation's pull request on GitHub `_ -.. [discussion] `Further discussion on implementation and the NEP's content `_ +- `Further discussion on implementation and the NEP's content `_ +- `Decision to release an experimental implementation in NumPy 1.20.0 `__ + References ---------- @@ -437,6 +442,8 @@ References .. [6] `NEP 37 — A dispatch protocol for NumPy-like modules `_. +.. [7] `Implementation's pull request on GitHub `_ + Copyright --------- diff --git a/doc/neps/nep-0036-fair-play.rst b/doc/neps/nep-0036-fair-play.rst index 32e5e1e75c03..34c8f6eb8286 100644 --- a/doc/neps/nep-0036-fair-play.rst +++ b/doc/neps/nep-0036-fair-play.rst @@ -48,7 +48,7 @@ identifying the problematic release, locating alterations, and determining an appropriate course of action. During a community call on `October 16th, 2019 -`__ +`__ the community resolved to draft guidelines on the distribution of modified NumPy versions. @@ -129,7 +129,7 @@ Fair play rules discussion on the mailing list before monkeypatching NumPy. Questions and answers -------------------- +--------------------- **Q:** We would like to distribute an optimized version of NumPy that utilizes special instructions for our company's CPU. You recommend diff --git a/doc/neps/nep-0040-legacy-datatype-impl.rst b/doc/neps/nep-0040-legacy-datatype-impl.rst index 39889109de40..7ea7f6df35e9 100644 --- a/doc/neps/nep-0040-legacy-datatype-impl.rst +++ b/doc/neps/nep-0040-legacy-datatype-impl.rst @@ -6,7 +6,7 @@ NEP 40 — Legacy Datatype Implementation in NumPy :title: Legacy Datatype Implementation in NumPy :Author: Sebastian Berg -:Status: Draft +:Status: Final :Type: Informational :Created: 2019-07-17 diff --git a/doc/neps/nep-0042-new-dtypes.rst b/doc/neps/nep-0042-new-dtypes.rst index d1ddb7101706..bb85f1d10cba 100644 --- a/doc/neps/nep-0042-new-dtypes.rst +++ b/doc/neps/nep-0042-new-dtypes.rst @@ -8,10 +8,10 @@ NEP 42 — New and extensible DTypes :Author: Sebastian Berg :Author: Ben Nathanson :Author: Marten van Kerkwijk -:Status: Draft +:Status: Accepted :Type: Standard :Created: 2019-07-17 - +:Resolution: https://mail.python.org/pipermail/numpy-discussion/2020-October/081038.html .. note:: @@ -203,7 +203,7 @@ Other elements of the casting implementation is the ``CastingImpl``: # Object describing and performing the cast casting : casting - def resolve_descriptors(self, Tuple[DType] : input) -> (casting, Tuple[DType]): + def resolve_descriptors(self, Tuple[DTypeMeta], Tuple[DType|None] : input) -> (casting, Tuple[DType]): raise NotImplementedError # initially private: @@ -213,6 +213,8 @@ Other elements of the casting implementation is the ``CastingImpl``: which describes the casting from one DType to another. In :ref:`NEP 43 ` this ``CastingImpl`` object is used unchanged to support universal functions. +Note that the name ``CastingImpl`` here will be generically called +``ArrayMethod`` to accomodate both casting and universal functions. ****************************************************************************** @@ -525,7 +527,8 @@ This means the implementation will work like this:: # Find what dtype1 is cast to when cast to the common DType # by using the CastingImpl as described below: castingimpl = get_castingimpl(type(dtype1), common) - safety, (_, dtype1) = castingimpl.resolve_descriptors((dtype1, None)) + safety, (_, dtype1) = castingimpl.resolve_descriptors( + (common, common), (dtype1, None)) assert safety == "safe" # promotion should normally be a safe cast if type(dtype2) is not common: @@ -652,7 +655,7 @@ and implements the following methods and attributes: * To report safeness, - ``resolve_descriptors(self, Tuple[DType] : input) -> casting, Tuple[DType]``. + ``resolve_descriptors(self, Tuple[DTypeMeta], Tuple[DType|None] : input) -> casting, Tuple[DType]``. The ``casting`` output reports safeness (safe, unsafe, or same-kind), and the tuple is used for more multistep casting, as in the example below. @@ -691,7 +694,7 @@ The full process is: 1. Call - ``CastingImpl[Int24, String].resolve_descriptors((int24, "S20"))``. + ``CastingImpl[Int24, String].resolve_descriptors((Int24, String), (int24, "S20"))``. This provides the information that ``CastingImpl[Int24, String]`` only implements the cast of ``int24`` to ``"S8"``. @@ -716,7 +719,7 @@ The full process is: to call - ``CastingImpl[Int24, String].resolve_descriptors((int24, None))``. + ``CastingImpl[Int24, String].resolve_descriptors((Int24, String), (int24, None))``. In this case the result of ``(int24, "S8")`` defines the correct cast: @@ -763,8 +766,8 @@ even if the user provides only an ``int16 -> int24`` cast. This proposal does not provide that, but future work might find such casts dynamically, or at least allow ``resolve_descriptors`` to return arbitrary ``dtypes``. -If ``CastingImpl[Int8, Int24].resolve_descriptors((int8, int24))`` returns -``(int16, int24)``, the actual casting process could be extended to include +If ``CastingImpl[Int8, Int24].resolve_descriptors((Int8, Int24), (int8, int24))`` +returns ``(int16, int24)``, the actual casting process could be extended to include the ``int8 -> int16`` cast. This adds a step. @@ -774,7 +777,7 @@ The implementation for casting integers to datetime would generally say that this cast is unsafe (because it is always an unsafe cast). Its ``resolve_descriptors`` function may look like:: - def resolve_descriptors(self, given_dtypes): + def resolve_descriptors(self, DTypes, given_dtypes): from_dtype, to_dtype = given_dtypes from_dtype = from_dtype.ensure_canonical() # ensure not byte-swapped if to_dtype is None: @@ -835,9 +838,10 @@ Its ``resolve_descriptors`` function may look like:: **Notes:** -The proposed ``CastingImpl`` is designed to be identical to the -``PyArrayMethod`` proposed in NEP43 as part of restructuring ufuncs to handle -new DTypes. +``CastingImpl`` is used as a name in this NEP to clarify that it implements +all functionality related to a cast. It is meant to be identical to the +``ArrayMethod`` proposed in NEP 43 as part of restructuring ufuncs to handle +new DTypes. All type definitions are expected to be named ``ArrayMethod``. The way dispatching works for ``CastingImpl`` is planned to be limited initially and fully opaque. In the future, it may or may not be moved into a @@ -1297,8 +1301,9 @@ The external API for ``CastingImpl`` will be limited initially to defining: instance if the second string is shorter. If neither type is parametric the ``resolve_descriptors`` must use it. -* ``resolve_descriptors(dtypes_in[2], dtypes_out[2], casting_out) -> int {0, - -1}`` The out +* ``resolve_descriptors(PyArrayMethodObject *self, PyArray_DTypeMeta *DTypes[2], + PyArray_Descr *dtypes_in[2], PyArray_Descr *dtypes_out[2], NPY_CASTING *casting_out) + -> int {0, -1}`` The out dtypes must be set correctly to dtypes which the strided loop (transfer function) can handle. Initially the result must have instances of the same DType class as the ``CastingImpl`` is defined for. The @@ -1307,9 +1312,12 @@ The external API for ``CastingImpl`` will be limited initially to defining: A new, additional flag, ``_NPY_CAST_IS_VIEW``, can be set to indicate that no cast is necessary and a view is sufficient to perform the cast. The cast should return - ``-1`` when a custom error is set and ``NPY_NO_CASTING`` to indicate - that a generic casting error should be set (this is in most cases - preferable). + ``-1`` when an error occurred. If a cast is not possible (but no error + occurred), a ``-1`` result should be returned *without* an error set. + *This point is under consideration, we may use ``-1`` to indicate + a general error, and use a different return value for an impossible cast.* + This means that it is *not* possible to inform the user about why a cast is + impossible. * ``strided_loop(char **args, npy_intp *dimensions, npy_intp *strides, ...) -> int {0, -1}`` (signature will be fully defined in :ref:`NEP 43 `) @@ -1326,7 +1334,7 @@ Although verbose, the API will mimic the one for creating a new DType: typedef struct{ int flags; /* e.g. whether the cast requires the API */ int nin, nout; /* Number of Input and outputs (always 1) */ - NPY_CASTING casting; /* The default casting level */ + NPY_CASTING casting; /* The "minimal casting level" */ PyArray_DTypeMeta *dtypes; /* input and output DType class */ /* NULL terminated slots defining the methods */ PyType_Slot *slots; @@ -1334,7 +1342,7 @@ Although verbose, the API will mimic the one for creating a new DType: The focus differs between casting and general ufuncs. For example, for casts ``nin == nout == 1`` is always correct, while for ufuncs ``casting`` is -expected to be usually `"safe"`. +expected to be usually `"no"`. **Notes:** We may initially allow users to define only a single loop. Internally NumPy optimizes far more, and this should be made public @@ -1349,6 +1357,11 @@ incrementally in one of two ways: * Or, more likely, expose the ``get_loop`` function which is passed additional information, such as the fixed strides (similar to our internal API). +* The casting level denotes the minimal guaranteed casting level and can be + ``-1`` if the cast may be impossible. For most non-parametric casts, this + value will be the casting level. NumPy may skip the ``resolve_descriptors`` + call for ``np.can_cast()`` when the result is ``True`` based on this level. + The example does not yet include setup and error handling. Since these are similar to the UFunc machinery, they will be defined in :ref:`NEP 43 ` and then incorporated identically into casting. diff --git a/doc/neps/nep-0043-extensible-ufuncs.rst b/doc/neps/nep-0043-extensible-ufuncs.rst index 96d4794f3774..cd73108e4fbb 100644 --- a/doc/neps/nep-0043-extensible-ufuncs.rst +++ b/doc/neps/nep-0043-extensible-ufuncs.rst @@ -150,6 +150,11 @@ The masked type resolvers specifically will *not* remain supported, but has no known users (including NumPy itself, which only uses the default version). +Further, no compatibility attempt will be made for *calling* as opposed +to providing either the normal or the masked type resolver. As NumPy +will use it only as a fallback. There are no known users of this +(undocumented) possibility. + While the above changes potentially break some workflows, we believe that the long-term improvements vastly outweigh this. Further, packages such as astropy and Numba are capable of adapting so that @@ -235,20 +240,30 @@ to define string equality, will be added to a ufunc. class StringEquality(BoundArrayMethod): nin = 1 nout = 1 + # DTypes are stored on the BoundArrayMethod and not on the internal + # ArrayMethod, to reference cyles. DTypes = (String, String, Bool) - def resolve_descriptors(context, given_descrs): + def resolve_descriptors(self: ArrayMethod, DTypes, given_descrs): """The strided loop supports all input string dtype instances and always returns a boolean. (String is always native byte order.) Defining this function is not necessary, since NumPy can provide it by default. + + The `self` argument here refers to the unbound array method, so + that DTypes are passed in explicitly. """ - assert isinstance(given_descrs[0], context.DTypes[0]) - assert isinstance(given_descrs[1], context.DTypes[1]) + assert isinstance(given_descrs[0], DTypes[0]) + assert isinstance(given_descrs[1], DTypes[1]) + assert given_descrs[2] is None or isinstance(given_descrs[2], DTypes[2]) - # The operation is always "safe" casting (most ufuncs are) - return (given_descrs[0], given_descrs[1], context.DTypes[2]()), "safe" + out_descr = given_descrs[2] # preserve input (e.g. metadata) + if given_descrs[2] is None: + out_descr = DTypes[2]() + + # The operation is always "no" casting (most ufuncs are) + return (given_descrs[0], given_descrs[1], out_descr), "no" def strided_loop(context, dimensions, data, strides, innerloop_data): """The 1-D strided loop, similar to those used in current ufuncs""" @@ -322,12 +337,12 @@ steps involved in a call to a universal function in NumPy. A UFunc call is split into the following steps: -1. *Handle ``__array_ufunc__`` protocol:* +1. Handle ``__array_ufunc__`` protocol: * For array-likes such as a Dask arrays, NumPy can defer the operation. This step is performed first, and unaffected by this NEP (compare :ref:`NEP18`). -2. *Promotion and dispatching* +2. Promotion and dispatching * Given the DTypes of all inputs, find the correct implementation. E.g. an implementation for ``float64``, ``int64`` or a user-defined DType. @@ -336,7 +351,7 @@ A UFunc call is split into the following steps: For example, adding a ``float32`` and a ``float64`` is implemented by first casting the ``float32`` to ``float64``. -3. *Parametric ``dtype`` resolution:* +3. Parametric ``dtype`` resolution: * In general, whenever an output DType is parametric the parameters have to be found (resolved). @@ -347,15 +362,16 @@ A UFunc call is split into the following steps: which fills in the default dtype instances (ensuring for example native byte order). -4. *Preparing the iteration:* +4. Preparing the iteration: * This step is largely handled by ``NpyIter`` internally (the iterator). * Allocate all outputs and temporary buffers necessary to perform casts. + This *requires* the dtypes as resolved in step 3. * Find the best iteration order, which includes information to efficiently implement broadcasting. For example, adding a single value to an array repeats the same value. -5. *Setup and fetch the C-level function:* +5. Setup and fetch the C-level function: * If necessary, allocate temporary working space. * Find the C-implemented, light weight, inner-loop function. @@ -368,33 +384,35 @@ A UFunc call is split into the following steps: the GIL may be released (to allow threading). * Clear floating point exception flags. -6. *Perform the actual calculation:* +6. Perform the actual calculation: * Run the DType specific inner-loop function. * The inner-loop may require access to additional data, such as dtypes or additional data set in the previous step. * The inner-loop function may be called an undefined number of times. -7. *Finalize:* +7. Finalize: - * Free any temporary working space allocated in 5. + * Free any temporary working space allocated in step 5. * Check for floating point exception flags. * Return the result. The ``ArrayMethod`` provides a concept to group steps 3 to 6 and partially 7. -However, implementers of a new ufunc or ``ArrayMethod`` do not need to -customize the behaviour in steps 4 or 6, aside from the inner-loop function. -For the ``ArrayMethod`` implementer, the central steps to have control over -are step 3 and step 5 to provide the custom inner-loop function. -Further customization is a potential future extension. +However, implementers of a new ufunc or ``ArrayMethod`` usually do not need to +customize the behaviour in steps 4 or 6 which NumPy can and does provide. +For the ``ArrayMethod`` implementer, the central steps to customize +are step 3 and step 5. These provide the custom inner-loop function and +potentially inner-loop specific setup. +Further customization is possible and anticipated as future extensions. -Step 2. is promotion and dispatching which will also be restructured -with new API which allows influencing the process where necessary. +Step 2. is promotion and dispatching and will be restructured +with new API to allow customization of the process where necessary. Step 1 is listed for completeness and is unaffected by this NEP. The following sketch provides an overview of step 2 to 6 with an emphasize -of how dtypes are handled: +of how dtypes are handled and which parts are customizable ("Registered") +and which are handled by NumPy: .. figure:: _static/nep43-sketch.svg :figclass: align-center @@ -410,21 +428,19 @@ We use the ``class`` syntax to describe the information required to create a new ``ArrayMethod`` object: .. code-block:: python - :dedent: 0 class ArrayMethod: name: str # Name, mainly useful for debugging # Casting safety information (almost always "safe", necessary to # unify casting and universal functions) - casting: Casting = "safe" + casting: Casting = "no" # More general flags: flags: int - @staticmethod - def resolve_descriptors( - Context: context, Tuple[DType]: given_descrs)-> Casting, Tuple[DType]: + def resolve_descriptors(self, + Tuple[DTypeMeta], Tuple[DType|None]: given_descrs) -> Casting, Tuple[DType]: """Returns the safety of the operation (casting safety) and the """ # A default implementation can be provided for non-parametric @@ -456,7 +472,6 @@ a new ``ArrayMethod`` object: With ``Context`` providing mostly static information about the function call: .. code-block:: python - :dedent: 0 class Context: # The ArrayMethod object itself: @@ -468,8 +483,6 @@ With ``Context`` providing mostly static information about the function call: int : nin = 1 # The number of output arguments: int : nout = 1 - # The DTypes this Method operates on/is defined for: - Tuple[DTypeMeta] : dtypes # The actual dtypes instances the inner-loop operates on: Tuple[DType] : descriptors @@ -616,7 +629,8 @@ definitions (see also :ref:`NEP 42 ` ``CastingImpl``): NPY_CASTING resolve_descriptors( - PyArrayMethod_Context *context, + PyArrayMethodObject *self, + PyArray_DTypeMeta *dtypes, PyArray_Descr *given_dtypes[nin+nout], PyArray_Descr *loop_dtypes[nin+nout]); @@ -647,25 +661,25 @@ definitions (see also :ref:`NEP 42 ` ``CastingImpl``): for example for implementing warnings (see Error and Warning Handling below). To simplify this NumPy will pass a single zero initialized ``npy_intp *`` when ``user_data`` is not set. - *NOTE that it would be possible to pass this as part of ``Context``.* + *Note that it would be possible to pass this as part of Context.* * The optional ``get_loop`` function will not be public initially, to avoid finalizing the API which requires design choices also with casting: - .. code-block:: + .. code-block:: C innerloop * get_loop( PyArrayMethod_Context *context, - /* (move_references is currently used internally for casting) */ int aligned, int move_references, npy_intp *strides, PyArray_StridedUnaryOp **out_loop, NpyAuxData **innerloop_data, NPY_ARRAYMETHOD_FLAGS *flags); - The ``NPY_ARRAYMETHOD_FLAGS`` can indicate whether the Python API is required - and floating point errors must be checked. + ``NPY_ARRAYMETHOD_FLAGS`` can indicate whether the Python API is required + and floating point errors must be checked. ``move_references`` is used + internally for NumPy casting at this time. * The inner-loop function:: @@ -737,8 +751,15 @@ This step is required to allocate output arrays and has to happen before casting can be prepared. While the returned casting-safety (``NPY_CASTING``) will almost always be -"safe" for universal functions, including it has two big advantages: - +"no" for universal functions, including it has two big advantages: + +* ``-1`` indicates that an error occurred. If a Python error is set, it will + be raised. If no Python error is set this will be considered an "impossible" + cast and a custom error will be set. (This distinction is important for the + ``np.can_cast()`` function, which should raise the first one and return + ``False`` in the second case, it is not noteworthy for typical ufuncs). + *This point is under consideration, we may use -1 to indicate + a general error, and use a different return value for an impossible cast.* * Returning the casting safety is central to NEP 42 for casting and allows the unmodified use of ``ArrayMethod`` there. * There may be a future desire to implement fast but unsafe implementations. @@ -746,7 +767,7 @@ While the returned casting-safety (``NPY_CASTING``) will almost always be perspective. Currently, this would use ``int64 + int64 -> int64`` and then cast to ``int32``. An implementation that skips the cast would have to signal that it effectively includes the "same-kind" cast and is - thus not considered "safe". + thus not considered "no". ``get_loop`` method @@ -774,7 +795,7 @@ Extending the inner-loop signature Extending the inner-loop signature is another central and necessary part of the NEP. -**Passing in the ``Context``:** +**Passing in the Context:** Passing in the ``Context`` potentially allows for the future extension of the signature by adding new fields to the context struct. @@ -802,8 +823,8 @@ exists in NumPy for this purpose, it seems a natural choice. To simplify some use-cases (see "Error Handling" below), we will pass a ``npy_intp *innerloop_data = 0`` instead when ``innerloop_data`` is not provided. -*Note: Since ``get_loop`` is expected to be private initially we can gain -experience with ``innerloop_data`` before exposing it as public API.* +*Note:* Since ``get_loop`` is expected to be private initially we can gain +experience with ``innerloop_data`` before exposing it as public API. **Return value:** @@ -934,7 +955,7 @@ This wrapped ``ArrayMethod`` will have two additional methods: have changed the byte-order), and further resolve the physical unit making the final signature:: - ``Unit[Float64]("m") + Unit[Float64]("m") -> Unit[Float64]("m")`` + Unit[Float64]("m") + Unit[Float64]("m") -> Unit[Float64]("m") the UFunc machinery will take care of casting the "km" input to "m". @@ -1019,8 +1040,8 @@ In the future we expect that ``ArrayMethod``\ s can also be defined for **Promotion:** If a matching ``ArrayMethod`` exists, dispatching is straight forward. -However, when it does not, require additional definitions to implement -promotion: +However, when it does not, additional definitions are required to implement +this "promotion": * By default any UFunc has a promotion which uses the common DType of all inputs and dispatches a second time. This is well-defined for most @@ -1065,7 +1086,7 @@ In this case, just as a ``Timedelta64 * int64`` and ``int64 * timedelta64`` ``ArrayMethod`` is necessary, a second promoter will have to be registered to handle the case where the integer is passed first. -**Dispatching rules for ``ArrayMethod`` and Promoters:** +**Dispatching rules for ArrayMethod and Promoters:** Promoter and ``ArrayMethod`` are discovered by finding the best match as defined by the DType class hierarchy. diff --git a/doc/neps/nep-0046-sponsorship-guidelines.rst b/doc/neps/nep-0046-sponsorship-guidelines.rst new file mode 100644 index 000000000000..b8b312aa52d9 --- /dev/null +++ b/doc/neps/nep-0046-sponsorship-guidelines.rst @@ -0,0 +1,256 @@ +.. _NEP46: + +===================================== +NEP 46 — NumPy Sponsorship Guidelines +===================================== + +:Author: Ralf Gommers +:Status: Accepted +:Type: Process +:Created: 2020-12-27 +:Resolution: https://mail.python.org/pipermail/numpy-discussion/2021-January/081424.html + + +Abstract +-------- + +This NEP provides guidelines on how the NumPy project will acknowledge +financial and in-kind support. + + +Motivation and Scope +-------------------- + +In the past few years, the NumPy project has gotten significant financial +support, as well as dedicated work time for maintainers to work on NumPy. There +is a need to acknowledge that support - it's the right thing to do, it's +helpful when looking for new funding, and funders and organizations expect or +require it, Furthermore, having a clear policy for how NumPy acknowledges +support is helpful when searching for new support. Finally, this policy may +help set reasonable expectations for potential funders. + +This NEP is aimed at both the NumPy community - who can use it as a guideline +when looking for support on behalf of the project and when acknowledging +existing support - and at past, current and prospective sponsors, who often +want or need to know what they get in return for their support other than a +healthier NumPy. + +The scope of this proposal includes: + +- direct financial support, employers providing paid time for NumPy maintainers + and regular contributors, and in-kind support such as free hardware resources or + services, +- where and how NumPy acknowledges support (e.g., logo placement on the website), +- the amount and duration of support which leads to acknowledgement, and +- who in the NumPy project is responsible for sponsorship related topics, and + how to contact them. + + +How NumPy will acknowledge support +---------------------------------- + +There will be two different ways to acknowledge financial and in-kind support: +one to recognize significant active support, and another one to recognize +support received in the past and smaller amounts of support. + +Entities who fall under "significant active supporter" we'll call Sponsor. +The minimum level of support given to NumPy to be considered a Sponsor are: + +- $30,000/yr for unrestricted financial contributions (e.g., donations) +- $60,000/yr for financial contributions for a particular purpose (e.g., grants) +- $100,000/yr for in-kind contributions (e.g., time for employees to contribute) + +We define support being active as: + +- for a one-off donation: it was received within the previous 12 months, +- for recurring or financial or in-kind contributions: they should be ongoing. + +After support moves from "active" to "inactive" status, the acknowledgement +will be left in its place for at least another 6 months. If appropriate, the +funding team can discuss opportunities for renewal with the sponsor. After +those 6 months, acknowledgement may be moved to the historical overview. The +exact timing of this move is at the discretion of the funding team, because +there may be reasons to keep it in the more prominent place for longer. + +The rationale for the above funding levels is that unrestricted financial +contributions are typically the most valuable for the project, and the hardest +to obtain. The opposite is true for in-kind contributions. The dollar value of +the levels also reflect that NumPy's needs have grown to the point where we +need multiple paid developers in order to effectively support our user base and +continue to move the project forward. Financial support at or above these +levels is needed to be able to make a significant difference. + +Sponsors will get acknowledged through: + +- a small logo displayed on the front page of the NumPy website +- prominent logo placement on https://numpy.org/about/ +- logos displayed in talks about NumPy by maintainers +- announcements of the sponsorship on the NumPy mailing list and the numpy-team + Twitter account + +In addition to Sponsors, we already have the concept of Institutional Partner +(defined in NumPy's +`governance document `__), +for entities who employ a NumPy maintainer and let them work on NumPy as part +of their official duties. The governance document doesn't currently define a +minimum amount of paid maintainer time needed to be considered for partnership. +Therefore we propose that level here, roughly in line with the sponsorship +levels: + +- 6 person-months/yr of paid work time for one or more NumPy maintainers or + regular contributors to any NumPy team or activity + +Institutional Partners get the same benefits as Sponsors, in addition to what +is specified in the NumPy governance document. + +Finally, a new page on the website (https://numpy.org/funding/, linked from the +About page) will be added to acknowledge all current and previous sponsors, +partners, and any other entities and individuals who provided $5,000 or more of +financial or in-kind support. This page will include relevant details of +support (dates, amounts, names, and purpose); no logos will be used on this +page. The rationale for the $5,000 minimum level is to keep the amount of work +maintaining the page reasonable; the level is the equivalent of, e.g., one GSoC +or a person-week's worth of engineering time in a Western country, which seems +like a reasonable lower limit. + + +Implementation +-------------- + +The following content changes need to be made: + +- Add a section with small logos towards the bottom of the `numpy.org + `__ website. +- Create a full list of historical and current support and deploy it to + https://numpy.org/funding. +- Update the NumPy governance document for changes to Institutional Partner + eligibility requirements and benefits. +- Update https://numpy.org/about with details on how to get in touch with the + NumPy project about sponsorship related matters (see next section). + + +NumPy Funding Team +~~~~~~~~~~~~~~~~~~ + +At the moment NumPy has only one official body, the Steering Council, and no +good way to get in touch with either that body or any person or group +responsible for funding and sponsorship related matters. The way this is +typically done now is to somehow find the personal email of a maintainer, and +email them in private. There is a need to organize this more transparently - a +potential sponsor isn't likely to inquire through the mailing list, nor is it +easy for a potential sponsor to know if they're reaching out to the right +person in private. + +https://numpy.org/about/ already says that NumPy has a "funding and grants" +team. However that is not the case. We propose to organize this team, name team +members on it, and add the names of those team members plus a dedicated email +address for the team to the About page. + + +Status before this proposal +--------------------------- + +Acknowledgement of support +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +At the time of writing (Dec 2020), the logos of the four largest financial +sponsors and two institutional partners are displayed on +https://numpy.org/about/. The `Nature paper about NumPy `__ +mentions some early funding. No comprehensive list of received funding and +in-kind support is published anywhere. + +Decisions on which logos to list on the website have been made mostly by the +website team. Decisions on which entities to recognize as Institutional Partner +have been made by the NumPy Steering Council. + + +NumPy governance, decision-making, and financial oversight +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +*This section is meant as context for the reader, to help put the rest of this +NEP in perspective, and perhaps answer questions the reader has when reading +this as a potential sponsor.* + +NumPy has a formal governance structure defined in +`this governance document `__). +Decisions are made by consensus among all active participants in a discussion +(typically on the mailing list), and if consensus cannot be reached then the +Steering Council takes the decision (also by consensus). + +NumPy is a sponsored project of NumFOCUS, a US-based 501(c)3 nonprofit. +NumFOCUS administers NumPy funds, and ensures they are spent in accordance with +its mission and nonprofit status. In practice, NumPy has a NumFOCUS +subcommittee (with its members named in the NumPy governance document) who can +authorize financial transactions. Those transactions, for example paying a +contractor for a particular activity or deliverable, are decided on by the +NumPy Steering Council. + + +Alternatives +------------ + +*Tiered sponsorship levels.* We considered using tiered sponsorship levels, and +rejected this alternative because it would be more complex, and not necessarily +communicate the right intent - the minimum levels are for us to determine how +to acknowledge support that we receive, not a commercial value proposition. +Entities typically will support NumPy because they rely on the project or want +to help advance it, and not to get brand awareness through logo placement. + +*Listing all donations*. Note that in the past we have received many smaller +donations, mostly from individuals through NumFOCUS. It would be great to list +all of those contributions, but given the way we receive information on those +donations right now, that would be quite labor-intensive. If we manage to move +to a more suitable platform, such as `Open Collective `__, +in the future, we should reconsider listing all individual donations. + + +Related Work +------------ + +Here we provide a few examples of how other projects handle sponsorship +guidelines and acknowledgements. + +*Scikit-learn* has a narrow banner with logos at the bottom of +https://scikit-learn.org, and a list of present funding and past sponsors at +https://scikit-learn.org/stable/about.html#funding. Plus a separate section +"Infrastructure support" at the bottom of that same About page. + +*Jupyter* has logos of sponsors and institutional partners in two sections on +https://jupyter.org/about. Some subprojects have separate approaches, for +example sponsors are listed (by using the `all-contributors +`__ bot) in the README for +`jupyterlab-git `__. For a recent +discussion on that, see `here `_. + +*NumFOCUS* has a large banner with sponsor logos on its front page at +https://numfocus.org, and a full page with sponsors at different sponsorship +levels listed at https://numfocus.org/sponsors. They also have a +`Corporate Sponsorship Prospectus `__, +which includes a lot of detail on both sponsorship levels and benefits, as well +as how that helps NumFOCUS-affiliated projects (including NumPy). + + +Discussion +---------- + +- `Mailing list thread discussing this NEP `__ +- `PR with review of the NEP draft `__ + + +References and Footnotes +------------------------ + +- `Inside NumPy: preparing for the next decade `__ presentation at SciPy'19 discussing the impact of the first NumPy grant. +- `Issue `__ and + `email `__ + where IBM offered a $5,000 bounty for VSX SIMD support +- `JupyterLab Corporate Engagement and Contribution Guide `__ + + +.. _jupyterlab-git acknowledgements discussion: https://github.com/jupyterlab/jupyterlab-git/pull/530 + + +Copyright +--------- + +This document has been placed in the public domain. diff --git a/doc/neps/nep-0047-array-api-standard.rst b/doc/neps/nep-0047-array-api-standard.rst new file mode 100644 index 000000000000..19965c20d908 --- /dev/null +++ b/doc/neps/nep-0047-array-api-standard.rst @@ -0,0 +1,590 @@ +.. _NEP47: + +======================================== +NEP 47 — Adopting the array API standard +======================================== + +:Author: Ralf Gommers +:Author: Stephan Hoyer +:Author: Aaron Meurer +:Status: Draft +:Type: Standards Track +:Created: 2021-01-21 +:Resolution: + + +Abstract +-------- + +We propose to adopt the `Python array API standard`_, developed by the +`Consortium for Python Data API Standards`_. Implementing this as a separate +new namespace in NumPy will allow authors of libraries which depend on NumPy +as well as end users to write code that is portable between NumPy and all +other array/tensor libraries that adopt this standard. + +.. note:: + + We expect that this NEP will remain in a draft state for quite a while. + Given the large scope we don't expect to propose it for acceptance any + time soon; instead, we want to solicit feedback on both the high-level + design and implementation, and learn what needs describing better in this + NEP or changing in either the implementation or the array API standard + itself. + + +Motivation and Scope +-------------------- + +Python users have a wealth of choice for libraries and frameworks for +numerical computing, data science, machine learning, and deep learning. New +frameworks pushing forward the state of the art in these fields are appearing +every year. One unintended consequence of all this activity and creativity +has been fragmentation in multidimensional array (a.k.a. tensor) libraries - +which are the fundamental data structure for these fields. Choices include +NumPy, Tensorflow, PyTorch, Dask, JAX, CuPy, MXNet, and others. + +The APIs of each of these libraries are largely similar, but with enough +differences that it’s quite difficult to write code that works with multiple +(or all) of these libraries. The array API standard aims to address that +issue, by specifying an API for the most common ways arrays are constructed +and used. The proposed API is quite similar to NumPy's API, and deviates mainly +in places where (a) NumPy made design choices that are inherently not portable +to other implementations, and (b) where other libraries consistently deviated +from NumPy on purpose because NumPy's design turned out to have issues or +unnecessary complexity. + +For a longer discussion on the purpose of the array API standard we refer to +the `Purpose and Scope section of the array API standard `__ +and the two blog posts announcing the formation of the Consortium [1]_ and +the release of the first draft version of the standard for community review [2]_. + +The scope of this NEP includes: + +- Adopting the 2021 version of the array API standard +- Adding a separate namespace, tentatively named ``numpy.array_api`` +- Changes needed/desired outside of the new namespace, for example new dunder + methods on the ``ndarray`` object +- Implementation choices, and differences between functions in the new + namespace with those in the main ``numpy`` namespace +- A new array object conforming to the array API standard +- Maintenance effort and testing strategy +- Impact on NumPy's total exposed API surface and on other future and + under-discussion design choices +- Relation to existing and proposed NumPy array protocols + (``__array_ufunc__``, ``__array_function__``, ``__array_module__``). +- Required improvements to existing NumPy functionality + +Out of scope for this NEP are: + +- Changes in the array API standard itself. Those are likely to come up + during review of this NEP, but should be upstreamed as needed and this NEP + subsequently updated. + + +Usage and Impact +---------------- + +*This section will be fleshed out later, for now we refer to the use cases given +in* `the array API standard Use Cases section `__ + +In addition to those use cases, the new namespace contains functionality that +is widely used and supported by many array libraries. As such, it is a good +set of functions to teach to newcomers to NumPy and recommend as "best +practice". That contrasts with NumPy's main namespace, which contains many +functions and objects that have been superceded or we consider mistakes - but +that we can't remove because of backwards compatibility reasons. + +The usage of the ``numpy.array_api`` namespace by downstream libraries is +intended to enable them to consume multiple kinds of arrays, *without having +to have a hard dependency on all of those array libraries*: + +.. image:: _static/nep-0047-library-dependencies.png + +Adoption in downstream libraries +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The prototype implementation of the ``array_api`` namespace will be used with +SciPy, scikit-learn and other libraries of interest that depend on NumPy, in +order to get more experience with the design and find out if any important +parts are missing. + +The pattern to support multiple array libraries is intended to be something +like:: + + def somefunc(x, y): + # Retrieves standard namespace. Raises if x and y have different + # namespaces. See Appendix for possible get_namespace implementation + xp = get_namespace(x, y) + out = xp.mean(x, axis=0) + 2*xp.std(y, axis=0) + return out + +The ``get_namespace`` call is effectively the library author opting in to +using the standard API namespace, and thereby explicitly supporting +all conforming array libraries. + + +The ``asarray`` / ``asanyarray`` pattern +```````````````````````````````````````` + +Many existing libraries use the same ``asarray`` (or ``asanyarray``) pattern +as NumPy itself does; accepting any object that can be coerced into a ``np.ndarray``. +We consider this design pattern problematic - keeping in mind the Zen of +Python, *"explicit is better than implicit"*, as well as the pattern being +historically problematic in the SciPy ecosystem for ``ndarray`` subclasses +and with over-eager object creation. All other array/tensor libraries are +more strict, and that works out fine in practice. We would advise authors of +new libraries to avoid the ``asarray`` pattern. Instead they should either +accept just NumPy arrays or, if they want to support multiple kinds of +arrays, check if the incoming array object supports the array API standard +by checking for ``__array_namespace__`` as shown in the example above. + +Existing libraries can do such a check as well, and only call ``asarray`` if +the check fails. This is very similar to the ``__duckarray__`` idea in +:ref:`NEP30`. + + +.. _adoption-application-code: + +Adoption in application code +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The new namespace can be seen by end users as a cleaned up and slimmed down +version of NumPy's main namespace. Encouraging end users to use this +namespace like:: + + import numpy.array_api as xp + + x = xp.linspace(0, 2*xp.pi, num=100) + y = xp.cos(x) + +seems perfectly reasonable, and potentially beneficial - users get offered only +one function for each purpose (the one we consider best-practice), and they +then write code that is more easily portable to other libraries. + + +Backward compatibility +---------------------- + +No deprecations or removals of existing NumPy APIs or other backwards +incompatible changes are proposed. + + +High-level design +----------------- + +The array API standard consists of approximately 120 objects, all of which +have a direct NumPy equivalent. This figure shows what is included at a high level: + +.. image:: _static/nep-0047-scope-of-array-API.png + +The most important changes compared to what NumPy currently offers are: + +- A new array object which: + + - conforms to the casting rules and indexing behaviour specified by the + standard, + - does not have methods other than dunder methods, + - does not support the full range of NumPy indexing behaviour. Advanced + indexing with integers is not supported. Only boolean indexing + with a single (possibly multi-dimensional) boolean array is supported. + An indexing expression that selects a single element returns a 0-D array + rather than a scalar. + +- Functions in the ``array_api`` namespace: + + - do not accept ``array_like`` inputs, only NumPy arrays and Python scalars + - do not support ``__array_ufunc__`` and ``__array_function__``, + - use positional-only and keyword-only parameters in their signatures, + - have inline type annotations, + - may have minor changes to signatures and semantics of individual + functions compared to their equivalents already present in NumPy, + - only support dtype literals, not format strings or other ways of + specifying dtypes + +- DLPack_ support will be added to NumPy, +- New syntax for "device support" will be added, through a ``.device`` + attribute on the new array object, and ``device=`` keywords in array creation + functions in the ``array_api`` namespace, +- Casting rules that differ from those NumPy currently has. Output dtypes can + be derived from input dtypes (i.e. no value-based casting), and 0-D arrays + are treated like >=1-D arrays. +- Not all dtypes NumPy has are part of the standard. Only boolean, signed and + unsigned integers, and floating-point dtypes up to ``float64`` are supported. + Complex dtypes are expected to be added in the next version of the standard. + Extended precision, string, void, object and datetime dtypes, as well as + structured dtypes, are not included. + +Improvements to existing NumPy functionality that are needed include: + +- Add support for stacks of matrices to some functions in ``numpy.linalg`` + that are currently missing such support. +- Add the ``keepdims`` keyword to ``np.argmin`` and ``np.argmax``. +- Add a "never copy" mode to ``np.asarray``. + + +Functions in the ``array_api`` namespace +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Let's start with an example of a function implementation that shows the most +important differences with the equivalent function in the main namespace:: + + def max(x: array, /, *, + axis: Optional[Union[int, Tuple[int, ...]]] = None, + keepdims: bool = False + ) -> array: + """ + Array API compatible wrapper for :py:func:`np.max `. + """ + return np.max._implementation(x, axis=axis, keepdims=keepdims) + +This function does not accept ``array_like`` inputs, only ``ndarray``. There +are multiple reasons for this. Other array libraries all work like this. +Letting the user do coercion of lists, generators, or other foreign objects +separately results in a cleaner design with less unexpected behaviour. +It's higher-performance - less overhead from ``asarray`` calls. Static typing +is easier. Subclasses will work as expected. And the slight increase in verbosity +because users have to explicitly coerce to ``ndarray`` on rare occasions +seems like a small price to pay. + +This function does not support ``__array_ufunc__`` nor ``__array_function__``. +These protocols serve a similar purpose as the array API standard module itself, +but through a different mechanisms. Because only ``ndarray`` instances are accepted, +dispatching via one of these protocols isn't useful anymore. + +This function uses positional-only parameters in its signature. This makes code +more portable - writing ``max(x=x, ...)`` is no longer valid, hence if other +libraries call the first parameter ``input`` rather than ``x``, that is fine. +The rationale for keyword-only parameters (not shown in the above example) is +two-fold: clarity of end user code, and it being easier to extend the signature +in the future with keywords in the desired order. + +This function has inline type annotations. Inline annotations are far easier to +maintain than separate stub files. And because the types are simple, this will +not result in a large amount of clutter with type aliases or unions like in the +current stub files NumPy has. + + +DLPack support for zero-copy data interchange +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The ability to convert one kind of array into another kind is valuable, and +indeed necessary when downstream libraries want to support multiple kinds of +arrays. This requires a well-specified data exchange protocol. NumPy already +supports two of these, namely the buffer protocol (i.e., PEP 3118), and +the ``__array_interface__`` (Python side) / ``__array_struct__`` (C side) +protocol. Both work similarly, letting the "producer" describe how the data +is laid out in memory so the "consumer" can construct its own kind of array +with a view on that data. + +DLPack works in a very similar way. The main reasons to prefer DLPack over +the options already present in NumPy are: + +1. DLPack is the only protocol with device support (e.g., GPUs using CUDA or + ROCm drivers, or OpenCL devices). NumPy is CPU-only, but other array + libraries are not. Having one protocol per device isn't tenable, hence + device support is a must. +2. Widespread support. DLPack has the widest adoption of all protocols, only + NumPy is missing support. And the experiences of other libraries with it + are positive. This contrasts with the protocols NumPy does support, which + are used very little - when other libraries want to interoperate with + NumPy, they typically use the (more limited, and NumPy-specific) + ``__array__`` protocol. + +Adding support for DLPack to NumPy entails: + +- Adding a ``ndarray.__dlpack__`` method +- Adding a ``from_dlpack`` function, which takes as input an object + supporting ``__dlpack__``, and returns an ``ndarray``. + +DLPack is currently a ~200 LoC header, and is meant to be included directly, so +no external dependency is needed. Implementation should be straightforward. + + +Syntax for device support +~~~~~~~~~~~~~~~~~~~~~~~~~ + +NumPy itself is CPU-only, so it clearly doesn't have a need for device support. +However, other libraries (e.g. TensorFlow, PyTorch, JAX, MXNet) support +multiple types of devices: CPU, GPU, TPU, and more exotic hardware. +To write portable code on systems with multiple devices, it's often necessary +to create new arrays on the same device as some other array, or check that +two arrays live on the same device. Hence syntax for that is needed. + +The array object will have a ``.device`` attribute which enables comparing +devices of different arrays (they only should compare equal if both arrays are +from the same library and it's the same hardware device). Furthermore, +``device=`` keywords in array creation functions are needed. For example:: + + def empty(shape: Union[int, Tuple[int, ...]], /, *, + dtype: Optional[dtype] = None, + device: Optional[device] = None) -> array: + """ + Array API compatible wrapper for :py:func:`np.empty `. + """ + return np.empty(shape, dtype=dtype, device=device) + +The implementation for NumPy may be as simple as setting the device attribute to +the string ``'cpu'`` and raising an exception if array creation functions +encounter any other value. + + +Dtypes and casting rules +~~~~~~~~~~~~~~~~~~~~~~~~ + +The supported dtypes in this namespace are boolean, 8/16/32/64-bit signed and +unsigned integer, and 32/64-bit floating-point dtypes. These will be added to +the namespace as dtype literals with the expected names (e.g., ``bool``, +``uint16``, ``float64``). + +The most obvious omissions are the complex dtypes. The rationale for the lack +of complex support in the first version of the array API standard is that several +libraries (PyTorch, MXNet) are still in the process of adding support for +complex dtypes. The next version of the standard is expected to include ``complex64`` +and ``complex128`` (see `this issue `__ +for more details). + +Specifying dtypes to functions, e.g. via the ``dtype=`` keyword, is expected +to only use the dtype literals. Format strings, Python builtin dtypes, or +string representations of the dtype literals are not accepted - this will +improve readability and portability of code at little cost. + +Casting rules are only defined between different dtypes of the same kind. The +rationale for this is that mixed-kind (e.g., integer to floating-point) +casting behavior differs between libraries. NumPy's mixed-kind casting +behavior doesn't need to be changed or restricted, it only needs to be +documented that if users use mixed-kind casting, their code may not be +portable. + +.. image:: _static/nep-0047-casting-rules-lattice.png + +*Type promotion diagram. Promotion between any two types is given by their +join on this lattice. Only the types of participating arrays matter, not +their values. Dashed lines indicate that behaviour for Python scalars is +undefined on overflow. Boolean, integer and floating-point dtypes are not +connected, indicating mixed-kind promotion is undefined.* + +The most important difference between the casting rules in NumPy and in the +array API standard is how scalars and 0-dimensional arrays are handled. In +the standard, array scalars do not exist and 0-dimensional arrays follow the +same casting rules as higher-dimensional arrays. + +See the `Type Promotion Rules section of the array API standard `__ +for more details. + +.. note:: + + It is not clear what the best way is to support the different casting rules + for 0-dimensional arrays and no value-based casting. One option may be to + implement this second set of casting rules, keep them private, mark the + array API functions with a private attribute that says they adhere to + these different rules, and let the casting machinery check whether for + that attribute. + + This needs discussion. + + +Indexing +~~~~~~~~ + +An indexing expression that would return a scalar with ``ndarray``, e.g. +``arr_2d[0, 0]``, will return a 0-D array with the new array object. There are +several reasons for that: array scalars are largely considered a design mistake +which no other array library copied; it works better for non-CPU libraries +(typically arrays can live on the device, scalars live on the host); and it's +simply a consistent design. To get a Python scalar out of a 0-D array, one can +simply use the builtin for the type, e.g. ``float(arr_0d)``. + +The other `indexing modes in the standard `__ +do work largely the same as they do for ``numpy.ndarray``. One noteworthy +difference is that clipping in slice indexing (e.g., ``a[:n]`` where ``n`` is +larger than the size of the first axis) is unspecified behaviour, because +that kind of check can be expensive on accelerators. + +The lack of advanced indexing, and boolean indexing being limited to a single +n-D boolean array, is due to those indexing modes not being suitable for all +types of arrays or JIT compilation. Their absence does not seem to be +problematic; if a user or library author wants to use them, they can do so +through zero-copy conversion to ``numpy.ndarray``. This will signal correctly +to whomever reads the code that it is then NumPy-specific rather than portable +to all conforming array types. + + + +The array object +~~~~~~~~~~~~~~~~ + +The array object in the standard does not have methods other than dunder +methods. The rationale for that is that not all array libraries have methods +on their array object (e.g., TensorFlow does not). It also provides only a +single way of doing something, rather than have functions and methods that +are effectively duplicate. + +Mixing operations that may produce views (e.g., indexing, ``nonzero``) +in combination with mutation (e.g., item or slice assignment) is +`explicitly documented in the standard to not be supported `__. +This cannot easily be prohibited in the array object itself; instead this will +be guidance to the user via documentation. + +The standard current does not prescribe a name for the array object itself. +We propose to simply name it ``ndarray``. This is the most obvious name, and +because of the separate namespace should not clash with ``numpy.ndarray``. + + +Implementation +-------------- + +.. note:: + + This section needs a lot more detail, which will gradually be added when + the implementation progresses. + +A prototype of the ``array_api`` namespace can be found in +https://github.com/data-apis/numpy/tree/array-api/numpy/_array_api. +The docstring in its ``__init__.py`` has notes on completeness of the +implementation. The code for the wrapper functions also contains ``# Note:`` +comments everywhere there is a difference with the NumPy API. +Two important parts that are not implemented yet are the new array object and +DLPack support. Functions may need changes to ensure the changed casting rules +are respected. + +The array object +~~~~~~~~~~~~~~~~ + +Regarding the array object implementation, we plan to start with a regular +Python class that wraps a ``numpy.ndarray`` instance. Attributes and methods +can forward to that wrapped instance, applying input validation and +implementing changed behaviour as needed. + +The casting rules are probably the most challenging part. The in-progress +dtype system refactor (NEPs 40-43) should make implementing the correct casting +behaviour easier - it is already moving away from value-based casting for +example. + + +The dtype objects +~~~~~~~~~~~~~~~~~ + +We must be able to compare dtypes for equality, and expressions like these must +be possible:: + + np.array_api.some_func(..., dtype=x.dtype) + +The above implies it would be nice to have ``np.array_api.float32 == +np.array_api.ndarray(...).dtype``. + +Dtypes should not be assumed to have a class hierarchy by users, however we are +free to implement it with a class hierarchy if that's convenient. We considered +the following options to implement dtype objects: + +1. Alias dtypes to those in the main namespace. E.g., ``np.array_api.float32 = + np.float32``. +2. Make the dtypes instances of ``np.dtype``. E.g., ``np.array_api.float32 = + np.dtype(np.float32)``. +3. Create new singleton classes with only the required methods/attributes + (currently just ``__eq__``). + +It seems like (2) would be easiest from the perspective of interacting with +functions outside the main namespace. And (3) would adhere best to the +standard. + +TBD: the standard does not yet have a good way to inspect properties of a +dtype, to ask questions like "is this an integer dtype?". Perhaps this is easy +enough to do for users, like so:: + + def _get_dtype(dt_or_arr): + return dt_or_arr.dtype if hasattr(dt_or_arr, 'dtype') else dt_or_arr + + def is_floating(dtype_or_array): + dtype = _get_dtype(dtype_or_array) + return dtype in (float32, float64) + + def is_integer(dtype_or_array): + dtype = _get_dtype(dtype_or_array) + return dtype in (uint8, uint16, uint32, uint64, int8, int16, int32, int64) + +However it could make sense to add to the standard. Note that NumPy itself +currently does not have a great for asking such questions, see +`gh-17325 `__. + + +Feedback from downstream library authors +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +TODO - this can only be done after trying out some use cases + +Leo Fang (CuPy): *"My impression is for CuPy we could simply take this new array object and s/numpy/cupy"* + + +Related Work +------------ + +:ref:`NEP37` contains a similar mechanism to retrieve a NumPy-like namespace. +In fact, NEP 37 inspired the (slightly simpler) mechanism in the array API +standard. + +Other libraries have adopted large parts of NumPy's API, made changes where +necessary, and documented deviations. See for example +`the jax.numpy documentation `__ +and `Difference between CuPy and NumPy `__. +The array API standard was constructed with the help of such comparisons, only +between many array libraries rather than only between NumPy and one other library. + + +Alternatives +------------ + + + + +Appendix - a possible ``get_namespace`` implementation +------------------------------------------------------ + +The ``get_namespace`` function mentioned in the +:ref:`adoption-application-code` section can be implemented like:: + + def get_namespace(*xs): + # `xs` contains one or more arrays, or possibly Python scalars (accepting + # those is a matter of taste, but doesn't seem unreasonable). + namespaces = { + x.__array_namespace__() if hasattr(x, '__array_namespace__') else None for x in xs if not isinstance(x, (bool, int, float, complex)) + } + + if not namespaces: + # one could special-case np.ndarray above or use np.asarray here if + # older numpy versions need to be supported. + raise ValueError("Unrecognized array input") + + if len(namespaces) != 1: + raise ValueError(f"Multiple namespaces for array inputs: {namespaces}") + + xp, = namespaces + if xp is None: + raise ValueError("The input is not a supported array type") + + return xp + + +Discussion +---------- + +- `First discussion on the mailing list about the array API standard `__ + + +References and Footnotes +------------------------ + +.. _Python array API standard: https://data-apis.github.io/array-api/latest + +.. _Consortium for Python Data API Standards: https://data-apis.org/ + +.. _DLPack: https://github.com/dmlc/dlpack + +.. [1] https://data-apis.org/blog/announcing_the_consortium/ + +.. [2] https://data-apis.org/blog/array_api_standard_release/ + + +Copyright +--------- + +This document has been placed in the public domain. [1]_ diff --git a/doc/neps/nep-0048-spending-project-funds.rst b/doc/neps/nep-0048-spending-project-funds.rst new file mode 100644 index 000000000000..3571eef2d8e6 --- /dev/null +++ b/doc/neps/nep-0048-spending-project-funds.rst @@ -0,0 +1,458 @@ +.. _NEP48: + +===================================== +NEP 48 — Spending NumPy Project Funds +===================================== + +:Author: Ralf Gommers +:Author: Inessa Pawson +:Author: Stefan van der Walt +:Status: Draft +:Type: Informational +:Created: 2021-02-07 +:Resolution: + + +Abstract +-------- + +The NumPy project has historically never received significant **unrestricted** +funding. However, that is starting to change. This NEP aims to provide +guidance about spending NumPy project unrestricted funds by formulating a set +of principles about *what* to pay for and *who* to pay. It will also touch on +how decisions regarding spending funds get made, how funds get administered, +and transparency around these topics. + + +Motivation and Scope +-------------------- + +NumPy is a fiscally sponsored project of NumFOCUS, a 501(c)(3) nonprofit +organization headquartered in Austin, TX. Therefore, for all legal and +accounting matters the NumPy project has to follow the rules and regulations +for US nonprofits. All nonprofit donations are classified into two categories: +**unrestricted funds** which may be used for any legal purpose appropriate +to the organization and **restricted funds**, monies set aside for a +particular purpose (e.g., project, educational program, etc.). + +For the detailed timeline of NumPy funding refer to +:ref:`numpy-funding-history`. + +Since its inception and until 2020, the NumPy project has only spent on the order of +$10,000 USD of funds that were not restricted to a particular program. Project +income of this type has been relying on donations from individuals and, from +mid 2019, recurring monthly contributions from Tidelift. By the end of 2020, +the Tidelift contributions increased to $3,000/month, and there's also a +potential for an increase of donations and grants going directly to the +project. Having a clear set of principles around how to use these funds will +facilitate spending them fairly and effectively. Additionally, it will make it +easier to solicit donations and other contributions. + +A key assumption this NEP makes is that NumPy remains a largely +volunteer-driven project, and that the project funds are not enough to employ +maintainers full-time. If funding increases to the point where that assumption +is no longer true, this NEP should be updated. + +In scope for this NEP are: + +- Principles of spending project funds: what to pay for, and who to pay. +- Describing how NumPy's funds get administered. +- Describing how decisions to spend funds get proposed and made. + +Out of scope for this NEP are: + +- Making any decisions about spending project funds on a specific project or + activity. +- Principles for spending funds that are intended for NumPy development, but + don't fall in the category of NumPy unrestricted funds. This includes most of + the grant funding, which is usually earmarked for certain + activities/deliverables and goes to an Institutional Partner rather than + directly to the NumPy project, and companies or institutions funding specific + features. + *Rationale: As a project, we have no direct control over how this work gets + executed (at least formally, until issues or PRs show up). In some cases, we + may not even know the contributions were funded or done by an employee on + work time. (Whether that's the case or not should not change how we approach + a contribution). For grants though, we do expect the research/project leader + and funded team to align their work with the needs of NumPy and be + receptive to feedback from other NumPy maintainers and contributors.* + + +Principles of spending project funds +------------------------------------ + +NumPy will likely always be a project with many times more volunteer +contributors than funded people. Therefore having those funded people operate +in ways that attract more volunteers and enhance their participation experience +is critical. That key principle motivates many of the more detailed principles +given below for what to pay for and whom to pay. + +The approach for spending funds will be: + +- first figure out what we want to fund, +- then look for a great candidate, +- after that's settled, determine a fair compensation level. + +The next sections go into detail on each of these three points. + +.. _section-what-to-pay-for: + +What to pay for +``````````````` + +1. Pay for things that are important *and* otherwise won't get done. + *Rationale: there is way more to be done than there are funds to do all + those things. So count on interested volunteers or external sponsored work + to do many of those things.* +2. Plan for sustainability. Don't rely on money always being there. +3. Consider potential positive benefits for NumPy maintainers and contributors, + maintainers of other projects, end users, and other stakeholders like + packagers and educators. +4. Think broadly. There's more to a project than code: websites, documentation, + community building, governance - it's all important. +5. For proposed funded work, include paid time for others to review your work + if such review is expected to be significant effort - do not just increase + the load on volunteer maintainers. + *Rationale: we want the effect of spending funds to be positive for + everyone, not just for the people getting paid. This is also a matter of + fairness.* + +When considering development work, principle (1) implies that priority should +be giving to (a) the most boring/painful tasks that no one likes doing, and to +necessary structural changes to the code base that are too large to be done by +a volunteer in a reasonable amount of time. + +There are also many tasks, activities, and projects outside of +development work that are important and could enhance the project or community +- think of, for example, user surveys, translations, outreach, dedicated +mentoring of newcomers, community organizating, website improvements, and +administrative tasks. + +Time of people to perform tasks is also not the only thing that funds can be +used for: expenses for in-person developer meetings or sprints, hosted hardware +for benchmarking or development work, and CI or other software services could +all be good candidates to spend funds on. + +Whom to pay +``````````` + +1. All else being equal, give preference to existing maintainers/contributors. +2. When looking outside of the current team, consider this an opportunity to + make the project more diverse. +3. Pay attention to the following when considering paying someone: + + - the necessary technical or domain-specific skills to execute the tasks, + - communication and self-management skills, + - experience contributing to and working with open source projects. + +It will likely depend on the project/tasks whether there's already a clear best +candidate within the NumPy team, or whether we look for new people to get +involved. Before making any decisions, the decision makers (according to the +NumPy governance document - currently that's the Steering Council) should think +about whether an opportunity should be advertised to give a wider group of +people a chance to apply for it. + +Compensating fairly +``````````````````` + +.. note:: + + This section on compensating fairly will be considered *Draft* even if this + NEP as a whole is accepted. Once we have applied the approach outlined here + at least 2-3 times and we are happy with it, will we remove this note and + consider this section *Accepted*. + +Paying people fairly is a difficult topic, especially when it comes to +distributed teams. Therefore, we will only offer some guidance here. Final +decisions will always have to be considered and approved by the group of people +that bears this responsibility (according to the current NumPy governance +structure, this would be the NumPy Steering Council). + +Discussions on remote employee compensation tend to be dominated by two +narratives: "pay local market rates" and "same work -- same pay". + +We consider them both extreme: + +- "Same work -- same pay" is unfair to people living in locations with a higher + cost of living. For example, the average rent for a single family apartment + can differ by a large factor (from a few hundred dollars to thousands of + dollars per month). +- "Pay local market rates" bakes in existing inequalities between countries + and makes fixed-cost items like a development machine or a holiday trip + abroad relatively harder to afford in locations where market rates are lower. + +We seek to find a middle ground between these two extremes. + +Useful points of reference include companies like GitLab and +Buffer who are transparent about their remuneration policies ([3]_, [4]_), +Google Summer of Code stipends ([5]_), other open source projects that manage +their budget in a transparent manner (e.g., Babel and Webpack on Open +Collective ([6]_, [7]_)), and standard salary comparison sites. + +Since NumPy is a not-for-profit project, we also looked to the nonprofit sector +for guidelines on remuneration policies and compensation levels. Our findings +show that most smaller non-profits tend to pay a median salary/wage. We +recognize merit in this approach: applying candidates are likely to have a +genuine interest in open source, rather than to be motivated purely by +financial incentives. + +Considering all of the above, we will use the following guidelines for +determining compensation: + +1. Aim to compensate people appropriately, up to a level that's expected for + senior engineers or other professionals as applicable. +2. Establish a compensation cap of $125,000 USD that cannot be exceeded even + for the residents from the most expensive/competitive locations ([#f-pay]_). +3. For equivalent work and seniority, a pay differential between locations + should never be more than 2x. + For example, if we pay $110,000 USD to a senior-level developer from New + York, for equivalent work a senior-level developer from South-East Asia + should be paid at least $55,000 USD. To compare locations, we will use + `Numbeo Cost of Living calculator `__ + (or its equivalent). + +Some other considerations: + +- Often, compensated work is offered for a limited amount of hours or fixed + term. In those cases, consider compensation equivalent to a remuneration + package that comes with permanent employment (e.g., one month of work should + be compensated by at most 1/12th of a full-year salary + benefits). +- When comparing rates, an individual contractor should typically make 20% more + than someone who is employed since they have to take care of their benefits + and accounting on their own. +- Some people may be happy with one-off payments towards a particular + deliverable (e.g., "triage all open issues for label X for $x,xxx"). + This should be compensated at a lower rate compared to an individual + contractor. Or they may motivate lower amounts for another reason (e.g., "I + want to receive $x,xxx to hire a cleaner or pay for childcare, to free up + time for work on open source). +- When funding someone's time through their employer, that employer may want to + set the compensation level based on its internal rules (e.g., overhead rates). + Small deviations from the guidelines in this NEP may be needed in such cases, + however they should be within reason. +- It's entirely possible that another strategy rather than paying people for + their time on certain tasks may turn out to be more effective. Anything that + helps the project and community grow and improve is worth considering. +- Transparency helps. If everyone involved is comfortable sharing their + compensation levels with the rest of the team (or better make it public), + it's least likely to be way off the mark for fairness. + +We highly recommend that the individuals involved in decision-making about +hiring and compensation peruse the content of the References section of this +NEP. It offers a lot of helpful advice on this topic. + + +Defining fundable activities and projects +----------------------------------------- + +We'd like to have a broader set of fundable ideas that we will prioritize with +input from NumPy team members and the wider community. All ideas will be +documented on a single wiki page. Anyone may propose an idea. Only members of a +NumPy team may edit the wiki page. + +Each listed idea must meet the following requirements: + +1. It must be clearly scoped: its description must explain the importance to + the project, referencing the NumPy Roadmap if possible, the items to pay for + or activities and deliverables, and why it should be a funded activity (see + :ref:`section-what-to-pay-for`). +2. It must contain the following metadata: title, cost, time duration or effort + estimate, and (if known) names of the team member(s) to execute or coordinate. +3. It must have an assigned priority (low, medium, or high). This discussion + can originate at a NumPy community meeting or on the mailing list. However, + it must be finalized on the mailing list allowing everyone to weigh in. + +If a proposed idea has been assigned a high priority level, a decision on +allocating funding for it will be made on the private NumPy Steering Council +mailing list. *Rationale: these will often involve decisions about individuals, +which is typically hard to do in public. This is the current practice that +seems to be working well.* + +Sometimes, it may be practical to make a single funding decision ad-hoc (e.g., +"Here's a great opportunity plus the right person to execute it right now”). +However, this approach to decision-making should be used rarely. + + +Strategy for spending/saving funds +---------------------------------- + +There is an expectation from NumPy individual, corporate, and institutional +donors that the funds will be used for the benefit of the project and the +community. Therefore, we should spend available funds, thoughtfully, +strategically, and fairly, as they come in. For emergencies, we should keep a +$10,000 - $15,000 USD reserve which could cover, for example, a year of CI and +hosting services, 1-2 months of full-time maintenance work, or contracting a +consultant for a specific need. + + +How project funds get administered +---------------------------------- + +We will first summarize how administering of funds works today, and then +discuss how to make this process more efficient and transparent. + +Currently, the project funds are held by NumFOCUS in a dedicated account. +NumFOCUS has a small accounting team, which produces an account overview as a +set of spreadsheets on a monthly basis. These land in a shared drive, typically +with about a one month delay (e.g., the balance and transactions for February +are available at the end of March), where a few NumPy team members can access +them. Expense claims and invoices are submitted through the NumFOCUS website. +Those then show up in another spreadsheet, where a NumPy team member must +review and approve each of them before payments are made. Following NumPy +bylaws, the NumFOCUS finance subcommittee, consisting of five people, meets +every six months to review all the project related transactions. (In practice, +there have been so few transactions that we skipped some of these meetings.) + +The existing process is time-consuming and error-prone. More transparency and +automation are desirable. + + +Transparency about project funds and in decision making +``````````````````````````````````````````````````````` + +**To discuss: do we want full transparency by publishing our accounts, +transparency to everyone on a NumPy team, or some other level?** + +Ralf: I'd personally like it to be fully transparent, like through Open +Collective, so the whole community can see current balance, income and expenses +paid out at any moment in time. Moving to Open Collective is nontrivial, +however we can publish the data elsewhere for now if we'd want to. +*Note: Google Season of Docs this year requires having an Open Collective +account, so this is likely to happen soon enough.* + +Stefan/Inessa: at least a summary overview should be fully public, and all +transactions should be visible to the Steering Council. Full transparency of +all transactions is probably fine, but not necessary. + +*The options here may be determined by the accounting system and amount of +effort required.* + + +.. _numpy-funding-history: + +NumPy funding – history and current status +------------------------------------------ + +The NumPy project received its first major funding in 2017. For an overview of +the early history of NumPy (and SciPy), including some institutions sponsoring +time for their employees or contractors to work on NumPy, see [1]_ and [2]_. To +date, NumPy has received four grants: + +- Two grants, from the Alfred P. Sloan Foundation and the Gordon and Betty + Moore Foundation respectively, of about $1.3M combined to the Berkeley + Institute of Data Science. Work performed during the period 2017-2020; + PI Stéfan van der Walt. +- Two grants from the Chan Zuckerberg Foundation to NumFOCUS, for a combined + amount of $335k. Work performed during the period 2020-2021; PI's Ralf + Gommers (first grant) and Melissa Mendonça (second grant). + +From 2012 onwards NumPy has been a fiscally sponsored project of NumFOCUS. +Note that fiscal sponsorship doesn't mean NumPy gets funding, rather that it +can receive funds under the umbrella of a nonprofit. See `NumFOCUS Project +Support `__ for more details. + +Only since 2017 has the NumPy website displayed a "Donate" button, and since +2019 the NumPy repositories have had the GitHub Sponsors button. Before that, +it was possible to donate to NumPy on the NumFOCUS website. The sum total of +donations from individuals to NumPy for 2017-2020 was about $6,100. + +From May 2019 onwards, Tidelift has supported NumPy financially as part of +its "managed open source" business model. From May 2019 till July 2020 this was +$1,000/month, and it started steadily growing after that to about $3,000/month +(as of Feb 2021). + +Finally, there has been other incidental project income, for example, some book +royalties from Packt Publishing, GSoC mentoring fees from Google, and +merchandise sales revenue through the NumFOCUS web shop. All of these were +small (two or three figure) amounts. + +This brings the total amount of project income which did not already have a +spending target to about $35,000. Most of that is recent, from Tidelift. +Over the past 1.5 years we spent about $10,000 for work on the new NumPy +website and Sphinx theme. Those spending decisions were made by the NumPy +Steering Council and announced on the mailing list. + +That leaves about $25,000 in available funds at the time of writing, and +that amount is currently growing at a rate of about $3,000/month. + + +Related Work +------------ + +See references. We assume that other open source projects have also developed +guidelines on spending project funds. However, we were unable to find any +examples at the time of writing. + + +Alternatives +------------ + +*Alternative spending strategy*: not having cash reserves. The rationale +being that NumPy is important enough that in a real emergency some person or +entity will likely jump in to help out. This is not a responsible approach to +financial stewardship of the project though. Hence, we decided against it. + + +Discussion +---------- + + + +References and Footnotes +------------------------ + +.. [1] Pauli Virtanen et al., "SciPy 1.0: fundamental algorithms for scientific + computing in Python", https://www.nature.com/articles/s41592-019-0686-2, + 2020 + +.. [2] Charles Harris et al., "Array programming with NumPy", https://www.nature.com/articles/s41586-020-2649-2, 2020 + +.. [3] https://remote.com/blog/remote-compensation + +.. [4] https://about.gitlab.com/company/culture/all-remote/compensation/#how-do-you-decide-how-much-to-pay-people + +.. [5] https://developers.google.com/open-source/gsoc/help/student-stipends + +.. [6] Jurgen Appelo, "Compensation: what is fair?", https://blog.agilityscales.com/compensation-what-is-fair-38a65a822c29, 2016 + +.. [7] Project Include, "Compensating fairly", https://projectinclude.org/compensating_fairly + +.. [#f-pay] This cap is derived from comparing with compensation levels at + other open source projects (e.g., Babel, Webpack, Drupal - all in + the $100,000 -- $125,000 range) and Partner Institutions. + +- Nadia Eghbal, "Roads and Bridges: The Unseen Labor Behind Our Digital + Infrastructure", 2016 +- Nadia Eghbal, "Working in Public: The Making and Maintenance of Open + Source", 2020 +- https://github.com/nayafia/lemonade-stand +- Daniel Oberhaus, `"The Internet Was Built on the Free Labor of Open Source + Developers. Is That Sustainable?" + `_, 2019 +- David Heinemeier Hansson, `"The perils of mixing open source and money" `_, 2013 +- Danny Crichton, `"Open source sustainability" `_, 2018 +- Nadia Eghbal, "Rebuilding the Cathedral", https://www.youtube.com/watch?v=VS6IpvTWwkQ, 2017 +- Nadia Eghbal, "Where money meets open source", https://www.youtube.com/watch?v=bjAinwgvQqc&t=246s, 2017 +- Eileen Uchitelle, ""The unbearable vulnerability of open source", https://www.youtube.com/watch?v=VdwO3LQ56oM, 2017 (the inverted triangle, open source is a funnel) +- Dries Buytaert, "Balancing Makers and Takers to scale and sustain Open Source", https://dri.es/balancing-makers-and-takers-to-scale-and-sustain-open-source, 2019 +- Safia Abdalla, "Beyond Maintenance", https://increment.com/open-source/beyond-maintenance/, 2019 +- Xavier Damman, "Money and Open Source Communities", https://blog.opencollective.com/money-and-open-source-communities/, 2016 +- Aseem Sood, "Let's talk about money", https://blog.opencollective.com/lets-talk-about-money/, 2017 +- Alanna Irving, "Has your open source community raised money? Here's how to spend it.", https://blog.opencollective.com/has-your-open-source-community-raised-money-heres-how-to-spend-it/, 2017 +- Alanna Irving, "Funding open source, how Webpack reached $400k+/year", https://blog.opencollective.com/funding-open-source-how-webpack-reached-400k-year/, 2017 +- Alanna Irving, "Babel's rise to financial sustainability", https://blog.opencollective.com/babels-rise-to-financial-sustainability/, 2019 +- Devon Zuegel, "The city guide to open source", https://www.youtube.com/watch?v=80KTVu6GGSE, 2020 + blog: https://increment.com/open-source/the-city-guide-to-open-source/ + +GitHub Sponsors: + +- https://github.blog/2019-05-23-announcing-github-sponsors-a-new-way-to-contribute-to-open-source/ +- https://github.blog/2020-05-12-github-sponsors-is-out-of-beta-for-sponsored-organizations/ +- https://blog.opencollective.com/on-github-sponsors/, 2019 +- https://blog.opencollective.com/double-the-love/, 2020 +- https://blog.opencollective.com/github-sponsors-for-companies-open-source-collective-for-people/ + + +Copyright +--------- + +This document has been placed in the public domain. diff --git a/doc/neps/nep-0049.rst b/doc/neps/nep-0049.rst new file mode 100644 index 000000000000..743dd2ad6e90 --- /dev/null +++ b/doc/neps/nep-0049.rst @@ -0,0 +1,340 @@ +=================================== +NEP 49 — Data allocation strategies +=================================== + +:Author: Matti Picus +:Status: Draft +:Type: Standards Track +:Created: 2021-04-18 +:Resolution: http://numpy-discussion.10968.n7.nabble.com/NEP-49-Data-allocation-strategies-tt49185.html + + +Abstract +-------- + +The ``numpy.ndarray`` requires additional memory allocations +to hold ``numpy.ndarray.strides``, ``numpy.ndarray.shape`` and +``numpy.ndarray.data`` attributes. These attributes are specially allocated +after creating the python object in ``__new__`` method. + +This NEP proposes a mechanism to override the memory management strategy used +for ``ndarray->data`` with user-provided alternatives. This allocation holds +the data and can be very large. As accessing this data often becomes +a performance bottleneck, custom allocation strategies to guarantee data +alignment or pinning allocations to specialized memory hardware can enable +hardware-specific optimizations. The other allocations remain unchanged. + +Motivation and Scope +-------------------- + +Users may wish to override the internal data memory routines with ones of their +own. Two such use-cases are to ensure data alignment and to pin certain +allocations to certain NUMA cores. This desire for alignment was discussed +multiple times on the mailing list `in 2005`_, and in `issue 5312`_ in 2014, +which led to `PR 5457`_ and more mailing list discussions here_ `and here`_. In +a comment on the issue `from 2017`_, a user described how 64-byte alignment +improved performance by 40x. + +Also related is `issue 14177`_ around the use of ``madvise`` and huge pages on +Linux. + +Various tracing and profiling libraries like filprofiler_ or `electric fence`_ +override ``malloc``. + +The long CPython discussion of `BPO 18835`_ began with discussing the need for +``PyMem_Alloc32`` and ``PyMem_Alloc64``. The early conclusion was that the +cost (of wasted padding) vs. the benifit of aligned memory is best left to the +user, but then evolves into a discussion of various proposals to deal with +memory allocations, including `PEP 445`_ `memory interfaces`_ to +``PyTraceMalloc_Track`` which apparently was explictly added for NumPy. + +Allowing users to implement different strategies via the NumPy C-API will +enable exploration of this rich area of possible optimizations. The intention +is to create a flexible enough interface without burdening normative users. + +.. _`issue 5312`: https://github.com/numpy/numpy/issues/5312 +.. _`from 2017`: https://github.com/numpy/numpy/issues/5312#issuecomment-315234656 +.. _`in 2005`: https://numpy-discussion.scipy.narkive.com/MvmMkJcK/numpy-arrays-data-allocation-and-simd-alignement +.. _`here`: http://numpy-discussion.10968.n7.nabble.com/Aligned-configurable-memory-allocation-td39712.html +.. _`and here`: http://numpy-discussion.10968.n7.nabble.com/Numpy-s-policy-for-releasing-memory-td1533.html +.. _`issue 14177`: https://github.com/numpy/numpy/issues/14177 +.. _`filprofiler`: https://github.com/pythonspeed/filprofiler/blob/master/design/allocator-overrides.md +.. _`electric fence`: https://github.com/boundarydevices/efence +.. _`memory interfaces`: https://docs.python.org/3/c-api/memory.html#customize-memory-allocators +.. _`BPO 18835`: https://bugs.python.org/issue18835 +.. _`PEP 445`: https://www.python.org/dev/peps/pep-0445/ + +Usage and Impact +---------------- + +The new functions can only be accessed via the NumPy C-API. An example is +included later in this NEP. The added ``struct`` will increase the size of the +``ndarray`` object. It is a necessary price to pay for this approach. We +can be reasonably sure that the change in size will have a minimal impact on +end-user code because NumPy version 1.20 already changed the object size. + +The implementation preserves the use of ``PyTraceMalloc_Track`` to track +allocations already present in NumPy. + +Backward compatibility +---------------------- + +The design will not break backward compatibility. Projects that were assigning +to the ``ndarray->data`` pointer were already breaking the current memory +management strategy and should restore +``ndarray->data`` before calling ``Py_DECREF``. As mentioned above, the change +in size should not impact end-users. + +Detailed description +-------------------- + +High level design +================= + +Users who wish to change the NumPy data memory management routines will use +:c:func:`PyDataMem_SetHandler`, which uses a :c:type:`PyDataMem_Handler` +structure to hold pointers to functions used to manage the data memory. + +Since a call to ``PyDataMem_SetHandler`` will change the default functions, but +that function may be called during the lifetime of an ``ndarray`` object, each +``ndarray`` will carry with it the ``PyDataMem_Handler`` struct used at the +time of its instantiation, and these will be used to reallocate or free the +data memory of the instance. Internally NumPy may use ``memcpy`` or ``memset`` +on the pointer to the data memory. + +The name of the handler will be exposed on the python level via a +``numpy.core.multiarray.get_handler_name(arr)`` function. If called as +``numpy.core.multiarray.get_handler_name()`` it will return the name of the +global handler that will be used to allocate data for the next new `ndarrray`. + +NumPy C-API functions +===================== + +.. c:type:: PyDataMem_Handler + + A struct to hold function pointers used to manipulate memory + + .. code-block:: c + + typedef struct { + char name[128]; /* multiple of 64 to keep the struct aligned */ + PyDataMem_AllocFunc *alloc; + PyDataMem_ZeroedAllocFunc *zeroed_alloc; + PyDataMem_FreeFunc *free; + PyDataMem_ReallocFunc *realloc; + } PyDataMem_Handler; + + where the function's signatures are + + .. code-block:: c + + typedef void *(PyDataMem_AllocFunc)(size_t size); + typedef void *(PyDataMem_ZeroedAllocFunc)(size_t nelems, size_t elsize); + typedef void (PyDataMem_FreeFunc)(void *ptr, size_t size); + typedef void *(PyDataMem_ReallocFunc)(void *ptr, size_t size); + +.. c:function:: const PyDataMem_Handler * PyDataMem_SetHandler(PyDataMem_Handler *handler) + + Sets a new allocation policy. If the input value is ``NULL``, will reset + the policy to the default. Returns the previous policy, ``NULL`` if the + previous policy was the default. We wrap the user-provided functions + so they will still call the Python and NumPy memory management callback + hooks. All the function pointers must be filled in, ``NULL`` is not + accepted. + +.. c:function:: const char * PyDataMem_GetHandlerName(PyArrayObject *obj) + + Return the const char name of the ``PyDataMem_Handler`` used by the + ``PyArrayObject``. If ``NULL``, return the name of the current global policy + that will be used to allocate data for the next ``PyArrayObject``. + + +Sample code +=========== + +This code adds a 64-byte header to each ``data`` pointer and stores information +about the allocation in the header. Before calling ``free``, a check ensures +the ``sz`` argument is correct. + +.. code-block:: c + + #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION + #include + NPY_NO_EXPORT void * + + shift_alloc(size_t sz) { + char *real = (char *)malloc(sz + 64); + if (real == NULL) { + return NULL; + } + snprintf(real, 64, "originally allocated %ld", (unsigned long)sz); + return (void *)(real + 64); + } + + NPY_NO_EXPORT void * + shift_zero(size_t sz, size_t cnt) { + char *real = (char *)calloc(sz + 64, cnt); + if (real == NULL) { + return NULL; + } + snprintf(real, 64, "originally allocated %ld via zero", + (unsigned long)sz); + return (void *)(real + 64); + } + + NPY_NO_EXPORT void + shift_free(void * p, npy_uintp sz) { + if (p == NULL) { + return ; + } + char *real = (char *)p - 64; + if (strncmp(real, "originally allocated", 20) != 0) { + fprintf(stdout, "uh-oh, unmatched shift_free, " + "no appropriate prefix\\n"); + /* Make the C runtime crash by calling free on the wrong address */ + free((char *)p + 10); + /* free(real); */ + } + else { + int i = atoi(real +20); + if (i != sz) { + fprintf(stderr, "uh-oh, unmatched " + "shift_free(ptr, %d) but allocated %d\\n", sz, i); + /* Make the C runtime crash by calling free on the wrong address */ + /* free((char *)p + 10); */ + free(real); + } + else { + free(real); + } + } + } + + NPY_NO_EXPORT void * + shift_realloc(void * p, npy_uintp sz) { + if (p != NULL) { + char *real = (char *)p - 64; + if (strncmp(real, "originally allocated", 20) != 0) { + fprintf(stdout, "uh-oh, unmatched shift_realloc\\n"); + return realloc(p, sz); + } + return (void *)((char *)realloc(real, sz + 64) + 64); + } + else { + char *real = (char *)realloc(p, sz + 64); + if (real == NULL) { + return NULL; + } + snprintf(real, 64, "originally allocated " + "%ld via realloc", (unsigned long)sz); + return (void *)(real + 64); + } + } + + static PyDataMem_Handler new_handler = { + "secret_data_allocator", + shift_alloc, /* alloc */ + shift_zero, /* zeroed_alloc */ + shift_free, /* free */ + shift_realloc /* realloc */ + }; + + static PyObject* mem_policy_test_prefix(PyObject *self, PyObject *args) + { + + if (!PyArray_Check(args)) { + PyErr_SetString(PyExc_ValueError, + "must be called with a numpy scalar or ndarray"); + } + return PyUnicode_FromString( + PyDataMem_GetHandlerName((PyArrayObject*)args)); + }; + + static PyObject* mem_policy_set_new_policy(PyObject *self, PyObject *args) + { + + const PyDataMem_Handler *old = PyDataMem_SetHandler(&new_handler); + return PyUnicode_FromString(old->name); + + }; + + static PyObject* mem_policy_set_old_policy(PyObject *self, PyObject *args) + { + + const PyDataMem_Handler *old = PyDataMem_SetHandler(NULL); + return PyUnicode_FromString(old->name); + + }; + + static PyMethodDef methods[] = { + {"test_prefix", (PyCFunction)mem_policy_test_prefix, METH_O}, + {"set_new_policy", (PyCFunction)mem_policy_set_new_policy, METH_NOARGS}, + {"set_old_policy", (PyCFunction)mem_policy_set_old_policy, METH_NOARGS}, + { NULL } + }; + + static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "mem_policy", /* m_name */ + NULL, /* m_doc */ + -1, /* m_size */ + methods, /* m_methods */ + }; + + PyMODINIT_FUNC + PyInit_mem_policy(void) { + PyObject *mod = PyModule_Create(&moduledef); + import_array(); + return mod; + } + + +Related Work +------------ + +This NEP is being tracked by the pnumpy_ project and a `comment in the PR`_ +mentions use in orchestrating FPGA DMAs. + +Implementation +-------------- + +This NEP has been implemented in `PR 17582`_. + +Alternatives +------------ + +These were discussed in `issue 17467`_. `PR 5457`_ and `PR 5470`_ proposed a +global interface for specifying aligned allocations. + +``PyArray_malloc_aligned`` and friends were added to NumPy with the +`numpy.random` module API refactor. and are used there for performance. + +`PR 390`_ had two parts: expose ``PyDataMem_*`` via the NumPy C-API, and a hook +mechanism. The PR was merged with no example code for using these features. + +Discussion +---------- + +Not yet discussed on the mailing list. + + +References and Footnotes +------------------------ + +.. [1] Each NEP must either be explicitly labeled as placed in the public domain (see + this NEP as an example) or licensed under the `Open Publication License`_. + +.. _Open Publication License: https://www.opencontent.org/openpub/ + +.. _`PR 17582`: https://github.com/numpy/numpy/pull/17582 +.. _`PR 5457`: https://github.com/numpy/numpy/pull/5457 +.. _`PR 5470`: https://github.com/numpy/numpy/pull/5470 +.. _`PR 390`: https://github.com/numpy/numpy/pull/390 +.. _`issue 17467`: https://github.com/numpy/numpy/issues/17467 +.. _`comment in the PR`: https://github.com/numpy/numpy/pull/17582#issuecomment-809145547 +.. _pnumpy: https://quansight.github.io/pnumpy/stable/index.html + +Copyright +--------- + +This document has been placed in the public domain. [1]_ diff --git a/doc/neps/roadmap.rst b/doc/neps/roadmap.rst index 40fcbd325222..7e5d1a03b0a8 100644 --- a/doc/neps/roadmap.rst +++ b/doc/neps/roadmap.rst @@ -17,6 +17,12 @@ facilitate interoperability with all such packages, and the code that uses them, may include (among other things) interoperability protocols, better duck typing support and ndarray subclass handling. +The key goal is: *make it easy for code written for NumPy to also work with +other NumPy-like projects.* This will enable GPU support via, e.g, CuPy or JAX, +distributed array support via Dask, and writing special-purpose arrays (either +from scratch, or as a ``numpy.ndarray`` subclass) that work well with SciPy, +scikit-learn and other such packages. + The ``__array_ufunc__`` and ``__array_function__`` protocols are stable, but do not cover the whole API. New protocols for overriding other functionality in NumPy are needed. Work in this area aims to bring to completion one or more @@ -33,56 +39,59 @@ of the API, as discussed in `this section of NEP 37 `__. -Extensibility -------------- - -We aim to make it much easier to extend NumPy. The primary topic here is to -improve the dtype system. - -- Easier custom dtypes: - - - Simplify and/or wrap the current C-API - - More consistent support for dtype metadata - - Support for writing a dtype in Python - -- New string dtype(s): - - - Encoded strings with fixed-width storage (utf8, latin1, ...) and/or - - Variable length strings (could share implementation with dtype=object, - but are explicitly type-checked) - - One of these should probably be the default for text data. The current - behavior on Python 3 is neither efficient nor user friendly. - - Performance ----------- -Improvements to NumPy's performance are important to many users. The primary -topic at the moment is better use of SIMD instructions, also on platforms other -than x86 - see :ref:`NEP38`. +Improvements to NumPy's performance are important to many users. We have +focused this effort on Universal SIMD (see :ref:`NEP38`) intrinsics which +provide nice improvements across various hardware platforms via an abstraction +layer. The infrastructure is in place, and we welcome follow-on PRs to add +SIMD support across all relevant NumPy functions. Other performance improvement ideas include: -- Reducing ufunc and ``__array_function__`` overhead. -- Optimizations in individual functions. - A better story around parallel execution. +- Optimizations in individual functions. +- Reducing ufunc and ``__array_function__`` overhead. Furthermore we would like to improve the benchmarking system, in terms of coverage, easy of use, and publication of the results (now `here `__) as part of the docs or website. -Website and documentation +Documentation and website ------------------------- The NumPy `documentation `__ is of varying quality. The API documentation is in good shape; tutorials and high-level documentation on many topics are missing or outdated. See :ref:`NEP44` for -planned improvements. +planned improvements. Adding more tutorials is underway in the +`numpy-tutorials repo `__. Our website (https://numpy.org) was completely redesigned recently. We aim to -further improve it by adding translations, better Hugo-Sphinx integration via a -new Sphinx theme, and more (see `this tracking issue `__). +further improve it by adding translations, more case studies and other +high-level content, and more (see `this tracking issue `__). + + +Extensibility +------------- + +We aim to make it much easier to extend NumPy. The primary topic here is to +improve the dtype system - see :ref:`NEP41` and related NEPs linked from it. +Concrete goals for the dtype system rewrite are: + +- Easier custom dtypes: + + - Simplify and/or wrap the current C-API + - More consistent support for dtype metadata + - Support for writing a dtype in Python + +- Allow adding (a) new string dtype(s). This could be encoded strings with + fixed-width storage (e.g., ``utf8`` or ``latin1``), and/or a variable length + string dtype. The latter could share an implementation with ``dtype=object``, + but be explicitly type-checked. + One of these should probably be the default for text data. The current + string dtype support is neither efficient nor user friendly. User experience @@ -90,18 +99,17 @@ User experience Type annotations ```````````````` -We aim to add type annotations for all NumPy functionality, so users can use +NumPy 1.20 adds type annotations for most NumPy functionality, so users can use tools like `mypy`_ to type check their code and IDEs can improve their support -for NumPy. The existing type stubs in the `numpy-stubs`_ repository are being -improved and will be moved into the NumPy code base. +for NumPy. Improving those type annotations, for example to support annotating +array shapes and dtypes, is ongoing. Platform support ```````````````` We aim to increase our support for different hardware architectures. This includes adding CI coverage when CI services are available, providing wheels on -PyPI for ARM64 (``aarch64``) and POWER8/9 (``ppc64le``), providing better -build and install documentation, and resolving build issues on other platforms -like AIX. +PyPI for POWER8/9 (``ppc64le``), providing better build and install +documentation, and resolving build issues on other platforms like AIX. Maintenance @@ -126,4 +134,3 @@ Maintenance .. _`mypy`: https://mypy.readthedocs.io -.. _`numpy-stubs`: https://github.com/numpy/numpy-stubs diff --git a/doc/release/upcoming_changes/README.rst b/doc/release/upcoming_changes/README.rst index ff5ca514c3b2..436535ecddbc 100644 --- a/doc/release/upcoming_changes/README.rst +++ b/doc/release/upcoming_changes/README.rst @@ -50,7 +50,7 @@ and double-backticks for code. If you are unsure what pull request type to use, don't hesitate to ask in your PR. -You can install ``towncrier`` and run ``towncrier --draft --version 1.18`` +You can install ``towncrier`` and run ``towncrier build --draft --version 1.18`` if you want to get a preview of how your change will look in the final release notes. diff --git a/doc/source/_static/favicon/apple-touch-icon.png b/doc/source/_static/favicon/apple-touch-icon.png new file mode 100644 index 000000000000..e6cd574260aa Binary files /dev/null and b/doc/source/_static/favicon/apple-touch-icon.png differ diff --git a/doc/source/_static/favicon/favicon-16x16.png b/doc/source/_static/favicon/favicon-16x16.png new file mode 100644 index 000000000000..95beb08342d6 Binary files /dev/null and b/doc/source/_static/favicon/favicon-16x16.png differ diff --git a/doc/source/_static/favicon/favicon-32x32.png b/doc/source/_static/favicon/favicon-32x32.png new file mode 100644 index 000000000000..cc06622fa04b Binary files /dev/null and b/doc/source/_static/favicon/favicon-32x32.png differ diff --git a/doc/source/_static/favicon/favicon.ico b/doc/source/_static/favicon/favicon.ico new file mode 100644 index 000000000000..4ed63bf67ed4 Binary files /dev/null and b/doc/source/_static/favicon/favicon.ico differ diff --git a/doc/source/_static/numpy.css b/doc/source/_static/numpy.css index 22d08cc0dca6..53b610bf13d9 100644 --- a/doc/source/_static/numpy.css +++ b/doc/source/_static/numpy.css @@ -18,14 +18,8 @@ pre, code { } h1 { - font-style: "Lato", sans-serif; + font-family: "Lato", sans-serif; color: #013243; /* warm black */ - font-weight: 700; - letter-spacing: -.04em; - text-align: right; - margin-top: 3rem; - margin-bottom: 4rem; - font-size: 3rem; } diff --git a/doc/source/_static/numpylogo.svg b/doc/source/_static/numpylogo.svg index 5f0dac7007a1..a566851b8699 100644 --- a/doc/source/_static/numpylogo.svg +++ b/doc/source/_static/numpylogo.svg @@ -1,23 +1,23 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/source/_static/scipy-mathjax b/doc/source/_static/scipy-mathjax new file mode 160000 index 000000000000..3d21c58225c0 --- /dev/null +++ b/doc/source/_static/scipy-mathjax @@ -0,0 +1 @@ +Subproject commit 3d21c58225c09243d5a088b1557654d280925e02 diff --git a/doc/source/_templates/autosummary/module.rst b/doc/source/_templates/autosummary/module.rst new file mode 100644 index 000000000000..e1f428d6598e --- /dev/null +++ b/doc/source/_templates/autosummary/module.rst @@ -0,0 +1,40 @@ +{% extends "!autosummary/module.rst" %} + +{# This file is almost the same as the default, but adds :toctree: to the autosummary directives. + The original can be found at `sphinx/ext/autosummary/templates/autosummary/module.rst`. #} + +{% block attributes %} +{% if attributes %} + .. rubric:: Module Attributes + + .. autosummary:: + :toctree: + {% for item in attributes %} + {{ item }} + {%- endfor %} +{% endif %} +{% endblock %} + +{% block functions %} +{% if functions %} + .. rubric:: Functions + + .. autosummary:: + :toctree: + {% for item in functions %} + {{ item }} + {%- endfor %} +{% endif %} +{% endblock %} + +{% block classes %} +{% if classes %} + .. rubric:: Classes + + .. autosummary:: + :toctree: + {% for item in classes %} + {{ item }} + {%- endfor %} +{% endif %} +{% endblock %} diff --git a/doc/source/_templates/indexcontent.html b/doc/source/_templates/indexcontent.html index 6dd6bf9b0851..184a3ca64e2c 100644 --- a/doc/source/_templates/indexcontent.html +++ b/doc/source/_templates/indexcontent.html @@ -7,30 +7,29 @@

{{ docstitle|e }}

Welcome! This is the documentation for NumPy {{ release|e }} - {% if last_updated %}, last updated {{ last_updated|e }}{% endif %}. + {%- if last_updated %}, last updated {{ last_updated|e }}{% endif %}.

For users:

+ - - + - - - - + + List of the most important terms

@@ -41,10 +40,8 @@

{{ docstitle|e }}

Contributing to NumPy

- - +