diff options
Diffstat (limited to 'doc')
89 files changed, 2695 insertions, 756 deletions
diff --git a/doc/HOWTO_RELEASE.rst.txt b/doc/HOWTO_RELEASE.rst.txt index 5a9c4d505..9dbee320c 100644 --- a/doc/HOWTO_RELEASE.rst.txt +++ b/doc/HOWTO_RELEASE.rst.txt @@ -460,6 +460,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 diff --git a/doc/Makefile b/doc/Makefile index dd63702de..68d496389 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 " <!-- insert here -->" @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 0ff9ff933..733f681af 100644 --- a/doc/RELEASE_WALKTHROUGH.rst.txt +++ b/doc/RELEASE_WALKTHROUGH.rst.txt @@ -1,41 +1,37 @@ -This file contains a walkthrough of the NumPy 1.14.5 release on Linux, modified +This file contains a walkthrough of the NumPy 1.19.0 release on Linux, modified for building on azure and uploading to anaconda.org The commands can be copied into the command line, but be sure to -replace 1.14.5 by the correct version. +replace 1.19.0 by the correct version. This should be read together with the general directions in `releasing`. -Release Walkthrough -==================== - -Note that in the code snippets below, ``upstream`` refers to the root repository on -github and ``origin`` to a fork in your personal account. You may need to make adjustments -if you have not forked the repository but simply cloned it locally. You can -also edit ``.git/config`` and add ``upstream`` if it isn't already present. - +Release Preparation +=================== Backport Pull Requests ---------------------- Changes that have been marked for this release must be backported to the -maintenance/1.14.x branch. +maintenance/1.19.x branch. Update Release documentation ---------------------------- -The file ``doc/changelog/1.14.5-changelog.rst`` should be updated to reflect +The file ``doc/changelog/1.19.0-changelog.rst`` should be updated to reflect the final list of changes and contributors. This text can be generated by:: - $ python tools/changelog.py $GITHUB v1.14.4..maintenance/1.14.x > doc/changelog/1.14.5-changelog.rst + $ python tools/changelog.py $GITHUB v1.18.0..maintenance/1.19.x > doc/changelog/1.19.0-changelog.rst where ``GITHUB`` contains your github access token. This text may also be -appended to ``doc/release/1.14.5-notes.rst`` for release updates, though not -for new releases like ``1.14.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. +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 +should be reviewed for name duplicates or short names and the ``.mailmap`` file +updated if needed. Finish the Release Note @@ -46,25 +42,33 @@ Finish the Release Note This has changed now that we use ``towncrier``. See the instructions for creating the release note in ``doc/release/upcoming_changes/README.rst``. -Fill out the release note ``doc/release/1.14.5-notes.rst`` calling out +Fill out the release note ``doc/release/1.19.0-notes.rst`` calling out significant changes. +Release Walkthrough +==================== + +Note that in the code snippets below, ``upstream`` refers to the root repository on +github and ``origin`` to a fork in your personal account. You may need to make adjustments +if you have not forked the repository but simply cloned it locally. You can +also edit ``.git/config`` and add ``upstream`` if it isn't already present. + Prepare the release commit -------------------------- Checkout the branch for the release, make sure it is up to date, and clean the repository:: - $ git checkout maintenance/1.14.x - $ git pull upstream maintenance/1.14.x + $ git checkout maintenance/1.19.x + $ git pull upstream maintenance/1.19.x $ git submodule update $ git clean -xdfq Edit pavement.py and setup.py as detailed in HOWTO_RELEASE:: - $ gvim pavement.py setup.py - $ git commit -a -m"REL: NumPy 1.14.5 release." + $ gvim pavement.py setup.py # Generally only setup.py needs updating + $ git commit -a -m"REL: NumPy 1.19.0 release." Sanity check:: @@ -73,9 +77,7 @@ Sanity check:: Push this release directly onto the end of the maintenance branch. This requires write permission to the numpy repository:: - $ git push upstream maintenance/1.14.x - -As an example, see the 1.14.3 REL commit: `<https://github.com/numpy/numpy/commit/73299826729be58cec179b52c656adfcaefada93>`_. + $ git push upstream HEAD Build source releases @@ -86,7 +88,7 @@ Paver is used to build the source releases. It will create the ``release`` and source releases in the latter. :: $ python3 -m cython --version # check for correct cython version - $ paver sdist # sdist will do a git clean -xdf, so we omit that + $ paver sdist # sdist will do a git clean -xdfq, so we omit that Build wheels @@ -94,55 +96,46 @@ Build wheels Trigger the wheels build by pointing the numpy-wheels repository at this commit. This can take up to an hour. The numpy-wheels repository is cloned from -`<https://github.com/MacPython/numpy-wheels>`_. Start with a pull as the repo -may have been accessed and changed by someone else and a push will fail:: +`<https://github.com/MacPython/numpy-wheels>`_. If this is the first release in +a series, start with a pull as the repo may have been accessed and changed by +someone else, then create a new branch for the series. If the branch already +exists skip this:: $ cd ../numpy-wheels + $ git co master $ git pull upstream master - $ git branch <new version> # only when starting new numpy version - $ git checkout v1.14.x # v1.14.x already existed for the 1.14.4 release + $ git branch v1.19.x -Edit the ``azure/posix.yml`` and ``azure/windows.yml`` files to make sure they -have the correct version, and put in the commit hash for the ``REL`` commit -created above for ``BUILD_COMMIT``, see an _example:: +Checkout the new branch and edit the ``azure-pipelines.yml`` and +``.travis.yml`` files to make sure they have the correct version, and put in +the commit hash for the ``REL`` commit created above for ``BUILD_COMMIT``. The +``azure/posix.yml`` and ``.travis.yml`` files may also need the Cython versions +updated to keep up with Python releases, but generally just do:: - $ gvim azure/posix.yml azure/windows.yml - $ git commit -a + $ git checkout v1.19.x + $ gvim azure-pipelines .travis.yml + $ git commit -a -m"NumPy 1.19.0 release." $ git push upstream HEAD Now wait. If you get nervous at the amount of time taken -- the builds can take a while -- you can check the build progress by following the links -provided at `<https://github.com/MacPython/numpy-wheels>`_ to check the +provided at `<https://github.com/MacPython/numpy-wheels>`_ to check the build status. Check if all the needed wheels have been built and -uploaded before proceeding. There should currently be 21 of them at -`<https://anaconda.org/multibuild-wheels-staging/numpy/files>`_, 3 for Mac, 6 -for Windows, and 12 for Linux. +uploaded to the staging repository before proceeding. -.. example_: https://github.com/MacPython/numpy-wheels/pull/80/commits/cbf4af4 - -Note that sometimes builds, like tests, fail for unrelated reasons and -you will need to restart them. +Note that sometimes builds, like tests, fail for unrelated reasons and you will +need to rerun them. You will need to be logged in under 'numpy' to do this +on azure. Download wheels --------------- -When the wheels have all been successfully built, download them using the ``wheel-uploader`` -in the ``terryfy`` repository. The terryfy repository may be cloned from -`<https://github.com/MacPython/terryfy>`_ if you don't already have it. The -wheels can also be uploaded using the ``wheel-uploader``, but we prefer to -download all the wheels to the ``../numpy/release/installers`` directory and -upload later using ``twine``:: +When the wheels have all been successfully built and staged, download them from the +Anaconda staging directory using the ``tools/download-wheels.py`` script:: - $ cd ../terryfy - $ git pull upstream master - $ CDN_URL=https://anaconda.org/multibuild-wheels-staging/numpy/files - $ NPY_WHLS=../numpy/release/installers - $ ./wheel-uploader -u $CDN_URL -n -v -w $NPY_WHLS -t win numpy 1.14.5 - $ ./wheel-uploader -u $CDN_URL -n -v -w $NPY_WHLS -t manylinux1 numpy 1.14.5 - $ ./wheel-uploader -u $CDN_URL -n -v -w $NPY_WHLS -t macosx numpy 1.14.5 + $ cd ../numpy + $ python3 tools/download-wheels.py 1.19.0 -If you do this often, consider making CDN_URL and NPY_WHLS part of your default -environment. Generate the README files ------------------------- @@ -150,18 +143,16 @@ Generate the README files This needs to be done after all installers are downloaded, but before the pavement file is updated for continued development:: - $ cd ../numpy $ paver write_release Tag the release --------------- -Once the wheels have been built and downloaded without errors, go back to your -numpy repository in the maintenance branch and tag the ``REL`` commit, signing +Once the wheels have been built and downloaded without errors tag the ``REL`` commit, signing it with your gpg key:: - $ git tag -s v1.14.5 + $ git tag -s -m"NumPy 1.19.0 release" v1.19.0 You should upload your public gpg key to github, so that the tag will appear "verified" there. @@ -169,7 +160,7 @@ You should upload your public gpg key to github, so that the tag will appear Check that the files in ``release/installers`` have the correct versions, then push the tag upstream:: - $ git push upstream v1.14.5 + $ git push upstream v1.19.0 We wait until this point to push the tag because it is public and should not be changed after it has been pushed. @@ -185,9 +176,9 @@ Add another ``REL`` commit to the numpy maintenance branch, which resets the Create release notes for next release and edit them to set the version:: - $ cp doc/source/release/template.rst doc/source/release/1.14.6-notes.rst - $ gvim doc/source/release/1.14.6-notes.rst - $ git add doc/source/release/1.14.6-notes.rst + $ cp doc/source/release/template.rst doc/source/release/1.19.1-notes.rst + $ gvim doc/source/release/1.19.1-notes.rst + $ git add doc/source/release/1.19.1-notes.rst Add new release notes to the documentation release list:: @@ -195,26 +186,24 @@ Add new release notes to the documentation release list:: Commit the result:: - $ git commit -a -m"REL: prepare 1.14.x for further development" - $ git push upstream maintenance/1.14.x + $ git commit -a -m"REL: prepare 1.19.x for further development" + $ git push upstream HEAD Upload to PyPI -------------- Upload to PyPI using ``twine``. A recent version of ``twine`` of is needed -after recent PyPI changes, version ``1.11.0`` was used here. - -.. code-block:: sh +after recent PyPI changes, version ``3.1.1`` was used here:: $ cd ../numpy $ twine upload release/installers/*.whl - $ twine upload release/installers/numpy-1.14.5.zip # Upload last. + $ twine upload release/installers/numpy-1.19.0.zip # Upload last. -If one of the commands breaks in the middle, which is not uncommon, you may -need to selectively upload the remaining files because PyPI does not allow the -same file to be uploaded twice. The source file should be uploaded last to -avoid synchronization problems if pip users access the files while this is in +If one of the commands breaks in the middle, you may need to selectively upload +the remaining files because PyPI does not allow the same file to be uploaded +twice. The source file should be uploaded last to avoid synchronization +problems that might occur if pip users access the files while this is in process. Note that PyPI only allows a single source distribution, here we have chosen the zip archive. @@ -222,15 +211,16 @@ chosen the zip archive. Upload files to github ---------------------- -Go to `<https://github.com/numpy/numpy/releases>`_, there should be a ``v1.14.5 +Go to `<https://github.com/numpy/numpy/releases>`_, there should be a ``v1.19.0 tag``, click on it and hit the edit button for that tag. There are two ways to -add files, using an editable text window and as binary uploads. +add files, using an editable text window and as binary uploads. Cut and paste +the ``release/README.md`` file contents into the text window. You will probably +need to make some edits to get it to look right. Then -- Cut and paste the ``release/README.md`` file contents into the text window. -- Upload ``release/installers/numpy-1.14.5.tar.gz`` as a binary file. -- Upload ``release/installers/numpy-1.14.5.zip`` as a binary file. +- Upload ``release/installers/numpy-1.19.0.tar.gz`` as a binary file. +- Upload ``release/installers/numpy-1.19.0.zip`` as a binary file. - Upload ``release/README.rst`` as a binary file. -- Upload ``doc/changelog/1.14.5-changelog.rst`` as a binary file. +- Upload ``doc/changelog/1.19.0-changelog.rst`` as a binary file. - Check the pre-release button if this is a pre-releases. - Hit the ``{Publish,Update} release`` button at the bottom. @@ -255,7 +245,7 @@ If the release series is a new one, you will need to add a new section to the Otherwise, only the ``zip`` and ``pdf`` links should be updated with the new tag name:: - $ gvim doc/build/merge/index.html +/'tag v1.14' + $ gvim doc/build/merge/index.html +/'tag v1.19' You can "test run" the new documentation in a browser to make sure the links work:: @@ -265,7 +255,7 @@ work:: Once everything seems satisfactory, commit and upload the changes:: $ pushd doc/build/merge - $ git commit -am"Add documentation for v1.14.5" + $ git commit -am"Add documentation for v1.19.0" $ git push $ popd @@ -277,7 +267,7 @@ This assumes that you have forked `<https://github.com/scipy/scipy.org>`_:: $ cd ../scipy.org $ git checkout master $ git pull upstream master - $ git checkout -b numpy-1.14.5 + $ git checkout -b numpy-1.19.0 $ gvim www/index.rst # edit the News section $ git commit -a $ git push origin HEAD @@ -300,13 +290,14 @@ Post-Release Tasks Checkout master and forward port the documentation changes:: - $ git checkout -b update-after-1.14.5-release - $ git checkout maintenance/1.14.x doc/source/release/1.14.5-notes.rst - $ git checkout maintenance/1.14.x doc/changelog/1.14.5-changelog.rst + $ git checkout -b post-1.19.0-release-update + $ git checkout maintenance/1.19.x doc/source/release/1.19.0-notes.rst + $ git checkout maintenance/1.19.x doc/changelog/1.19.0-changelog.rst + $ git checkout maintenance/1.19.x .mailmap # only if updated for release. $ gvim doc/source/release.rst # Add link to new notes - $ git add doc/changelog/1.14.5-changelog.rst doc/source/release/1.14.5-notes.rst + $ 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.14.5 release." + $ git commit -a -m"REL: Update master after 1.19.0 release." $ git push origin HEAD Go to github and make a PR. diff --git a/doc/changelog/1.19.3-changelog.rst b/doc/changelog/1.19.3-changelog.rst new file mode 100644 index 000000000..5e8dfa10b --- /dev/null +++ b/doc/changelog/1.19.3-changelog.rst @@ -0,0 +1,31 @@ + +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 +* Chris Brown + +* Daniel Vanzo + +* E. Madison Bray + +* Hugo van Kemenade + +* Ralf Gommers +* Sebastian Berg +* @danbeibei + + +Pull requests merged +==================== + +A total of 10 pull requests were merged for this release. + +* `#17298 <https://github.com/numpy/numpy/pull/17298>`__: BLD: set upper versions for build dependencies +* `#17336 <https://github.com/numpy/numpy/pull/17336>`__: BUG: Set deprecated fields to null in PyArray_InitArrFuncs +* `#17446 <https://github.com/numpy/numpy/pull/17446>`__: ENH: Warn on unsupported Python 3.10+ +* `#17450 <https://github.com/numpy/numpy/pull/17450>`__: MAINT: Update test_requirements.txt. +* `#17522 <https://github.com/numpy/numpy/pull/17522>`__: ENH: Support for the NVIDIA HPC SDK nvfortran compiler +* `#17568 <https://github.com/numpy/numpy/pull/17568>`__: BUG: Cygwin Workaround for #14787 on affected platforms +* `#17647 <https://github.com/numpy/numpy/pull/17647>`__: BUG: Fix memory leak of buffer-info cache due to relaxed strides +* `#17652 <https://github.com/numpy/numpy/pull/17652>`__: MAINT: Backport openblas_support from master. +* `#17653 <https://github.com/numpy/numpy/pull/17653>`__: TST: Add Python 3.9 to the CI testing on Windows, Mac. +* `#17660 <https://github.com/numpy/numpy/pull/17660>`__: TST: Simplify source path names in test_extending. diff --git a/doc/changelog/1.19.4-changelog.rst b/doc/changelog/1.19.4-changelog.rst new file mode 100644 index 000000000..82632b990 --- /dev/null +++ b/doc/changelog/1.19.4-changelog.rst @@ -0,0 +1,16 @@ + +Contributors +============ + +A total of 1 people contributed to this release. People with a "+" by their +names contributed a patch for the first time. + +* Charles Harris + +Pull requests merged +==================== + +A total of 2 pull requests were merged for this release. + +* `#17679 <https://github.com/numpy/numpy/pull/17679>`__: MAINT: Add check for Windows 10 version 2004 bug. +* `#17680 <https://github.com/numpy/numpy/pull/17680>`__: REV: Revert OpenBLAS to 1.19.2 version for 1.19.4 diff --git a/doc/changelog/1.20.0-changelog.rst b/doc/changelog/1.20.0-changelog.rst new file mode 100644 index 000000000..5db423c41 --- /dev/null +++ b/doc/changelog/1.20.0-changelog.rst @@ -0,0 +1,845 @@ + +Contributors +============ + +A total of 182 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 andryandrew@gmail.com andryandrew + +* Andrew Eckart + +* Anirudh Subramanian +* Anthony Byuraev + +* Antonio Larrosa + +* Ashutosh Singh + +* Bangcheng Yang + +* Bas van Beek + +* Ben Derrett + +* Ben Elliston + +* Ben Nathanson + +* 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 + +* Chunlin Fang +* CloseChoice + +* Daniel G. A. Smith + +* Daniel Hrisca +* Daniel Vanzo + +* David Pitchford + +* Davide Dal Bosco + +* Dima Kogan + +* Dmitry Kutlenkov + +* Douglas Fenstermacher + +* Dustin Spicuzza + +* E. Madison Bray + +* Elia Franzella + +* Enrique Matías Sánchez (Quique) + +* Erfan Nariman | Veneficus + +* Eric Larson +* Eric Moore +* Eric Wieser +* Erik M. Bray +* EthanCJ-git + +* Etienne Guesnet + +* 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 Jacobson + +* 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 + +* 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 + +* @bernie gray + +* @danbeibei + +* @dojafrat +* @dpitch40 + +* @forfun + +* @iamsoto + +* @jbrockmendel + +* @leeyspaul + +* @mitch + +* @prateek arora + +* @qiyu8 + +* @serge-sans-paille + +* @skywalker + +* @stphnlyd + +* @xoviat +* @谭九鼎 + +* @JMFT + +* @Jack + +* @Neal C + + +Pull requests merged +==================== + +A total of 650 pull requests were merged for this release. + +* `#13516 <https://github.com/numpy/numpy/pull/13516>`__: ENH: enable multi-platform SIMD compiler optimizations +* `#14779 <https://github.com/numpy/numpy/pull/14779>`__: NEP 36 (fair play) +* `#14882 <https://github.com/numpy/numpy/pull/14882>`__: DEP: Deprecate aliases of builtin types in python 3.7+ +* `#15037 <https://github.com/numpy/numpy/pull/15037>`__: BUG: ``np.resize`` negative shape and subclasses edge case fixes +* `#15121 <https://github.com/numpy/numpy/pull/15121>`__: ENH: random: Add the method ``permuted`` to Generator. +* `#15162 <https://github.com/numpy/numpy/pull/15162>`__: BUG,MAINT: Fix issues with non-reduce broadcasting axes +* `#15471 <https://github.com/numpy/numpy/pull/15471>`__: BUG: Ensure PyArray_FromScalar always returns the requested dtype +* `#15507 <https://github.com/numpy/numpy/pull/15507>`__: NEP 42: Technical decisions for new DTypes +* `#15508 <https://github.com/numpy/numpy/pull/15508>`__: API: Create Preliminary DTypeMeta class and np.dtype subclasses +* `#15604 <https://github.com/numpy/numpy/pull/15604>`__: MAINT: Avoid exception in NpzFile destructor if constructor raises... +* `#15666 <https://github.com/numpy/numpy/pull/15666>`__: ENH: Improved ``__str__`` for polynomials +* `#15759 <https://github.com/numpy/numpy/pull/15759>`__: BUILD: Remove Accelerate support +* `#15791 <https://github.com/numpy/numpy/pull/15791>`__: [DOC] Added tutorial about the numpy.ma module. +* `#15852 <https://github.com/numpy/numpy/pull/15852>`__: ENH: Add where argument to np.mean +* `#15886 <https://github.com/numpy/numpy/pull/15886>`__: DEP: Deprecate passing shape=None to mean shape=() +* `#15900 <https://github.com/numpy/numpy/pull/15900>`__: DEP: Ensure indexing errors will be raised even on empty results +* `#15997 <https://github.com/numpy/numpy/pull/15997>`__: ENH: improve printing of arrays with multi-line reprs +* `#16130 <https://github.com/numpy/numpy/pull/16130>`__: DOC: Correct documentation of ``__array__`` when used as output... +* `#16134 <https://github.com/numpy/numpy/pull/16134>`__: ENH: Implement concatenate dtype and casting keyword arguments +* `#16156 <https://github.com/numpy/numpy/pull/16156>`__: DEP: Deprecate ``numpy.dual``. +* `#16161 <https://github.com/numpy/numpy/pull/16161>`__: BUG: Potential fix for divmod(1.0, 0.0) to raise divbyzero and... +* `#16167 <https://github.com/numpy/numpy/pull/16167>`__: DOC: Increase guidance and detail of np.polynomial docstring +* `#16174 <https://github.com/numpy/numpy/pull/16174>`__: DOC: Add transition note to all lib/poly functions +* `#16200 <https://github.com/numpy/numpy/pull/16200>`__: ENH: Rewrite of array-coercion to support new dtypes +* `#16205 <https://github.com/numpy/numpy/pull/16205>`__: ENH: Add ``full_output`` argument to ``f2py.compile``. +* `#16232 <https://github.com/numpy/numpy/pull/16232>`__: DEP: Deprecate ufunc.outer with matrix inputs +* `#16238 <https://github.com/numpy/numpy/pull/16238>`__: MAINT: Unify cached (C-level static) imports +* `#16239 <https://github.com/numpy/numpy/pull/16239>`__: BUG,DOC: Allow attach docs twice but error if wrong +* `#16242 <https://github.com/numpy/numpy/pull/16242>`__: BUG: Fix default fallback in genfromtxt +* `#16247 <https://github.com/numpy/numpy/pull/16247>`__: ENH:Umath Replace raw SIMD of unary float point(32-64) with NPYV... +* `#16248 <https://github.com/numpy/numpy/pull/16248>`__: MRG, ENH: added edge keyword argument to digitize +* `#16257 <https://github.com/numpy/numpy/pull/16257>`__: DOC: Update the f2py section of the "Using Python as Glue" page. +* `#16260 <https://github.com/numpy/numpy/pull/16260>`__: DOC: Improve ``rec.array`` function documentation (#15853) +* `#16266 <https://github.com/numpy/numpy/pull/16266>`__: ENH: include dt64/td64 isinstance checks in ``__init__.pxd`` +* `#16267 <https://github.com/numpy/numpy/pull/16267>`__: DOC: Clarifications for np.std +* `#16273 <https://github.com/numpy/numpy/pull/16273>`__: BUG: Order percentile monotonically +* `#16274 <https://github.com/numpy/numpy/pull/16274>`__: MAINT: cleanups to quantile +* `#16275 <https://github.com/numpy/numpy/pull/16275>`__: REL: Update master after 1.19.x branch. +* `#16276 <https://github.com/numpy/numpy/pull/16276>`__: BUG: Ensure out argument is returned by identity for 0d arrays +* `#16278 <https://github.com/numpy/numpy/pull/16278>`__: DOC: Clarifications for ``np.var``. +* `#16283 <https://github.com/numpy/numpy/pull/16283>`__: DOC: Add a note about performance of isclose compared to math.isclose +* `#16284 <https://github.com/numpy/numpy/pull/16284>`__: MAINT: Clean up the implementation of quantile +* `#16285 <https://github.com/numpy/numpy/pull/16285>`__: MAINT: Bump hypothesis from 5.12.0 to 5.14.0 +* `#16291 <https://github.com/numpy/numpy/pull/16291>`__: DOC: Improve "tobytes" docstring. +* `#16292 <https://github.com/numpy/numpy/pull/16292>`__: BUG: Fix tools/download-wheels.py. +* `#16295 <https://github.com/numpy/numpy/pull/16295>`__: BUG: Require Python >= 3.6 in setup.py +* `#16296 <https://github.com/numpy/numpy/pull/16296>`__: DOC: Fix malformed docstrings in ma. +* `#16297 <https://github.com/numpy/numpy/pull/16297>`__: ENH: Optimize Cpu feature detect in X86, fix for GCC on macOS +* `#16298 <https://github.com/numpy/numpy/pull/16298>`__: BUG: np.info does not show keyword-only arguments +* `#16300 <https://github.com/numpy/numpy/pull/16300>`__: DOC: Fix bad reference in ``numpy.ma`` +* `#16304 <https://github.com/numpy/numpy/pull/16304>`__: TST, MAINT: Fix detecting and testing armhf features +* `#16305 <https://github.com/numpy/numpy/pull/16305>`__: DOC: Fix packbits documentation rendering, +* `#16306 <https://github.com/numpy/numpy/pull/16306>`__: DOC: Fix troubleshooting code snippet when env vars are empty +* `#16308 <https://github.com/numpy/numpy/pull/16308>`__: BUG: relpath fails for different drives on windows +* `#16311 <https://github.com/numpy/numpy/pull/16311>`__: DOC: Fix ``np.ma.core.doc_note`` +* `#16316 <https://github.com/numpy/numpy/pull/16316>`__: MAINT: Bump numpydoc version +* `#16318 <https://github.com/numpy/numpy/pull/16318>`__: MAINT: Stop Using PyEval_Call* and simplify some uses +* `#16321 <https://github.com/numpy/numpy/pull/16321>`__: ENH: Improve the ARM cpu feature detection by parsing /proc/cpuinfo +* `#16323 <https://github.com/numpy/numpy/pull/16323>`__: DOC: Reconstruct Testing Guideline. +* `#16329 <https://github.com/numpy/numpy/pull/16329>`__: MAINT: Cleanup 'tools/download-wheels.py' +* `#16332 <https://github.com/numpy/numpy/pull/16332>`__: DOC: link np.interp to SciPy's interpolation functions (closes... +* `#16333 <https://github.com/numpy/numpy/pull/16333>`__: DOC: Fix spelling typo - homogenous to homogeneous. (#16324) +* `#16334 <https://github.com/numpy/numpy/pull/16334>`__: ENH: Use AVX-512 for np.isnan, np.infinite, np.isinf and np.signbit +* `#16336 <https://github.com/numpy/numpy/pull/16336>`__: BUG: Fix refcounting in add_newdoc +* `#16337 <https://github.com/numpy/numpy/pull/16337>`__: CI: Create a link for the circleCI artifact +* `#16348 <https://github.com/numpy/numpy/pull/16348>`__: BUG: Fix dtype leak in ``PyArray_FromAny`` error path +* `#16349 <https://github.com/numpy/numpy/pull/16349>`__: BUG: Indentation for docstrings +* `#16351 <https://github.com/numpy/numpy/pull/16351>`__: BUG: Fix small leaks in error path and ``empty_like`` with shape +* `#16362 <https://github.com/numpy/numpy/pull/16362>`__: MAINT: Streamline download-wheels. +* `#16365 <https://github.com/numpy/numpy/pull/16365>`__: DOC: Fix an obvious mistake in a message printed in doc/Makefile. +* `#16367 <https://github.com/numpy/numpy/pull/16367>`__: MAINT: Bump cython from 0.29.17 to 0.29.19 +* `#16368 <https://github.com/numpy/numpy/pull/16368>`__: MAINT: Bump hypothesis from 5.14.0 to 5.15.1 +* `#16369 <https://github.com/numpy/numpy/pull/16369>`__: MAINT: Bump pytest-cov from 2.8.1 to 2.9.0 +* `#16371 <https://github.com/numpy/numpy/pull/16371>`__: ENH: Use AVX-512 for np.frexp and np.ldexp +* `#16373 <https://github.com/numpy/numpy/pull/16373>`__: MAINT, DOC: add index for user docs. +* `#16375 <https://github.com/numpy/numpy/pull/16375>`__: ENH: ARM Neon implementation with intrinsic for np.argmax. +* `#16385 <https://github.com/numpy/numpy/pull/16385>`__: DOC: Tighten howto-docs guide #16259 +* `#16387 <https://github.com/numpy/numpy/pull/16387>`__: MAINT: Make ctypes optional on Windows +* `#16389 <https://github.com/numpy/numpy/pull/16389>`__: ENH: Hardcode buffer handling for simple scalars +* `#16392 <https://github.com/numpy/numpy/pull/16392>`__: MAINT: Stop uploading wheels to Rackspace. +* `#16393 <https://github.com/numpy/numpy/pull/16393>`__: MAINT: Use a raw string for the fromstring docstring. +* `#16395 <https://github.com/numpy/numpy/pull/16395>`__: ENH: Validate and disable CPU features in runtime +* `#16397 <https://github.com/numpy/numpy/pull/16397>`__: ENH: Implement the NumPy C SIMD vectorization interface +* `#16404 <https://github.com/numpy/numpy/pull/16404>`__: DOC,BLD: Update make dist html target. +* `#16408 <https://github.com/numpy/numpy/pull/16408>`__: DOC,BLD: Update sphinx conf to use xelatex. +* `#16409 <https://github.com/numpy/numpy/pull/16409>`__: TST, CI: turn on codecov patch diffs +* `#16411 <https://github.com/numpy/numpy/pull/16411>`__: BUG: endpoints of array returned by geomspace() should match... +* `#16417 <https://github.com/numpy/numpy/pull/16417>`__: MAINT: support python 3.10 +* `#16418 <https://github.com/numpy/numpy/pull/16418>`__: MAINT: Chain some exceptions. +* `#16420 <https://github.com/numpy/numpy/pull/16420>`__: DOC: Improve intersect1d docstring +* `#16422 <https://github.com/numpy/numpy/pull/16422>`__: DOC: Update assert_warns parameter list +* `#16423 <https://github.com/numpy/numpy/pull/16423>`__: TST: Simplify assert_warns in test_io.py +* `#16427 <https://github.com/numpy/numpy/pull/16427>`__: DOC: make NEP 18 status Final +* `#16428 <https://github.com/numpy/numpy/pull/16428>`__: DOC: Add style guide to howto_document +* `#16430 <https://github.com/numpy/numpy/pull/16430>`__: DOC: NEP for C style guide +* `#16433 <https://github.com/numpy/numpy/pull/16433>`__: DOC: Fix description of dtype default in linspace +* `#16435 <https://github.com/numpy/numpy/pull/16435>`__: BUG: Add extern to PyArrayDTypeMeta_Type declaration +* `#16436 <https://github.com/numpy/numpy/pull/16436>`__: DOC: Add a reference into NEP 29, +* `#16438 <https://github.com/numpy/numpy/pull/16438>`__: MAINT: Catch remaining cases of Py_SIZE and Py_TYPE as lvalues +* `#16442 <https://github.com/numpy/numpy/pull/16442>`__: ENH: Fix deprecated warn for Intel/Apple/Clang Compiler +* `#16444 <https://github.com/numpy/numpy/pull/16444>`__: DOC: make clearer that sinc is normalized by a factor pi +* `#16445 <https://github.com/numpy/numpy/pull/16445>`__: DOC: update roadmap +* `#16446 <https://github.com/numpy/numpy/pull/16446>`__: BUG: fixes einsum output order with optimization (#14615) +* `#16447 <https://github.com/numpy/numpy/pull/16447>`__: DOC: add a "make show" command to doc/Makefile +* `#16450 <https://github.com/numpy/numpy/pull/16450>`__: DOC: Add a NEP link to all neps. +* `#16452 <https://github.com/numpy/numpy/pull/16452>`__: DOC,ENH: extend error message when Accelerate is detected +* `#16463 <https://github.com/numpy/numpy/pull/16463>`__: DOC: Improve assert_warns docstring with example +* `#16464 <https://github.com/numpy/numpy/pull/16464>`__: MAINT: Bump hypothesis from 5.15.1 to 5.16.0 +* `#16465 <https://github.com/numpy/numpy/pull/16465>`__: DOC: Fix development_workflow links +* `#16468 <https://github.com/numpy/numpy/pull/16468>`__: BUG: fix GCC 10 major version comparison +* `#16471 <https://github.com/numpy/numpy/pull/16471>`__: BLD: install mingw32 v7.3.0 for win32 +* `#16472 <https://github.com/numpy/numpy/pull/16472>`__: DOC: Fixes for 18 broken links +* `#16474 <https://github.com/numpy/numpy/pull/16474>`__: MAINT: use zip instead of range in piecewise +* `#16476 <https://github.com/numpy/numpy/pull/16476>`__: ENH: add ``norm=forward,backward`` to numpy.fft functions +* `#16482 <https://github.com/numpy/numpy/pull/16482>`__: SIMD: Optimize the performace of np.packbits in ARM-based machine. +* `#16485 <https://github.com/numpy/numpy/pull/16485>`__: BUG: Fix result when a gufunc output broadcasts the inputs. +* `#16500 <https://github.com/numpy/numpy/pull/16500>`__: DOC: Point Contributing page to new NEP 45 +* `#16501 <https://github.com/numpy/numpy/pull/16501>`__: MAINT: make Py_SET_SIZE and Py_SET_TYPE macros a bit safer +* `#16503 <https://github.com/numpy/numpy/pull/16503>`__: BUG:random: Error when ``size`` is smaller than broadcast input... +* `#16504 <https://github.com/numpy/numpy/pull/16504>`__: DOC: Correct MV Normal sig +* `#16505 <https://github.com/numpy/numpy/pull/16505>`__: BUG: raise IEEE exception on AIX +* `#16506 <https://github.com/numpy/numpy/pull/16506>`__: DOC: only single-polynomial fitting in np.polynomial.Polynomial.fit() +* `#16510 <https://github.com/numpy/numpy/pull/16510>`__: DOC: Minor rounding correction in Generator.binomial +* `#16514 <https://github.com/numpy/numpy/pull/16514>`__: STY: trivial doc style fix in NEP 45. +* `#16515 <https://github.com/numpy/numpy/pull/16515>`__: ENH: add type stubs from numpy-stubs +* `#16519 <https://github.com/numpy/numpy/pull/16519>`__: BUG: f2py: make callbacks threadsafe +* `#16520 <https://github.com/numpy/numpy/pull/16520>`__: STY: f2py: replace \t by whitespace for readability +* `#16522 <https://github.com/numpy/numpy/pull/16522>`__: MAINT:ARMHF Fix detecting feature groups NEON_HALF and NEON_VFPV4 +* `#16523 <https://github.com/numpy/numpy/pull/16523>`__: MAINT: Improve buffer speed +* `#16524 <https://github.com/numpy/numpy/pull/16524>`__: MAINT: f2py: move thread-local declaration definition to common... +* `#16529 <https://github.com/numpy/numpy/pull/16529>`__: BUG: Fix cython warning in random/_common.pyx. +* `#16530 <https://github.com/numpy/numpy/pull/16530>`__: MAINT: Bump pytest from 5.4.2 to 5.4.3 +* `#16532 <https://github.com/numpy/numpy/pull/16532>`__: BUG: Remove non-threadsafe sigint handling from fft calculation +* `#16540 <https://github.com/numpy/numpy/pull/16540>`__: SIMD: SSE2 intrinsic implementation for float64 input of np.enisum +* `#16551 <https://github.com/numpy/numpy/pull/16551>`__: BUG: Ensure SeedSequence 0-padding does not collide with spawn... +* `#16554 <https://github.com/numpy/numpy/pull/16554>`__: DEP: Remove deprecated numeric types and deprecate remaining +* `#16555 <https://github.com/numpy/numpy/pull/16555>`__: CI: drop win32 3.7, 3.6 builds +* `#16556 <https://github.com/numpy/numpy/pull/16556>`__: MAINT: simplifying annotations for np.core.from_numeric +* `#16558 <https://github.com/numpy/numpy/pull/16558>`__: ENH: make typing module available at runtime +* `#16570 <https://github.com/numpy/numpy/pull/16570>`__: ENH: Throw TypeError on operator concat on Numpy Arrays +* `#16571 <https://github.com/numpy/numpy/pull/16571>`__: TST: Add new tests for array coercion +* `#16572 <https://github.com/numpy/numpy/pull/16572>`__: BUG: fix sin/cos bug when input is strided array +* `#16574 <https://github.com/numpy/numpy/pull/16574>`__: MAINT: fix name of first parameter to dtype constructor in type... +* `#16581 <https://github.com/numpy/numpy/pull/16581>`__: DOC: Added an example for np.transpose(4d_array) +* `#16583 <https://github.com/numpy/numpy/pull/16583>`__: MAINT: changed ``np.generic`` arguments to positional-only +* `#16590 <https://github.com/numpy/numpy/pull/16590>`__: DOC: Clarify dtype default for logspace and geomspace +* `#16591 <https://github.com/numpy/numpy/pull/16591>`__: DOC: Disallow complex args in arange +* `#16592 <https://github.com/numpy/numpy/pull/16592>`__: BUG: Raise TypeError for float->timedelta promotion +* `#16594 <https://github.com/numpy/numpy/pull/16594>`__: ENH: Add ``__f2py_numpy_version__`` attribute to Fortran modules. +* `#16596 <https://github.com/numpy/numpy/pull/16596>`__: BUG: Fix reference count leak in mapping.c +* `#16601 <https://github.com/numpy/numpy/pull/16601>`__: MAINT: Move and improve ``test_ignore_nan_ulperror``. +* `#16603 <https://github.com/numpy/numpy/pull/16603>`__: DOC: make addition of types a "new feature" in release notes +* `#16605 <https://github.com/numpy/numpy/pull/16605>`__: MAINT: Avx512 intrinsics implementation for float64 input np.log +* `#16606 <https://github.com/numpy/numpy/pull/16606>`__: MAINT: Bump pytest-cov from 2.9.0 to 2.10.0 +* `#16607 <https://github.com/numpy/numpy/pull/16607>`__: MAINT: Bump hypothesis from 5.16.0 to 5.16.1 +* `#16613 <https://github.com/numpy/numpy/pull/16613>`__: MAINT: bump mypy version to 0.780 +* `#16617 <https://github.com/numpy/numpy/pull/16617>`__: BLD: Openblas 0.3.10 +* `#16618 <https://github.com/numpy/numpy/pull/16618>`__: ENH: add annotation for abs +* `#16619 <https://github.com/numpy/numpy/pull/16619>`__: BLD: check if std=c99 is really required +* `#16620 <https://github.com/numpy/numpy/pull/16620>`__: MAINT, CI: disable Shippable cache +* `#16621 <https://github.com/numpy/numpy/pull/16621>`__: BENCH: Expand array-creation benchmarks +* `#16622 <https://github.com/numpy/numpy/pull/16622>`__: MAINT: Implemented two dtype-related TODO's +* `#16623 <https://github.com/numpy/numpy/pull/16623>`__: BUG: Initialize stop-reading in array_from_text +* `#16627 <https://github.com/numpy/numpy/pull/16627>`__: DOC: Updated documentation for numpy.squeeze +* `#16629 <https://github.com/numpy/numpy/pull/16629>`__: ENH: add tool to find functions missing types +* `#16630 <https://github.com/numpy/numpy/pull/16630>`__: ENH,BUG:distutils Remove the origins from the implied features +* `#16633 <https://github.com/numpy/numpy/pull/16633>`__: MAINT: lib: Some code clean up in loadtxt +* `#16635 <https://github.com/numpy/numpy/pull/16635>`__: BENCH: remove obsolete goal_time param +* `#16639 <https://github.com/numpy/numpy/pull/16639>`__: BUG: Fix uint->timedelta promotion to raise TypeError +* `#16642 <https://github.com/numpy/numpy/pull/16642>`__: MAINT: Replace ``PyUString_GET_SIZE`` with ``PyUnicode_GetLength``. +* `#16643 <https://github.com/numpy/numpy/pull/16643>`__: REL: Fix outdated docs link +* `#16646 <https://github.com/numpy/numpy/pull/16646>`__: TST: add a static typing test for memoryviews as ArrayLikes +* `#16647 <https://github.com/numpy/numpy/pull/16647>`__: ENH: Added annotations to 8 functions from np.core.fromnumeric +* `#16648 <https://github.com/numpy/numpy/pull/16648>`__: REL: Update master after 1.19.0 release. +* `#16650 <https://github.com/numpy/numpy/pull/16650>`__: ENH: Allow genfromtxt to unpack structured arrays +* `#16651 <https://github.com/numpy/numpy/pull/16651>`__: MAINT: Prefer generator expressions over list comprehensions... +* `#16653 <https://github.com/numpy/numpy/pull/16653>`__: DOC: cross-reference numpy.dot and numpy.linalg.multi_dot +* `#16658 <https://github.com/numpy/numpy/pull/16658>`__: MAINT: Bump hypothesis from 5.16.1 to 5.16.3 +* `#16659 <https://github.com/numpy/numpy/pull/16659>`__: MAINT: Bump mypy from 0.780 to 0.781 +* `#16664 <https://github.com/numpy/numpy/pull/16664>`__: DOC: Add lib.format.open_memmap to autosummary. +* `#16666 <https://github.com/numpy/numpy/pull/16666>`__: BUG: Fix bug in AVX complex absolute while processing array of... +* `#16669 <https://github.com/numpy/numpy/pull/16669>`__: MAINT: remove blacklist/whitelist terms +* `#16674 <https://github.com/numpy/numpy/pull/16674>`__: TST: Add extra debugging information to CPU features detection +* `#16675 <https://github.com/numpy/numpy/pull/16675>`__: ENH: Add support for file like objects to np.core.records.fromfile +* `#16683 <https://github.com/numpy/numpy/pull/16683>`__: DOC: updated gcc minimum recommend version to build from source +* `#16684 <https://github.com/numpy/numpy/pull/16684>`__: MAINT: Allow ``None`` to be passed to certain ``generic`` subclasses +* `#16690 <https://github.com/numpy/numpy/pull/16690>`__: DOC: fixed docstring for descr_to_dtype +* `#16691 <https://github.com/numpy/numpy/pull/16691>`__: DOC: Remove "matrix" from ``triu`` docstring. +* `#16696 <https://github.com/numpy/numpy/pull/16696>`__: MAINT: add py.typed sentinel to package manifest +* `#16699 <https://github.com/numpy/numpy/pull/16699>`__: MAINT: Fixup quantile tests to not use ``np.float`` +* `#16702 <https://github.com/numpy/numpy/pull/16702>`__: BLD: Add CPU entry for Emscripten / WebAssembly +* `#16704 <https://github.com/numpy/numpy/pull/16704>`__: TST: Disable Python 3.9-dev testing. +* `#16706 <https://github.com/numpy/numpy/pull/16706>`__: DOC: Add instruction about stable symlink +* `#16708 <https://github.com/numpy/numpy/pull/16708>`__: MAINT: Disable use_hugepages in case of ValueError +* `#16709 <https://github.com/numpy/numpy/pull/16709>`__: DOC: Add dep directive to alen docstring. +* `#16710 <https://github.com/numpy/numpy/pull/16710>`__: ENH, BLD: Add RPATH support for AIX +* `#16718 <https://github.com/numpy/numpy/pull/16718>`__: DOC: fix typo +* `#16720 <https://github.com/numpy/numpy/pull/16720>`__: BUG: Fix PyArray_SearchSorted signature. +* `#16729 <https://github.com/numpy/numpy/pull/16729>`__: ENH: Add annotations to the last 8 functions in numpy.core.fromnumeric +* `#16730 <https://github.com/numpy/numpy/pull/16730>`__: ENH: Use f90 compiler specified in f2py command line args for... +* `#16731 <https://github.com/numpy/numpy/pull/16731>`__: DOC: reword random c-api introduction, cython is documented in... +* `#16735 <https://github.com/numpy/numpy/pull/16735>`__: DOC: Tweak a sentence about broadcasting. +* `#16736 <https://github.com/numpy/numpy/pull/16736>`__: DOC: Prepend ``ma.`` to references in ``numpy.ma`` +* `#16738 <https://github.com/numpy/numpy/pull/16738>`__: DOC: Remove redundant word +* `#16742 <https://github.com/numpy/numpy/pull/16742>`__: DOC: add unique() to See Also of repeat() +* `#16743 <https://github.com/numpy/numpy/pull/16743>`__: DOC: add example to unique() and make connection to repeat() +* `#16747 <https://github.com/numpy/numpy/pull/16747>`__: MAINT: Chaining exceptions in numpy/core/_internal.py +* `#16752 <https://github.com/numpy/numpy/pull/16752>`__: BLD: add manylinux1 OpenBlAS 0.3.10 hashes and test for them +* `#16757 <https://github.com/numpy/numpy/pull/16757>`__: DOC: Add Matti Picus to steering council page +* `#16759 <https://github.com/numpy/numpy/pull/16759>`__: ENH: make dtype generic over scalar type +* `#16760 <https://github.com/numpy/numpy/pull/16760>`__: DOC: Added a section in the 'Iterating over arrays' doc page... +* `#16761 <https://github.com/numpy/numpy/pull/16761>`__: MAINT: Tidy exception chaining in _datasource.py +* `#16762 <https://github.com/numpy/numpy/pull/16762>`__: MAINT: Fixes for deprecated functions in scalartypes.c.src +* `#16764 <https://github.com/numpy/numpy/pull/16764>`__: MAINT: Bump mypy from 0.781 to 0.782 +* `#16765 <https://github.com/numpy/numpy/pull/16765>`__: MAINT: Bump hypothesis from 5.16.3 to 5.19.0 +* `#16767 <https://github.com/numpy/numpy/pull/16767>`__: ENH: Update NumPy logos +* `#16770 <https://github.com/numpy/numpy/pull/16770>`__: MAINT: Remove unneeded call to PyUnicode_READY +* `#16771 <https://github.com/numpy/numpy/pull/16771>`__: MAINT: Fix deprecated functions in scalarapi.c +* `#16775 <https://github.com/numpy/numpy/pull/16775>`__: DOC: switch to logo with text +* `#16782 <https://github.com/numpy/numpy/pull/16782>`__: ENH, TST: Bring the NumPy C SIMD vectorization interface "NPYV"... +* `#16786 <https://github.com/numpy/numpy/pull/16786>`__: BENCH: Add basic benchmarks for scalar indexing and assignment +* `#16789 <https://github.com/numpy/numpy/pull/16789>`__: BUG: fix decode error when building and get rid of warn +* `#16792 <https://github.com/numpy/numpy/pull/16792>`__: DOC: Minor RST formatting. +* `#16793 <https://github.com/numpy/numpy/pull/16793>`__: BLD, MAINT: update cython to 0.29.21 +* `#16794 <https://github.com/numpy/numpy/pull/16794>`__: TST: Upgrade to Python 3.8 for DEBUG testing. +* `#16798 <https://github.com/numpy/numpy/pull/16798>`__: DOC: Fix RST/numpydoc standard. +* `#16800 <https://github.com/numpy/numpy/pull/16800>`__: MAINT: Move typing tests +* `#16802 <https://github.com/numpy/numpy/pull/16802>`__: MAINT: Explicitly disallow object user dtypes +* `#16805 <https://github.com/numpy/numpy/pull/16805>`__: DOC: add example to corrcoef function +* `#16806 <https://github.com/numpy/numpy/pull/16806>`__: DOC: adding docs on passing dimensions as tuple to ndindex +* `#16807 <https://github.com/numpy/numpy/pull/16807>`__: BUG, MAINT: Remove overzealous automatic RST link +* `#16811 <https://github.com/numpy/numpy/pull/16811>`__: DOC: Add explanation of 'K' and 'A' layout options to 'asarray*'... +* `#16814 <https://github.com/numpy/numpy/pull/16814>`__: DOC: Add a reST label to /user/building.rst +* `#16815 <https://github.com/numpy/numpy/pull/16815>`__: BUG: fix mgrid output for lower precision float inputs +* `#16816 <https://github.com/numpy/numpy/pull/16816>`__: BLD: temporarily disable OpenBLAS hash checks +* `#16817 <https://github.com/numpy/numpy/pull/16817>`__: BUG: Do not inherit flags from the structured part of a union... +* `#16819 <https://github.com/numpy/numpy/pull/16819>`__: DOC: replace dec.slow with pytest.mark.slow +* `#16820 <https://github.com/numpy/numpy/pull/16820>`__: MAINT: Make void scalar to array creation copy when dtype is... +* `#16821 <https://github.com/numpy/numpy/pull/16821>`__: DOC: fix inconsistent parameter name in np.ndindex docstring +* `#16822 <https://github.com/numpy/numpy/pull/16822>`__: MAINT: setuptools 49.2.0 emits a warning, avoid it +* `#16824 <https://github.com/numpy/numpy/pull/16824>`__: DOC: add examples to random number generator pages +* `#16826 <https://github.com/numpy/numpy/pull/16826>`__: DOC: describe ufunc copy behavior when input and output overlap +* `#16827 <https://github.com/numpy/numpy/pull/16827>`__: MAINT: Fix ``runtest.py`` warning. +* `#16829 <https://github.com/numpy/numpy/pull/16829>`__: DOC,BLD: Add pandas to doc_requirements.txt +* `#16831 <https://github.com/numpy/numpy/pull/16831>`__: MAINT: fix sphinx deprecation +* `#16834 <https://github.com/numpy/numpy/pull/16834>`__: Avoid using uninitialized bytes in getlimits.py. +* `#16835 <https://github.com/numpy/numpy/pull/16835>`__: DOC: Explaining why datetime64 doesn't work for allclose + isclose +* `#16836 <https://github.com/numpy/numpy/pull/16836>`__: DOC: improve SIMD features tables +* `#16837 <https://github.com/numpy/numpy/pull/16837>`__: BLD: update openblas hashes, re-enable check +* `#16838 <https://github.com/numpy/numpy/pull/16838>`__: MAINT: Remove code that will never run +* `#16840 <https://github.com/numpy/numpy/pull/16840>`__: MAINT: Bump hypothesis from 5.19.0 to 5.19.1 +* `#16841 <https://github.com/numpy/numpy/pull/16841>`__: BUG: linspace should round towards -infinity +* `#16845 <https://github.com/numpy/numpy/pull/16845>`__: TST: Disable shippable until we can fix it. +* `#16847 <https://github.com/numpy/numpy/pull/16847>`__: MAINT: Remove Duplicated Code (function extract rmap) +* `#16848 <https://github.com/numpy/numpy/pull/16848>`__: MAINT: Remove Duplicated Code +* `#16849 <https://github.com/numpy/numpy/pull/16849>`__: MAINT: Change for loop (range -> for each) +* `#16850 <https://github.com/numpy/numpy/pull/16850>`__: DEP: Deprecate NumPy object scalars +* `#16854 <https://github.com/numpy/numpy/pull/16854>`__: DOC: clarify whats required for new features see #13924 +* `#16857 <https://github.com/numpy/numpy/pull/16857>`__: MAINT: fix new compiler warnings on clang +* `#16858 <https://github.com/numpy/numpy/pull/16858>`__: BUG: fix the search dir of dispatch-able sources +* `#16860 <https://github.com/numpy/numpy/pull/16860>`__: MAINT: Remove deprecated python function 'file()' +* `#16868 <https://github.com/numpy/numpy/pull/16868>`__: BUG: Validate output size in bin- and multinomial +* `#16870 <https://github.com/numpy/numpy/pull/16870>`__: BLD, MAINT: Pin setuptools +* `#16871 <https://github.com/numpy/numpy/pull/16871>`__: BUG: Update compiler check for AVX-512F +* `#16874 <https://github.com/numpy/numpy/pull/16874>`__: TST, MAINT: fix the test for ``np.ones`` +* `#16878 <https://github.com/numpy/numpy/pull/16878>`__: DOC: edit to the documentation of lib/polynomial.py/polyfit +* `#16879 <https://github.com/numpy/numpy/pull/16879>`__: MAINT: Configure hypothesis in ``np.test()`` for determinism,... +* `#16882 <https://github.com/numpy/numpy/pull/16882>`__: BLD: Remove unused pip install +* `#16883 <https://github.com/numpy/numpy/pull/16883>`__: BUG,DOC: Fix bad MPL kwarg in docs +* `#16886 <https://github.com/numpy/numpy/pull/16886>`__: DOC: Fix types including curly braces +* `#16887 <https://github.com/numpy/numpy/pull/16887>`__: DOC: Remove the links for ``True`` and ``False`` +* `#16888 <https://github.com/numpy/numpy/pull/16888>`__: ENH: Integrate the new CPU dispatcher with umath generator +* `#16894 <https://github.com/numpy/numpy/pull/16894>`__: DOC: Fix wrong markups in ``arrays.dtypes`` +* `#16896 <https://github.com/numpy/numpy/pull/16896>`__: DOC: Remove links for C codes +* `#16897 <https://github.com/numpy/numpy/pull/16897>`__: DOC: Fix the declarations of C fuctions +* `#16899 <https://github.com/numpy/numpy/pull/16899>`__: MNT: also use Py_SET_REFCNT instead of Py_REFCNT +* `#16900 <https://github.com/numpy/numpy/pull/16900>`__: MAINT: Chaining exceptions in numpy/__init__.py +* `#16907 <https://github.com/numpy/numpy/pull/16907>`__: DOC: update val to be scalar or array like optional closes #16901 +* `#16910 <https://github.com/numpy/numpy/pull/16910>`__: MAINT: Bump hypothesis from 5.19.1 to 5.20.2 +* `#16911 <https://github.com/numpy/numpy/pull/16911>`__: ENH: Speed up trim_zeros +* `#16914 <https://github.com/numpy/numpy/pull/16914>`__: BUG: Fix string/bytes to complex assignment +* `#16917 <https://github.com/numpy/numpy/pull/16917>`__: DOC: Add correctness vs strictness consideration for np.dtype +* `#16919 <https://github.com/numpy/numpy/pull/16919>`__: DOC: Add ufunc docstring to generated docs. +* `#16925 <https://github.com/numpy/numpy/pull/16925>`__: REL: Update master after 1.19.1 release. +* `#16931 <https://github.com/numpy/numpy/pull/16931>`__: Revert "Merge pull request #16248 from alexrockhill/edge" +* `#16936 <https://github.com/numpy/numpy/pull/16936>`__: BUG: Fix memory leak of buffer-info cache due to relaxed strides +* `#16938 <https://github.com/numpy/numpy/pull/16938>`__: ENH,API: Store exported buffer info on the array +* `#16940 <https://github.com/numpy/numpy/pull/16940>`__: BLD: update OpenBLAS build +* `#16941 <https://github.com/numpy/numpy/pull/16941>`__: BUG: Allow array-like types to be coerced as object array elements +* `#16943 <https://github.com/numpy/numpy/pull/16943>`__: DEP: Deprecate size-one ragged array coercion +* `#16944 <https://github.com/numpy/numpy/pull/16944>`__: Change the name of the folder "icons" to "logo". +* `#16949 <https://github.com/numpy/numpy/pull/16949>`__: ENH: enable colors for ``runtests.py --ipython`` +* `#16950 <https://github.com/numpy/numpy/pull/16950>`__: DOC: Clarify input to irfft/irfft2/irfftn +* `#16952 <https://github.com/numpy/numpy/pull/16952>`__: MAINT: Bump hypothesis from 5.20.2 to 5.23.2 +* `#16953 <https://github.com/numpy/numpy/pull/16953>`__: update numpy/lib/arraypad.py with appropriate chain exception +* `#16957 <https://github.com/numpy/numpy/pull/16957>`__: MAINT: Use arm64 instead of aarch64 on travisCI. +* `#16962 <https://github.com/numpy/numpy/pull/16962>`__: MAINT: Chain exception in ``distutils/fcompiler/environment.py``. +* `#16966 <https://github.com/numpy/numpy/pull/16966>`__: MAINT: Added the ``order`` parameter to ``np.array()`` +* `#16969 <https://github.com/numpy/numpy/pull/16969>`__: ENH: Add Neon SIMD implementations for add, sub, mul, and div +* `#16973 <https://github.com/numpy/numpy/pull/16973>`__: DOC: Fixed typo in lib/recfunctions.py +* `#16974 <https://github.com/numpy/numpy/pull/16974>`__: TST: Add pypy win32 CI testing. +* `#16982 <https://github.com/numpy/numpy/pull/16982>`__: ENH: Increase the use of ``Literal`` types +* `#16986 <https://github.com/numpy/numpy/pull/16986>`__: ENH: Add NumPy declarations to be used by Cython 3.0+ +* `#16988 <https://github.com/numpy/numpy/pull/16988>`__: DOC: Add the new NumPy logo to Sphinx pages +* `#16991 <https://github.com/numpy/numpy/pull/16991>`__: MAINT: Bump hypothesis from 5.23.2 to 5.23.9 +* `#16992 <https://github.com/numpy/numpy/pull/16992>`__: MAINT: Bump pytest from 5.4.3 to 6.0.1 +* `#16993 <https://github.com/numpy/numpy/pull/16993>`__: BLD: pin setuptools < 49.2.0 +* `#16996 <https://github.com/numpy/numpy/pull/16996>`__: DOC: Revise glossary page +* `#17002 <https://github.com/numpy/numpy/pull/17002>`__: DOC: clip() allows arguments. +* `#17009 <https://github.com/numpy/numpy/pull/17009>`__: NEP: Updated NEP-35 with keyword-only instruction +* `#17013 <https://github.com/numpy/numpy/pull/17013>`__: MAINT: Simplify scalar power +* `#17014 <https://github.com/numpy/numpy/pull/17014>`__: MAINT: Improve error handling in umathmodule setup +* `#17028 <https://github.com/numpy/numpy/pull/17028>`__: DOC: Disclaimer for FFT library +* `#17029 <https://github.com/numpy/numpy/pull/17029>`__: MAINT: Add error return to all casting functionality and NpyIter +* `#17033 <https://github.com/numpy/numpy/pull/17033>`__: BUG: fix a compile and a test warning +* `#17036 <https://github.com/numpy/numpy/pull/17036>`__: DOC: Clarify that ``np.char`` comparison functions always return... +* `#17039 <https://github.com/numpy/numpy/pull/17039>`__: DOC: Use a less ambiguous example for array_split +* `#17041 <https://github.com/numpy/numpy/pull/17041>`__: MAINT: Bump hypothesis from 5.23.9 to 5.23.12 +* `#17048 <https://github.com/numpy/numpy/pull/17048>`__: STY: core._internal style fixups +* `#17050 <https://github.com/numpy/numpy/pull/17050>`__: MAINT: Remove _EXTRAFLAGS variable +* `#17053 <https://github.com/numpy/numpy/pull/17053>`__: BUG: fix typo in polydiv that prevented promotion to poly1d +* `#17058 <https://github.com/numpy/numpy/pull/17058>`__: MAINT: Revert boolean casting back to elementwise comparisons... +* `#17062 <https://github.com/numpy/numpy/pull/17062>`__: API, BUG: Raise error on complex input to i0 +* `#17063 <https://github.com/numpy/numpy/pull/17063>`__: MAINT: Remove obsolete conversion to set +* `#17067 <https://github.com/numpy/numpy/pull/17067>`__: DEP: lib: Remove the deprecated financial functions. +* `#17068 <https://github.com/numpy/numpy/pull/17068>`__: MAINT, BUG: Remove uses of PyString_FromString. +* `#17074 <https://github.com/numpy/numpy/pull/17074>`__: DOC: use the pydata_sphinx_theme +* `#17078 <https://github.com/numpy/numpy/pull/17078>`__: DOC: Fixes duplication of toctree content (Closes #17077) +* `#17091 <https://github.com/numpy/numpy/pull/17091>`__: MAINT: Bump pytest-cov from 2.10.0 to 2.10.1 +* `#17092 <https://github.com/numpy/numpy/pull/17092>`__: MAINT: Bump hypothesis from 5.23.12 to 5.26.0 +* `#17093 <https://github.com/numpy/numpy/pull/17093>`__: NEP: Adjust NEP-35 to make it more user-accessible +* `#17104 <https://github.com/numpy/numpy/pull/17104>`__: ENH: Add placeholder stubs for all sub-modules +* `#17109 <https://github.com/numpy/numpy/pull/17109>`__: MAINT: Split einsum into multiple files +* `#17112 <https://github.com/numpy/numpy/pull/17112>`__: BUG: Handle errors from the PyCapsule API +* `#17115 <https://github.com/numpy/numpy/pull/17115>`__: DOC: Fix spacing in vectorize doc +* `#17116 <https://github.com/numpy/numpy/pull/17116>`__: API: Remove ``np.ctypeslib.ctypes_load_library`` +* `#17119 <https://github.com/numpy/numpy/pull/17119>`__: DOC: make spacing consistent in NEP 41 bullet points +* `#17121 <https://github.com/numpy/numpy/pull/17121>`__: BUG: core: fix ilp64 blas dot/vdot/... for strides > int32 max +* `#17123 <https://github.com/numpy/numpy/pull/17123>`__: ENH: allow running mypy through runtests.py +* `#17127 <https://github.com/numpy/numpy/pull/17127>`__: MAINT: Remove duplicated symbols from link step +* `#17129 <https://github.com/numpy/numpy/pull/17129>`__: BLD: Check for reduce intrinsics and AVX512BW mask operations +* `#17132 <https://github.com/numpy/numpy/pull/17132>`__: MAINT: Chain some exceptions in arraysetops. +* `#17133 <https://github.com/numpy/numpy/pull/17133>`__: MAINT: Chain ValueError in ma.timer_comparison +* `#17137 <https://github.com/numpy/numpy/pull/17137>`__: API,MAINT: Rewrite promotion using common DType and common instance +* `#17141 <https://github.com/numpy/numpy/pull/17141>`__: MAINT: Make arrayprint str and repr the ndarray defaults. +* `#17142 <https://github.com/numpy/numpy/pull/17142>`__: DOC: NEP-42: Fix a few typos. +* `#17143 <https://github.com/numpy/numpy/pull/17143>`__: MAINT: Change handling of the expired financial functions. +* `#17144 <https://github.com/numpy/numpy/pull/17144>`__: ENH: Add annotations to 3 functions in ``np.core.function_base`` +* `#17145 <https://github.com/numpy/numpy/pull/17145>`__: MAINT, BUG: Replace uses of PyString_AsString. +* `#17146 <https://github.com/numpy/numpy/pull/17146>`__: MAINT: ``Replace PyUString_*`` by ``PyUnicode_*`` equivalents. +* `#17149 <https://github.com/numpy/numpy/pull/17149>`__: MAINT: Replace PyInt macros with their PyLong replacement +* `#17150 <https://github.com/numpy/numpy/pull/17150>`__: ENH: Add support for the abstract scalars to cython code +* `#17151 <https://github.com/numpy/numpy/pull/17151>`__: BUG: Fix incorrect cython definition of npy_cfloat +* `#17152 <https://github.com/numpy/numpy/pull/17152>`__: MAINT: Clean up some ``Npy_`` vs ``Py_`` macro usage +* `#17154 <https://github.com/numpy/numpy/pull/17154>`__: DOC: Remove references to PyCObject +* `#17159 <https://github.com/numpy/numpy/pull/17159>`__: DOC: Update numpy4matlab +* `#17160 <https://github.com/numpy/numpy/pull/17160>`__: Clean up some more bytes vs unicode handling +* `#17161 <https://github.com/numpy/numpy/pull/17161>`__: BUG: Remove Void special case for "safe casting" +* `#17163 <https://github.com/numpy/numpy/pull/17163>`__: MAINT: Remove redundant headers +* `#17164 <https://github.com/numpy/numpy/pull/17164>`__: MAINT: Remove ``NPY_COPY_PYOBJECT_PTR`` +* `#17167 <https://github.com/numpy/numpy/pull/17167>`__: BLD: Merge the npysort library into multiarray +* `#17168 <https://github.com/numpy/numpy/pull/17168>`__: TST: Add tests mapping out the rules for metadata in promotion +* `#17171 <https://github.com/numpy/numpy/pull/17171>`__: BUG: revert trim_zeros changes from gh-16911 +* `#17172 <https://github.com/numpy/numpy/pull/17172>`__: ENH: Make ``np.complexfloating`` generic w.r.t. ``np.floating`` +* `#17176 <https://github.com/numpy/numpy/pull/17176>`__: MAINT/ENH: datetime: remove calls to PyUnicode_AsASCIIString,... +* `#17180 <https://github.com/numpy/numpy/pull/17180>`__: ENH: Added missing methods to ``np.flatiter`` +* `#17181 <https://github.com/numpy/numpy/pull/17181>`__: DOC: Correct error in description of ndarray.base +* `#17182 <https://github.com/numpy/numpy/pull/17182>`__: DOC: Document ``dtype.metadata`` +* `#17186 <https://github.com/numpy/numpy/pull/17186>`__: MAINT: Use utf8 strings in more of datetime +* `#17188 <https://github.com/numpy/numpy/pull/17188>`__: MAINT: Add placeholder stubs for ``ndarray`` and ``generic`` +* `#17191 <https://github.com/numpy/numpy/pull/17191>`__: MAINT: Bump hypothesis from 5.26.0 to 5.30.0 +* `#17193 <https://github.com/numpy/numpy/pull/17193>`__: MAINT: Remove some callers of functions in numpy.compat +* `#17195 <https://github.com/numpy/numpy/pull/17195>`__: ENH: Make the window functions exactly symmetric +* `#17197 <https://github.com/numpy/numpy/pull/17197>`__: MAINT: Improve error handling in npy_cpu_init +* `#17199 <https://github.com/numpy/numpy/pull/17199>`__: DOC: Fix the documented signatures of four ``ufunc`` methods +* `#17201 <https://github.com/numpy/numpy/pull/17201>`__: MAINT: Make the ``NPY_CPU_DISPATCH_CALL`` macros expressions not... +* `#17204 <https://github.com/numpy/numpy/pull/17204>`__: DOC: Fixed headings for tutorials so they appear at new theme... +* `#17210 <https://github.com/numpy/numpy/pull/17210>`__: DOC: Canonical_urls +* `#17214 <https://github.com/numpy/numpy/pull/17214>`__: MAINT: Fix various issues with the ``np.generic`` annotations +* `#17219 <https://github.com/numpy/numpy/pull/17219>`__: BLD: enabled negation of library choices in ``NPY_*_ORDER`` +* `#17220 <https://github.com/numpy/numpy/pull/17220>`__: BUG, DOC: comment out metadata added via javascript +* `#17222 <https://github.com/numpy/numpy/pull/17222>`__: MAINT, DOC: move informational files from numpy.doc.*.py to their... +* `#17223 <https://github.com/numpy/numpy/pull/17223>`__: MAINT: use sysconfig not distutils.sysconfig where possible +* `#17225 <https://github.com/numpy/numpy/pull/17225>`__: BUG: Fix dimension discovery of within array ragged cases +* `#17227 <https://github.com/numpy/numpy/pull/17227>`__: DOC: Added templates for different types of issues. +* `#17233 <https://github.com/numpy/numpy/pull/17233>`__: DEP: Deprecated ndindex.ndincr +* `#17235 <https://github.com/numpy/numpy/pull/17235>`__: MAINT: Remove old PY_VERSION_HEX and sys.version_info code +* `#17237 <https://github.com/numpy/numpy/pull/17237>`__: BUG: Avoid using ``np.random`` in typing tests. +* `#17239 <https://github.com/numpy/numpy/pull/17239>`__: DOC: Fix link quick-start in old random API functions +* `#17241 <https://github.com/numpy/numpy/pull/17241>`__: MAINT: ``__array_interface__`` data address cannot be bytes +* `#17242 <https://github.com/numpy/numpy/pull/17242>`__: MAINT: Run slow CI jobs earlier so builds finishes sooner +* `#17247 <https://github.com/numpy/numpy/pull/17247>`__: ENH: Add tool to help speed up Travis CI +* `#17250 <https://github.com/numpy/numpy/pull/17250>`__: DOC: Fix docstring cross-referencing +* `#17252 <https://github.com/numpy/numpy/pull/17252>`__: DOC: Added a PR "Reviewer guidelines" document. +* `#17257 <https://github.com/numpy/numpy/pull/17257>`__: DOC: work around a bug in the new theme +* `#17258 <https://github.com/numpy/numpy/pull/17258>`__: SIMD: add fused multiply subtract/add intrinics for all supported... +* `#17259 <https://github.com/numpy/numpy/pull/17259>`__: MAINT: Bump hypothesis from 5.30.0 to 5.33.0 +* `#17260 <https://github.com/numpy/numpy/pull/17260>`__: MAINT: Bump pydata-sphinx-theme from 0.3.2 to 0.4.0 +* `#17263 <https://github.com/numpy/numpy/pull/17263>`__: DOC: add new glossary terms +* `#17264 <https://github.com/numpy/numpy/pull/17264>`__: DOC: remove some glosssary terms +* `#17267 <https://github.com/numpy/numpy/pull/17267>`__: TST: Fix the path to ``mypy.ini`` in ``runtests.py`` +* `#17268 <https://github.com/numpy/numpy/pull/17268>`__: BUG: sysconfig attributes/distutils issue +* `#17273 <https://github.com/numpy/numpy/pull/17273>`__: ENH: Annotate the arithmetic operations of ``ndarray`` and ``generic`` +* `#17278 <https://github.com/numpy/numpy/pull/17278>`__: MAINT: Merge together index page content into a single file +* `#17279 <https://github.com/numpy/numpy/pull/17279>`__: DOC: Fix a typo in shape_base. +* `#17284 <https://github.com/numpy/numpy/pull/17284>`__: ENH: Pass optimizations arguments to asv build +* `#17285 <https://github.com/numpy/numpy/pull/17285>`__: DEP: Change the financial name access warning to DeprecationWarning +* `#17288 <https://github.com/numpy/numpy/pull/17288>`__: REL: Update master after 1.19.2 release. +* `#17289 <https://github.com/numpy/numpy/pull/17289>`__: MAINT: Simplify ufunc pickling +* `#17290 <https://github.com/numpy/numpy/pull/17290>`__: MAINT: Cleanup some pystring macros +* `#17292 <https://github.com/numpy/numpy/pull/17292>`__: MAINT: Replace remaining PyString macros. +* `#17293 <https://github.com/numpy/numpy/pull/17293>`__: MAINT: Replace PyUString_Check by PyUnicode_Check. +* `#17295 <https://github.com/numpy/numpy/pull/17295>`__: BUG,ENH: fix pickling user-scalars by allowing non-format buffer... +* `#17296 <https://github.com/numpy/numpy/pull/17296>`__: MAINT: Replace some ``pyint_*`` macros defined in ``npy_3kcompat``. +* `#17297 <https://github.com/numpy/numpy/pull/17297>`__: BLD: set upper versions for build dependencies +* `#17299 <https://github.com/numpy/numpy/pull/17299>`__: MAINT: (dtype-transfer) make copyswapn and legacy cast wrapper... +* `#17300 <https://github.com/numpy/numpy/pull/17300>`__: MAINT: Replace PyBaseString_Check by PyUnicode_Check +* `#17302 <https://github.com/numpy/numpy/pull/17302>`__: MAINT: Replace a couple of missed npy_3kcompat macros +* `#17304 <https://github.com/numpy/numpy/pull/17304>`__: BUILD: pin pygments to 2.6.1, 2.7.0 breaks custom NumPyC lexer +* `#17307 <https://github.com/numpy/numpy/pull/17307>`__: MAINT: Bump hypothesis from 5.33.0 to 5.35.1 +* `#17308 <https://github.com/numpy/numpy/pull/17308>`__: MAINT: Bump pytest from 6.0.1 to 6.0.2 +* `#17309 <https://github.com/numpy/numpy/pull/17309>`__: MAINT: Move the ``fromnumeric`` annotations to their own stub file +* `#17312 <https://github.com/numpy/numpy/pull/17312>`__: MAINT: Syntax-highlight .src files on github +* `#17313 <https://github.com/numpy/numpy/pull/17313>`__: MAINT: Mark vendored/generated files in .gitattributes +* `#17315 <https://github.com/numpy/numpy/pull/17315>`__: MAINT: Cleanup f2py/cfuncs.py +* `#17319 <https://github.com/numpy/numpy/pull/17319>`__: BUG: Set deprecated fields to null in PyArray_InitArrFuncs +* `#17320 <https://github.com/numpy/numpy/pull/17320>`__: BUG: allow registration of hard-coded structured dtypes +* `#17326 <https://github.com/numpy/numpy/pull/17326>`__: ENH: Add annotations for five array construction functions +* `#17329 <https://github.com/numpy/numpy/pull/17329>`__: DOC: Fix incorrect ``.. deprecated::`` syntax that led to this... +* `#17330 <https://github.com/numpy/numpy/pull/17330>`__: DOC: improve ``issubdtype`` and scalar type docs +* `#17331 <https://github.com/numpy/numpy/pull/17331>`__: DOC: Remove the tables of scalar types, and use ``..autoclass``... +* `#17332 <https://github.com/numpy/numpy/pull/17332>`__: DOC, BLD: update lexer highlighting and make numpydocs a regular... +* `#17334 <https://github.com/numpy/numpy/pull/17334>`__: MAINT: Chaining exceptions in npyio.py +* `#17337 <https://github.com/numpy/numpy/pull/17337>`__: NEP: Regenerate table in NEP 29 (add numpy 1.18 and 1.19 to list) +* `#17338 <https://github.com/numpy/numpy/pull/17338>`__: DOC: Fix syntax errors in docstrings for versionchanged, versionadded +* `#17340 <https://github.com/numpy/numpy/pull/17340>`__: SIMD: Add partial/non-contig load and store intrinsics for 32/64-bit +* `#17344 <https://github.com/numpy/numpy/pull/17344>`__: ENH, BLD: Support for the NVIDIA HPC SDK nvfortran compiler +* `#17346 <https://github.com/numpy/numpy/pull/17346>`__: BLD,BUG: Fix a macOS build failure when ``NPY_BLAS_ORDER=""`` +* `#17350 <https://github.com/numpy/numpy/pull/17350>`__: DEV: Add PR prefix labeler and numpy prefix mapping +* `#17352 <https://github.com/numpy/numpy/pull/17352>`__: DOC: Guide to writing how-tos +* `#17353 <https://github.com/numpy/numpy/pull/17353>`__: DOC: How-to guide for I/O +* `#17354 <https://github.com/numpy/numpy/pull/17354>`__: DOC: clarify residuals return param +* `#17356 <https://github.com/numpy/numpy/pull/17356>`__: ENH: Add Npy__PyLong_AsInt function. +* `#17357 <https://github.com/numpy/numpy/pull/17357>`__: MAINT: Bump hypothesis from 5.35.1 to 5.35.3 +* `#17364 <https://github.com/numpy/numpy/pull/17364>`__: MAINT: Finish replacing PyInt_Check +* `#17369 <https://github.com/numpy/numpy/pull/17369>`__: DOC: distutils: Remove an obsolete paragraph. +* `#17370 <https://github.com/numpy/numpy/pull/17370>`__: NEP: Edit nep-0042 for more clarity +* `#17372 <https://github.com/numpy/numpy/pull/17372>`__: ENH: Add annotations for remaining ``ndarray`` / ``generic`` non-magic... +* `#17373 <https://github.com/numpy/numpy/pull/17373>`__: BUG: Fixes module data docstrings. +* `#17375 <https://github.com/numpy/numpy/pull/17375>`__: DOC: Fix default_rng docstring +* `#17377 <https://github.com/numpy/numpy/pull/17377>`__: BUG: ensure _UFuncNoLoopError can be pickled +* `#17380 <https://github.com/numpy/numpy/pull/17380>`__: Minor grammatical correction in quickstart doc. +* `#17382 <https://github.com/numpy/numpy/pull/17382>`__: DOC: NumPy restyling for pydata theme +* `#17383 <https://github.com/numpy/numpy/pull/17383>`__: MAINT: Fix docstring for np.matmul +* `#17386 <https://github.com/numpy/numpy/pull/17386>`__: MAINT: Bump hypothesis from 5.35.3 to 5.36.1 +* `#17388 <https://github.com/numpy/numpy/pull/17388>`__: MAINT: Remove old debug print statement. +* `#17391 <https://github.com/numpy/numpy/pull/17391>`__: DOC: Replace "About NumPy" with "Document conventions" +* `#17392 <https://github.com/numpy/numpy/pull/17392>`__: DOC: Update info on doc style rules +* `#17393 <https://github.com/numpy/numpy/pull/17393>`__: BUG: Fix default void, datetime, and timedelta in array coercion +* `#17396 <https://github.com/numpy/numpy/pull/17396>`__: MAINT: Replace append_metastr_to_string function. +* `#17399 <https://github.com/numpy/numpy/pull/17399>`__: BLD: Fixed ARGOUTVIEWM memory deallocation. Closes #17398. +* `#17400 <https://github.com/numpy/numpy/pull/17400>`__: DOC: rm incorrect alias from recarray user article. +* `#17401 <https://github.com/numpy/numpy/pull/17401>`__: MAINT: Rewrite can-cast logic in terms of NEP 42 +* `#17402 <https://github.com/numpy/numpy/pull/17402>`__: DOC: Add arraysetops to an autosummary +* `#17404 <https://github.com/numpy/numpy/pull/17404>`__: MAINT: Replace PyUString_ConcatAndDel in nditer_constr.c. +* `#17405 <https://github.com/numpy/numpy/pull/17405>`__: MAINT: Replace PyUString_ConcatAndDel in mapping.c. +* `#17406 <https://github.com/numpy/numpy/pull/17406>`__: ENH: Replace the module-level ``__getattr__`` with explicit type... +* `#17407 <https://github.com/numpy/numpy/pull/17407>`__: DOC: in PR template, set expectations for PR review timeline +* `#17409 <https://github.com/numpy/numpy/pull/17409>`__: MAINT: Cleanup remaining PyUString_ConcatAndDel use. +* `#17410 <https://github.com/numpy/numpy/pull/17410>`__: API: Special case how numpy scalars are coerced to signed integer +* `#17411 <https://github.com/numpy/numpy/pull/17411>`__: TST: Mark the typing tests as slow +* `#17412 <https://github.com/numpy/numpy/pull/17412>`__: DOC: Fix a parameter type in the ``putmask`` docs +* `#17418 <https://github.com/numpy/numpy/pull/17418>`__: DOC: adding operational form documentation for array ops +* `#17419 <https://github.com/numpy/numpy/pull/17419>`__: DEP: Deprecate coercion to subarray dtypes +* `#17421 <https://github.com/numpy/numpy/pull/17421>`__: BUG: Fix memory leak in array-coercion error paths +* `#17422 <https://github.com/numpy/numpy/pull/17422>`__: MAINT: chains nested try-except in numpy/ma/core.py +* `#17423 <https://github.com/numpy/numpy/pull/17423>`__: DOC: Remove bogus reference to _a_ +* `#17424 <https://github.com/numpy/numpy/pull/17424>`__: DOC: Fix formatting issues in description of .c.src files +* `#17427 <https://github.com/numpy/numpy/pull/17427>`__: NEP: nep-0029 typo correction +* `#17429 <https://github.com/numpy/numpy/pull/17429>`__: MAINT: Move aliases for common scalar unions to ``numpy.typing`` +* `#17430 <https://github.com/numpy/numpy/pull/17430>`__: BUG: Fix memoryleaks related to NEP 37 function overrides +* `#17431 <https://github.com/numpy/numpy/pull/17431>`__: DOC: Fix the links for ``Ellipsis`` +* `#17432 <https://github.com/numpy/numpy/pull/17432>`__: DOC: add references to einops and opt_einsum +* `#17433 <https://github.com/numpy/numpy/pull/17433>`__: MAINT : Disable 32 bit PyPy CI testing on Windows. +* `#17435 <https://github.com/numpy/numpy/pull/17435>`__: DOC: Security warning for issues template +* `#17436 <https://github.com/numpy/numpy/pull/17436>`__: DOC: Fix "Feature request" spelling in issue templates +* `#17438 <https://github.com/numpy/numpy/pull/17438>`__: MAINT: Chaining exception in numpy\numpy\ma\mrecords.py +* `#17440 <https://github.com/numpy/numpy/pull/17440>`__: DOC: Cleaner template for PRs +* `#17442 <https://github.com/numpy/numpy/pull/17442>`__: MAINT: fix exception chaining in format.py +* `#17443 <https://github.com/numpy/numpy/pull/17443>`__: ENH: Warn on unsupported Python 3.10+ +* `#17444 <https://github.com/numpy/numpy/pull/17444>`__: ENH: Add ``Typing :: Typed`` to the PyPi classifier +* `#17445 <https://github.com/numpy/numpy/pull/17445>`__: DOC: Fix the references for macros +* `#17447 <https://github.com/numpy/numpy/pull/17447>`__: NEP: update NEP 42 with discussion of type hinting applications +* `#17448 <https://github.com/numpy/numpy/pull/17448>`__: DOC: Remove CoC pages from Sphinx +* `#17453 <https://github.com/numpy/numpy/pull/17453>`__: MAINT: Chain exceptions in "_polybase.py" +* `#17455 <https://github.com/numpy/numpy/pull/17455>`__: MAINT: Bump hypothesis from 5.36.1 to 5.37.0 +* `#17456 <https://github.com/numpy/numpy/pull/17456>`__: ENH: add dtype option to numpy.lib.function_base.cov and corrcoef +* `#17457 <https://github.com/numpy/numpy/pull/17457>`__: BUG: Fixes incorrect error message in numpy.ediff1d +* `#17459 <https://github.com/numpy/numpy/pull/17459>`__: DOC: update code of conduct URL +* `#17464 <https://github.com/numpy/numpy/pull/17464>`__: DOC: Add some entries for C types and macros +* `#17465 <https://github.com/numpy/numpy/pull/17465>`__: ENH: Add annotations for bitwise operations +* `#17468 <https://github.com/numpy/numpy/pull/17468>`__: DOC: add some missing scalar aliases +* `#17472 <https://github.com/numpy/numpy/pull/17472>`__: TST: Fix doctest for full_like +* `#17473 <https://github.com/numpy/numpy/pull/17473>`__: MAINT: py3k: remove os.fspath and os.PathLike backports +* `#17474 <https://github.com/numpy/numpy/pull/17474>`__: MAINT: Move the ``np.core.numeric`` annotations to their own stub... +* `#17479 <https://github.com/numpy/numpy/pull/17479>`__: ENH: type ``np.unicode_`` as ``np.str_`` +* `#17481 <https://github.com/numpy/numpy/pull/17481>`__: DOC: Fix the entries for members of structures +* `#17483 <https://github.com/numpy/numpy/pull/17483>`__: DOC: Fix the references for ``random.*`` +* `#17485 <https://github.com/numpy/numpy/pull/17485>`__: BLD: circleCI- merge before build, add -n to sphinx +* `#17487 <https://github.com/numpy/numpy/pull/17487>`__: MAINT: Remove duplicate placeholder annotations +* `#17497 <https://github.com/numpy/numpy/pull/17497>`__: DOC: Use consistent lowercase on docs landing page +* `#17498 <https://github.com/numpy/numpy/pull/17498>`__: MAINT: fix incompatible type comparison in numpy.lib.utils.info +* `#17501 <https://github.com/numpy/numpy/pull/17501>`__: BUG: Fix failures in master related to userdtype registeration +* `#17502 <https://github.com/numpy/numpy/pull/17502>`__: BUG: remove ``sys`` from the type stubs +* `#17503 <https://github.com/numpy/numpy/pull/17503>`__: DOC: Fix empty 'C style guide' page +* `#17504 <https://github.com/numpy/numpy/pull/17504>`__: DOC: Rename 'Quickstart tutorial' +* `#17508 <https://github.com/numpy/numpy/pull/17508>`__: ENH: Added the Final feature for all constants +* `#17510 <https://github.com/numpy/numpy/pull/17510>`__: DOC: Fewer blank lines in PR template +* `#17520 <https://github.com/numpy/numpy/pull/17520>`__: DOC: Display real license on license page +* `#17521 <https://github.com/numpy/numpy/pull/17521>`__: DOC: Add docstrings for some scalar types +* `#17523 <https://github.com/numpy/numpy/pull/17523>`__: DOC: Update top links in landing page +* `#17525 <https://github.com/numpy/numpy/pull/17525>`__: CI: Make merge ref grabbing conditional on the PR being active +* `#17527 <https://github.com/numpy/numpy/pull/17527>`__: DOC: Fix Bool types in C functions +* `#17528 <https://github.com/numpy/numpy/pull/17528>`__: Doc: Fix some links and typos +* `#17529 <https://github.com/numpy/numpy/pull/17529>`__: MAINT: Cleanup compatibility code for pathlib +* `#17534 <https://github.com/numpy/numpy/pull/17534>`__: DOC: Fix a typo +* `#17535 <https://github.com/numpy/numpy/pull/17535>`__: ENH: add function to get broadcast shape from a given set of... +* `#17536 <https://github.com/numpy/numpy/pull/17536>`__: BUG: Fixed crash on self-referential dtypes +* `#17537 <https://github.com/numpy/numpy/pull/17537>`__: MAINT: Bump hypothesis from 5.37.0 to 5.37.1 +* `#17538 <https://github.com/numpy/numpy/pull/17538>`__: MAINT: Bump pydata-sphinx-theme from 0.4.0 to 0.4.1 +* `#17539 <https://github.com/numpy/numpy/pull/17539>`__: MAINT: Bump mypy from 0.782 to 0.790 +* `#17540 <https://github.com/numpy/numpy/pull/17540>`__: ENH: Make ``np.number`` generic with respect to its precision +* `#17541 <https://github.com/numpy/numpy/pull/17541>`__: CI: fix conditional for PR merge command +* `#17546 <https://github.com/numpy/numpy/pull/17546>`__: MAINT: explicit disabling ``CCompilerOpt`` in F2PY +* `#17548 <https://github.com/numpy/numpy/pull/17548>`__: BUG: Cygwin Workaround for #14787 on affected platforms +* `#17549 <https://github.com/numpy/numpy/pull/17549>`__: DOC: Fix the entries of C functions +* `#17555 <https://github.com/numpy/numpy/pull/17555>`__: DOC: Fix wrong blockquotes +* `#17558 <https://github.com/numpy/numpy/pull/17558>`__: DOC: MAINT: Add NEP 43 links to NEP 42 +* `#17559 <https://github.com/numpy/numpy/pull/17559>`__: DOC: Remove directives for some constants +* `#17564 <https://github.com/numpy/numpy/pull/17564>`__: MAINT: Update the annotations in ``np.core.numeric`` +* `#17570 <https://github.com/numpy/numpy/pull/17570>`__: DOC: Add the entry for ``NPY_FEATURE_VERSION`` +* `#17571 <https://github.com/numpy/numpy/pull/17571>`__: DOC: Fix typos +* `#17572 <https://github.com/numpy/numpy/pull/17572>`__: ENH: Add annotations for three new constants +* `#17576 <https://github.com/numpy/numpy/pull/17576>`__: DOC: Fix Boolean array indexing typo +* `#17577 <https://github.com/numpy/numpy/pull/17577>`__: BUG: Respect dtype of all-zero argument to poly1d +* `#17578 <https://github.com/numpy/numpy/pull/17578>`__: NEP36: include additional feedback +* `#17580 <https://github.com/numpy/numpy/pull/17580>`__: MAINT: Cleanup swig for Python 3. +* `#17581 <https://github.com/numpy/numpy/pull/17581>`__: MAINT: Move the ``np.core.numerictypes`` annotations to their own... +* `#17583 <https://github.com/numpy/numpy/pull/17583>`__: MAINT: Bump hypothesis from 5.37.1 to 5.37.3 +* `#17584 <https://github.com/numpy/numpy/pull/17584>`__: ENH: Add annotations for ``np.core._type_aliases`` +* `#17594 <https://github.com/numpy/numpy/pull/17594>`__: DOC: Typo in lexsort docstring +* `#17596 <https://github.com/numpy/numpy/pull/17596>`__: DEP,BUG: Coercion/cast of array to a subarray dtype will be fixed +* `#17597 <https://github.com/numpy/numpy/pull/17597>`__: TST: Clean up the errors of the typing tests +* `#17598 <https://github.com/numpy/numpy/pull/17598>`__: BUG: Fixed file handle leak in array_tofile. +* `#17601 <https://github.com/numpy/numpy/pull/17601>`__: TST: Fix a broken ``np.core.numeric`` test +* `#17603 <https://github.com/numpy/numpy/pull/17603>`__: MAINT: Mark dead code as intentional for clang. +* `#17607 <https://github.com/numpy/numpy/pull/17607>`__: DOC: removed old references to submodule licenses +* `#17608 <https://github.com/numpy/numpy/pull/17608>`__: DOC: Fix typos (general documentation) +* `#17610 <https://github.com/numpy/numpy/pull/17610>`__: Fully qualify license trove classifier +* `#17611 <https://github.com/numpy/numpy/pull/17611>`__: BUG: mac dylib treated as part of extra objects by f2py +* `#17613 <https://github.com/numpy/numpy/pull/17613>`__: ENH: Add annotations for 9 ``ndarray``/``generic`` magic methods +* `#17614 <https://github.com/numpy/numpy/pull/17614>`__: DOC: Fix the document for arrays interface +* `#17618 <https://github.com/numpy/numpy/pull/17618>`__: MAINT: Conversion of some strings to f-strings +* `#17619 <https://github.com/numpy/numpy/pull/17619>`__: DOC: Fix some references +* `#17621 <https://github.com/numpy/numpy/pull/17621>`__: TST: Valid docstring for config_py function show() +* `#17622 <https://github.com/numpy/numpy/pull/17622>`__: MAINT: Conversion of some strings to fstrings, part II +* `#17623 <https://github.com/numpy/numpy/pull/17623>`__: MAINT: Conversion of some strings to fstrings, part III +* `#17624 <https://github.com/numpy/numpy/pull/17624>`__: DOC: Tidy up references to ``str_`` / ``bytes_`` +* `#17625 <https://github.com/numpy/numpy/pull/17625>`__: MAINT: Conversion of some strings to fstrings, part iv +* `#17627 <https://github.com/numpy/numpy/pull/17627>`__: DOC: Fix the references for ``__array_*__`` +* `#17628 <https://github.com/numpy/numpy/pull/17628>`__: DOC: Add entries for macros +* `#17629 <https://github.com/numpy/numpy/pull/17629>`__: DOC: Add ``identity_value`` to ``PyUFuncObject`` +* `#17630 <https://github.com/numpy/numpy/pull/17630>`__: DOC: Replace ``PyCObject`` with ``PyCapsule`` +* `#17633 <https://github.com/numpy/numpy/pull/17633>`__: DOC: Don't use Python highlighting for non-python code +* `#17638 <https://github.com/numpy/numpy/pull/17638>`__: DOC: Fix some references +* `#17639 <https://github.com/numpy/numpy/pull/17639>`__: MAINT: Bump hypothesis from 5.37.3 to 5.38.0 +* `#17641 <https://github.com/numpy/numpy/pull/17641>`__: MAINT, BLD: update to OpenBLAS v0.3.12 +* `#17642 <https://github.com/numpy/numpy/pull/17642>`__: DOC: Fix reference to atleast_1d +* `#17643 <https://github.com/numpy/numpy/pull/17643>`__: ENH: Add annotations for ``np.core._ufunc_config`` +* `#17644 <https://github.com/numpy/numpy/pull/17644>`__: ENH: Add annotations for ``np.core.shape_base`` +* `#17645 <https://github.com/numpy/numpy/pull/17645>`__: BUG: fix np.timedelta64('nat').__format__ throwing an exception +* `#17654 <https://github.com/numpy/numpy/pull/17654>`__: BUG: f2py incorrectly translates dimension declarations. +* `#17655 <https://github.com/numpy/numpy/pull/17655>`__: BLD: Fix installing Numpy on z/OS +* `#17657 <https://github.com/numpy/numpy/pull/17657>`__: NEP: Ensure inner loop signature is complete everywhere +* `#17658 <https://github.com/numpy/numpy/pull/17658>`__: TST: simplify source path names in compilation test +* `#17662 <https://github.com/numpy/numpy/pull/17662>`__: TST: f2py: Add a doctest for ``getlincoef`` +* `#17666 <https://github.com/numpy/numpy/pull/17666>`__: REL: Update master after 1.19.3 release. +* `#17668 <https://github.com/numpy/numpy/pull/17668>`__: TST: Make test suite work in FIPS (140-2) Mode +* `#17670 <https://github.com/numpy/numpy/pull/17670>`__: DOC: f2py: Add a docstring for getarrlen +* `#17672 <https://github.com/numpy/numpy/pull/17672>`__: DOC: Update README badge for travis-ci.com +* `#17673 <https://github.com/numpy/numpy/pull/17673>`__: MAINT: Refine a number of ``np.generic`` annotations +* `#17675 <https://github.com/numpy/numpy/pull/17675>`__: MAINT: Update release documentation and software +* `#17681 <https://github.com/numpy/numpy/pull/17681>`__: SIMD: Add sum intrinsics for float/double. +* `#17682 <https://github.com/numpy/numpy/pull/17682>`__: BUG: (nditer_impl.h) Use ``intp`` instead of ``char *`` for offset... +* `#17689 <https://github.com/numpy/numpy/pull/17689>`__: BUG: Fix small bug in ``make_lite.py``. +* `#17691 <https://github.com/numpy/numpy/pull/17691>`__: DOC: Modify Templates +* `#17692 <https://github.com/numpy/numpy/pull/17692>`__: MAINT: Bump hypothesis from 5.38.0 to 5.41.0 +* `#17693 <https://github.com/numpy/numpy/pull/17693>`__: MAINT: Bump pytz from 2020.1 to 2020.4 +* `#17695 <https://github.com/numpy/numpy/pull/17695>`__: TST: use a more standard workflow for PyPy +* `#17696 <https://github.com/numpy/numpy/pull/17696>`__: REL: Update master after 1.19.4 release. +* `#17699 <https://github.com/numpy/numpy/pull/17699>`__: MAINT: Rename ``DtypeLike`` to ``DTypeLike`` +* `#17700 <https://github.com/numpy/numpy/pull/17700>`__: Fix small typos. +* `#17701 <https://github.com/numpy/numpy/pull/17701>`__: BUG: Fixed an issue where ``.pyi`` files were ignored by numpy... +* `#17703 <https://github.com/numpy/numpy/pull/17703>`__: Fix Doc Typos & Added Example +* `#17708 <https://github.com/numpy/numpy/pull/17708>`__: Improve the einsum bench by adding new bench cases and variable... +* `#17715 <https://github.com/numpy/numpy/pull/17715>`__: REV: Revert gh-17654 - f2py incorrectly translates dimension... +* `#17717 <https://github.com/numpy/numpy/pull/17717>`__: MAINT: Add more files to ``.gitgnore`` +* `#17720 <https://github.com/numpy/numpy/pull/17720>`__: API: Do not import sliding_window_view to main namespace +* `#17723 <https://github.com/numpy/numpy/pull/17723>`__: MAINT: Do not override ``sliding_window_view`` module to ``numpy`` +* `#17725 <https://github.com/numpy/numpy/pull/17725>`__: NEP: Add NEP-35 instructions on reading like= downstream +* `#17729 <https://github.com/numpy/numpy/pull/17729>`__: BLD: Use importlib to find numpy root directory in distutils +* `#17733 <https://github.com/numpy/numpy/pull/17733>`__: MAINT: ma: Remove unused ``**options`` from MaskedArray ``__new__``... +* `#17735 <https://github.com/numpy/numpy/pull/17735>`__: TST: Remove Python 3.6 CI testing. +* `#17738 <https://github.com/numpy/numpy/pull/17738>`__: BLD, TST: move linux jobs to github actions +* `#17740 <https://github.com/numpy/numpy/pull/17740>`__: MAINT: Bump hypothesis from 5.41.0 to 5.41.2 +* `#17743 <https://github.com/numpy/numpy/pull/17743>`__: BLD, BUG: Fix cblas detection on windows +* `#17745 <https://github.com/numpy/numpy/pull/17745>`__: TST: add pypy3.7 +* `#17748 <https://github.com/numpy/numpy/pull/17748>`__: BLD: compare platform.architecture() correctly +* `#17749 <https://github.com/numpy/numpy/pull/17749>`__: DOC: Add "performance" category to the release notes +* `#17751 <https://github.com/numpy/numpy/pull/17751>`__: BUG: Fix segfault due to out of bound pointer in floatstatus... +* `#17753 <https://github.com/numpy/numpy/pull/17753>`__: BUG: Fix buffer export dtype references +* `#17755 <https://github.com/numpy/numpy/pull/17755>`__: BUG: Fix memory leaks found using valgrind +* `#17758 <https://github.com/numpy/numpy/pull/17758>`__: BLD: Lazy load f2py test utilities +* `#17759 <https://github.com/numpy/numpy/pull/17759>`__: BLD: use BUFFERSIZE=20 in OpenBLAS +* `#17763 <https://github.com/numpy/numpy/pull/17763>`__: SIMD, BUG: fix reuses the previous values during the fallback... +* `#17768 <https://github.com/numpy/numpy/pull/17768>`__: MAINT: update link to website in FUNDING.yml +* `#17773 <https://github.com/numpy/numpy/pull/17773>`__: MAINT: Add BLD and STY to labeler prefixes. +* `#17776 <https://github.com/numpy/numpy/pull/17776>`__: MAINT: Simplify Hypothesis configuration +* `#17787 <https://github.com/numpy/numpy/pull/17787>`__: NEP: Make like= argument added in NEP-35 strict +* `#17788 <https://github.com/numpy/numpy/pull/17788>`__: DOC: Fix up links, code blocks of release note fragments +* `#17796 <https://github.com/numpy/numpy/pull/17796>`__: MAINT: Minor touchups in npyio +* `#17802 <https://github.com/numpy/numpy/pull/17802>`__: MAINT: Update mailmap. +* `#17805 <https://github.com/numpy/numpy/pull/17805>`__: MAINT: Set the ufunc and ndarray ops return type to ``Any`` +* `#17812 <https://github.com/numpy/numpy/pull/17812>`__: Update linalg.py +* `#17815 <https://github.com/numpy/numpy/pull/17815>`__: DOC: Fix empty_like docstring +* `#17823 <https://github.com/numpy/numpy/pull/17823>`__: DOC: Add missing release fragments to ``upcoming_changes``. +* `#17828 <https://github.com/numpy/numpy/pull/17828>`__: BUG: Fix incorrectly passed size in masked processing +* `#17829 <https://github.com/numpy/numpy/pull/17829>`__: MAINT: Bump hypothesis from 5.41.2 to 5.41.3 +* `#17830 <https://github.com/numpy/numpy/pull/17830>`__: TST: Add back durations flag for DEBUG builds. +* `#17832 <https://github.com/numpy/numpy/pull/17832>`__: BUG: Fix subarray dtype used with too large count in fromfile +* `#17833 <https://github.com/numpy/numpy/pull/17833>`__: BUG: Fix pickling of scalars with ``NPY_LISTPICKLE`` +* `#17838 <https://github.com/numpy/numpy/pull/17838>`__: DOC: Update the ``numpy.typing`` documentation +* `#17841 <https://github.com/numpy/numpy/pull/17841>`__: DOC: Fixing boilerplate code example +* `#17844 <https://github.com/numpy/numpy/pull/17844>`__: MAINT: Add ``__all__`` to ``numpy.typing`` +* `#17848 <https://github.com/numpy/numpy/pull/17848>`__: DOC: Add release note for gh-16161. +* `#17855 <https://github.com/numpy/numpy/pull/17855>`__: BUG: Fix incorrect C function prototypes/declarations. +* `#17857 <https://github.com/numpy/numpy/pull/17857>`__: MAINT: Prepare for the NumPy 1.20.x branch. +* `#17869 <https://github.com/numpy/numpy/pull/17869>`__: BUG, TST: use python-version not PYTHON_VERSION +* `#17875 <https://github.com/numpy/numpy/pull/17875>`__: DOC: Prepare for 1.20.0 release +* `#17879 <https://github.com/numpy/numpy/pull/17879>`__: BUG: Fix buffer readflag errors and small leaks diff --git a/doc/neps/nep-0013-ufunc-overrides.rst b/doc/neps/nep-0013-ufunc-overrides.rst index 698e45738..4a647e9d3 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 @@ -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-0023-backwards-compatibility.rst b/doc/neps/nep-0023-backwards-compatibility.rst index 158f46273..c8bd7c180 100644 --- a/doc/neps/nep-0023-backwards-compatibility.rst +++ b/doc/neps/nep-0023-backwards-compatibility.rst @@ -156,7 +156,7 @@ 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). +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 diff --git a/doc/neps/nep-0025-missing-data-3.rst b/doc/neps/nep-0025-missing-data-3.rst index ffe208c98..81045652e 100644 --- a/doc/neps/nep-0025-missing-data-3.rst +++ b/doc/neps/nep-0025-missing-data-3.rst @@ -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-0027-zero-rank-arrarys.rst b/doc/neps/nep-0027-zero-rank-arrarys.rst index 2d152234c..cb3972675 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-0029-deprecation_policy.rst b/doc/neps/nep-0029-deprecation_policy.rst index 957674ee6..a50afcb98 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 1c3722f46..bf98a7467 100644 --- a/doc/neps/nep-0032-remove-financial-functions.rst +++ b/doc/neps/nep-0032-remove-financial-functions.rst @@ -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 dca8b2418..5ec01081a 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 @@ -8,7 +8,7 @@ NEP 35 — Array Creation Dispatching With __array_function__ :Status: Draft :Type: Standards Track :Created: 2019-10-15 -:Updated: 2020-08-17 +:Updated: 2020-11-06 :Resolution: Abstract @@ -120,9 +120,9 @@ conversion, ultimately raising a Now we should look at how a library like Dask could benefit from ``like=``. Before we understand that, it's important to understand a bit about Dask basics -and ensures correctness with ``__array_function__``. Note that Dask can perform -computations on different sorts of objects, like dataframes, bags and arrays, -here we will focus strictly on arrays, which are the objects we can use +and how it ensures correctness with ``__array_function__``. Note that Dask can +perform computations on different sorts of objects, like dataframes, bags and +arrays, here we will focus strictly on arrays, which are the objects we can use ``__array_function__`` with. Dask uses a graph computing model, meaning it breaks down a large problem in @@ -221,11 +221,14 @@ array creation, the new ``like=`` keyword shall be used for the purpose of dispatching. Downstream libraries will benefit from the ``like=`` argument without any -changes to their API, given the argument is of exclusive implementation in -NumPy. It will still be required that downstream libraries implement the -``__array_function__`` protocol, as described by NEP 18 [1]_, and appropriately -introduce the argument to their calls to NumPy array creation functions, as -exemplified in :ref:`neps.like-kwarg.usage-and-impact`. +changes to their API, given the argument only needs to be implemented by NumPy. +It's still allowed that downstream libraries include the ``like=`` argument, +as it can be useful in some cases, please refer to +:ref:`neps.like-kwarg.implementation` for details on those cases. It will still +be required that downstream libraries implement the ``__array_function__`` +protocol, as described by NEP 18 [1]_, and appropriately introduce the argument +to their calls to NumPy array creation functions, as exemplified in +:ref:`neps.like-kwarg.usage-and-impact`. Related work ------------ @@ -235,6 +238,8 @@ protocol's limitation, such as the introduction of the ``__duckarray__`` protocol in NEP 30 [3]_, and the introduction of an overriding mechanism called ``uarray`` by NEP 31 [4]_. +.. _neps.like-kwarg.implementation: + Implementation -------------- @@ -252,13 +257,20 @@ This newly proposed keyword shall be removed by the ``__array_function__`` mechanism from the keyword dictionary before dispatching. The purpose for this is twofold: -1. The object will have no use in the downstream library's implementation; and -2. Simplifies adoption of array creation by those libraries already opting-in +1. Simplifies adoption of array creation by those libraries already opting-in to implement the ``__array_function__`` protocol, thus removing the - requirement to explicitly opt-in for all array creation functions. - -Downstream libraries thus shall _NOT_ include the ``like=`` keyword to their -array creation APIs, which is a NumPy-exclusive keyword. + requirement to explicitly opt-in for all array creation functions; and +2. Most downstream libraries will have no use for the keyword argument, and + those that do may accomplish so by capturing ``self`` from + ``__array_function__``. + +Downstream libraries thus do not require to include the ``like=`` keyword to +their array creation APIs. In some cases (e.g., Dask), having the ``like=`` +keyword can be useful, as it would allow the implementation to identify +array internals. As an example, Dask could benefit from the reference array +to identify its chunk type (e.g., NumPy, CuPy, Sparse), and thus create a new +Dask array backed by the same chunk type, something that's not possible unless +Dask can read the reference array's attributes. Function Dispatching ~~~~~~~~~~~~~~~~~~~~ @@ -317,6 +329,81 @@ 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. +Reading the Reference Array Downstream +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +As stated in the beginning of :ref:`neps.like-kwarg.implementation` section, +``like=`` is not propagated to the downstream library, nevertheless, it's still +possible to access it. This requires some changes in the downstream library's +``__array_function__`` definition, where the ``self`` attribute is in practice +that passed via ``like=``. This is the case because we use ``like=`` as the +dispatching array, unlike other compute functions covered by NEP-18 that usually +dispatch on the first positional argument. + +An example of such use is to create a new Dask array while preserving its +backend type: + +.. code:: python + # Returns dask.array<array, shape=(3,), dtype=int64, chunksize=(3,), chunktype=cupy.ndarray> + np.asarray([1, 2, 3], like=da.array(cp.array(()))) + + # Returns a cupy.ndarray + type(np.asarray([1, 2, 3], like=da.array(cp.array(()))).compute()) + +Note how above the array is backed by ``chunktype=cupy.ndarray``, and the +resulting array after computing it is also a ``cupy.ndarray``. If Dask did +not use the ``like=`` argument via the ``self`` attribute from +``__array_function__``, the example above would be backed by ``numpy.ndarray`` +instead: + +.. code:: python + # Returns dask.array<array, shape=(3,), dtype=int64, chunksize=(3,), chunktype=numpy.ndarray> + np.asarray([1, 2, 3], like=da.array(cp.array(()))) + + # Returns a numpy.ndarray + type(np.asarray([1, 2, 3], like=da.array(cp.array(()))).compute()) + +Given the library would need to rely on ``self`` attribute from +``__array_function__`` to dispatch the function with the correct reference +array, we suggest one of two alternatives: + +1. Introduce a list of functions in the downstream library that do support the + ``like=`` argument and pass ``like=self`` when calling the function; or +2. Inspect whether the function's signature and verify whether it includes the + ``like=`` argument. Note that this may incur in a higher performance penalty + and assumes introspection is possible, which may not be if the function is + a C function. + +To make things clearer, let's take a look at how suggestion 2 could be +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 + + # Dispatch ``da_func`` (da.asarray, for example) with *args and **kwargs + da_func(*args, **kwargs) + +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 + + # Inspect ``da_func``'s signature and store keyword-only arguments + import inspect + kwonlyargs = inspect.getfullargspec(da_func).kwonlyargs + + # If ``like`` is contained in ``da_func``'s signature, add ``like=self`` + # to the kwargs dictionary. + if 'like' in kwonlyargs: + kwargs['like'] = self + + # Dispatch ``da_func`` (da.asarray, for example) with args and kwargs. + # Here, kwargs contain ``like=self`` if the function's signature does too. + da_func(*args, **kwargs) + Alternatives ------------ diff --git a/doc/neps/nep-0036-fair-play.rst b/doc/neps/nep-0036-fair-play.rst index b8cf88788..32e5e1e75 100644 --- a/doc/neps/nep-0036-fair-play.rst +++ b/doc/neps/nep-0036-fair-play.rst @@ -56,7 +56,7 @@ Scope ----- This document aims to define a minimal set of rules that, when -followed, will be considered good faith efforts in line with the +followed, will be considered good-faith efforts in line with the expectations of the NumPy developers. Our hope is that developers who feel they need to modify NumPy will @@ -65,8 +65,8 @@ mechanisms for extending our APIs and for operating on externally defined array objects. When in doubt, please `talk to us first -<http://numpy-discussion.10968.n7.nabble.com/>`__. We may suggest an -alternative; at minimum, we'll be prepared. +<https://numpy.org/community/>`__. We may suggest an alternative; at +minimum, we'll be prepared. Fair play rules --------------- @@ -74,11 +74,15 @@ Fair play rules 1. Do not reuse the NumPy name for projects not developed by the NumPy community. - At time of writing, there are only a handful of `numpy`-named - packages developed by the community, including `numpy`, - `numpy-financial`, and `unumpy`. We ask that external packages not - include the phrase `numpy`, i.e., avoid names such as - `mycompany_numpy`. + At time of writing, there are only a handful of ``numpy``-named + packages developed by the community, including ``numpy``, + ``numpy-financial``, and ``unumpy``. We ask that external packages not + include the phrase ``numpy``, i.e., avoid names such as + ``mycompany_numpy``. + + To be clear, this rule only applies to modules (package names); it + is perfectly acceptable to have a *submodule* of your own library + named ``mylibrary.numpy``. NumPy is a trademark owned by NumFOCUS. @@ -89,7 +93,7 @@ Fair play rules which parts of NumPy have been modified. If you have to break this rule (and we implore you not - to!), then make it clear in the `__version__` tag that + to!), then make it clear in the ``__version__`` tag that you have modified NumPy, e.g.:: >>> print(np.__version__) diff --git a/doc/neps/nep-0042-new-dtypes.rst b/doc/neps/nep-0042-new-dtypes.rst index ff92e1612..1738bd1ab 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 <NEP43>` 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: @@ -784,7 +787,7 @@ Its ``resolve_descriptors`` function may look like:: # This is always an "unsafe" cast, but for int64, we can represent # it by a simple view (if the dtypes are both canonical). # (represented as C-side flags here). - safety_and_view = NPY_UNSAFE_CASTING | NPY_CAST_IS_VIEW + safety_and_view = NPY_UNSAFE_CASTING | _NPY_CAST_IS_VIEW return safety_and_view, (from_dtype, to_dtype) .. note:: @@ -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,19 +1301,23 @@ 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 ``casting`` will be set to ``NPY_EQUIV_CASTING``, ``NPY_SAFE_CASTING``, ``NPY_UNSAFE_CASTING``, or ``NPY_SAME_KIND_CASTING``. A new, additional flag, - ``NPY_CAST_IS_VIEW``, can be set to indicate that no cast is necessary and a + ``_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 <NEP43>`) diff --git a/doc/neps/nep-0043-extensible-ufuncs.rst b/doc/neps/nep-0043-extensible-ufuncs.rst index 974a705e6..7dbad289b 100644 --- a/doc/neps/nep-0043-extensible-ufuncs.rst +++ b/doc/neps/nep-0043-extensible-ufuncs.rst @@ -235,28 +235,39 @@ 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]) + out_descr = given_descrs[2] # preserve input (e.g. metadata) + if given_descrs[2] is None: + out_descr = DTypes[2]() + # The operation is always "safe" casting (most ufuncs are) - return (given_descrs[0], given_descrs[1], context.DTypes[2]()), "safe" + return (given_descrs[0], given_descrs[1], out_descr), "safe" - def strided_loop(context, n, data, strides): + def strided_loop(context, dimensions, data, strides, innerloop_data): """The 1-D strided loop, similar to those used in current ufuncs""" - # n: Number of elements in the one dimensional loop + # dimensions: Number of loop items and core dimensions # data: Pointers to the array data. # strides: strides to iterate all elements + n = dimensions[0] # number of items to loop over num_chars1 = context.descriptors[0].itemsize - num_chars2 = context.descriptors[0].itemsize + num_chars2 = context.descriptors[1].itemsize # C code using the above information to compare the strings in # both arrays. In particular, this loop requires the `num_chars1` @@ -421,9 +432,8 @@ a new ``ArrayMethod`` object: # 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 @@ -446,7 +456,8 @@ a new ``ArrayMethod`` object: raise NotImplementedError @staticmethod - def strided_inner_loop(Context : context, data, strides,...): + def strided_inner_loop( + Context : context, data, dimensions, strides, innerloop_data): """The inner-loop (equivalent to the current ufunc loop) which is returned by the default `get_loop()` implementation.""" raise NotImplementedError @@ -466,8 +477,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 @@ -614,7 +623,8 @@ definitions (see also :ref:`NEP 42 <NEP42>` ``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]); @@ -650,24 +660,24 @@ definitions (see also :ref:`NEP 42 <NEP42>` ``CastingImpl``): * 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 **userdata, + 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:: - int inner_loop(PyArrayMethod_Context *context, ..., void *userdata); + int inner_loop(PyArrayMethod_Context *context, ..., void *innerloop_data); Will have the identical signature to current inner-loops with the following changes: @@ -677,12 +687,12 @@ definitions (see also :ref:`NEP 42 <NEP42>` ``CastingImpl``): * The new first argument ``PyArrayMethod_Context *`` is used to pass in potentially required information about the ufunc or descriptors in a convenient way. - * The ``void *userdata`` will be the ``NpyAuxData **userdata`` as set by - ``get_loop``. If ``get_loop`` does not set ``userdata`` an ``npy_intp *`` + * The ``void *innerloop_data`` will be the ``NpyAuxData **innerloop_data`` as set by + ``get_loop``. If ``get_loop`` does not set ``innerloop_data`` an ``npy_intp *`` is passed instead (see `Error Handling`_ below for the motivation). *Note:* Since ``get_loop`` is expected to be private, the exact implementation - of ``userdata`` can be modified until final exposure. + of ``innerloop_data`` can be modified until final exposure. Creation of a new ``BoundArrayMethod`` will use a ``PyArrayMethod_FromSpec()`` function. A shorthand will allow direct registration to a ufunc using @@ -737,6 +747,13 @@ 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: +* ``-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. @@ -784,7 +801,7 @@ The ``Context`` can also hold potentially useful information such as the the original ``ufunc``, which can be helpful when reporting errors. In principle passing in Context is not necessary, as all information could be -included in ``userdata`` and set up in the ``get_loop`` function. +included in ``innerloop_data`` and set up in the ``get_loop`` function. In this NEP we propose passing the struct to simplify creation of loops for parametric DTypes. @@ -798,10 +815,10 @@ provides a simple solution, which is already used in NumPy and public API. ``NpyAyxData *`` is a light weight, allocated structure and since it already 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 *userdata = 0`` instead when ``userdata`` is not provided. +``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 ``userdata`` before exposing it as public API.* +experience with ``innerloop_data`` before exposing it as public API.* **Return value:** @@ -821,7 +838,7 @@ locking the GIL. In this case the function will have to lock the GIL, set the Python error and return ``-1`` to indicate an error occurred::: int - inner_loop(PyArrayMethod_Context *context, ..., void *userdata) + inner_loop(PyArrayMethod_Context *context, ..., void *innerloop_data) { NPY_ALLOW_C_API_DEF @@ -864,13 +881,13 @@ solution and more complex solution may be possible future extensions. Handling *warnings* is slightly more complex: A warning should be given exactly once for each function call (i.e. for the whole array) even if naively it would be given many times. -To simplify such a use case, we will pass in ``npy_intp *userdata = 0`` +To simplify such a use case, we will pass in ``npy_intp *innerloop_data = 0`` by default which can be used to store flags (or other simple persistent data). For instance, we could imagine an integer multiplication loop which warns when an overflow occurred:: int - integer_multiply(PyArrayMethod_Context *context, ..., npy_intp *userdata) + integer_multiply(PyArrayMethod_Context *context, ..., npy_intp *innerloop_data) { int overflow; NPY_ALLOW_C_API_DEF @@ -878,20 +895,20 @@ when an overflow occurred:: for (npy_intp i = 0; i < N; i++) { *out = multiply_integers(*in1, *in2, &overflow); - if (overflow && !*userdata) { + if (overflow && !*innerloop_data) { NPY_ALLOW_C_API; if (PyErr_Warn(PyExc_UserWarning, "Integer overflow detected.") < 0) { NPY_DISABLE_C_API return -1; } - *userdata = 1; + *innerloop_data = 1; NPY_DISABLE_C_API } return 0; } -*TODO:* The idea of passing an ``npy_intp`` scratch space when ``userdata`` +*TODO:* The idea of passing an ``npy_intp`` scratch space when ``innerloop_data`` is not set seems convenient, but I am uncertain about it, since I am not aware of any similar prior art. This "scratch space" could also be part of the ``context`` in principle. diff --git a/doc/release/upcoming_changes/13516.improvement.rst b/doc/release/upcoming_changes/13516.improvement.rst deleted file mode 100644 index 1b32b61d7..000000000 --- a/doc/release/upcoming_changes/13516.improvement.rst +++ /dev/null @@ -1,47 +0,0 @@ -Enable multi-platform SIMD compiler optimizations -------------------------------------------------- - -A series of improvements for NumPy infrastructure to pave the way to -**NEP-38**, that can be summarized as follow: - -- **New Build Arguments** : - - - ``--cpu-baseline`` to specify the minimal set of required - optimizations, default value is ``min`` which provides the minimum - CPU features that can safely run on a wide range of users - platforms. - - - ``--cpu-dispatch`` to specify the dispatched set of additional - optimizations, default value is ``max -xop -fma4`` which enables - all CPU features, except for AMD legacy features. - - - ``--disable-optimization`` to explicitly disable the whole new - improvements, It also adds a new **C** compiler #definition - called ``NPY_DISABLE_OPTIMIZATION`` which it can be used as - guard for any SIMD code. - -- **Advanced CPU dispatcher**: A flexible cross-architecture CPU dispatcher built - on the top of Python/Numpy distutils, support all common compilers with a wide range of CPU features. - - The new dispatcher requires a special file extension ``*.dispatch.c`` to mark the dispatch-able - **C** sources. These sources have the ability to be compiled multiple times so that each compilation process - represents certain CPU features and provides different #definitions and flags that affect the code paths. - -- **New auto-generated C header ``core/src/common/_cpu_dispatch.h``** - This header is generated by the distutils module 'ccompiler_opt', and contains all the #definitions - and headers of instruction sets, that had been configured through command arguments '--cpu-baseline' and '--cpu-dispatch'. - -- **New C header ``core/src/common/npy_cpu_dispatch.h``** - - This header contains all utilities that required for the whole CPU dispatching process, - it also can be considered as a bridge linking the new infrastructure work with NumPy CPU runtime detection. - -- **Add new attributes to NumPy umath module(Python level)** - - - ``__cpu_baseline__`` a list contains the minimal set of required optimizations that supported - by the compiler and platform according to the specified values to command argument '--cpu-baseline'. - - - ``__cpu_dispatch__`` a list contains the dispatched set of additional optimizations that supported by the compiler - and platform according to the specified values to command argument '--cpu-dispatch'. - -- **Print the supported CPU features during the run of PytestTester** diff --git a/doc/release/upcoming_changes/14882.deprecation.rst b/doc/release/upcoming_changes/14882.deprecation.rst deleted file mode 100644 index db3b39d4c..000000000 --- a/doc/release/upcoming_changes/14882.deprecation.rst +++ /dev/null @@ -1,30 +0,0 @@ -Using the aliases of builtin types like ``np.int`` is deprecated ----------------------------------------------------------------- - -For a long time, ``np.int`` has been an alias of the builtin ``int``. This is -repeatedly a cause of confusion for newcomers, and is also simply not useful. - -These aliases have been deprecated. The table below shows the full list of -deprecated aliases, along with their exact meaning. Replacing uses of items in -the first column with the contents of the second column will work identically -and silence the deprecation warning. - -In many cases, it may have been intended to use the types from the third column. -Be aware that use of these types may result in subtle but desirable behavior -changes. - -================== ================================= ================================================================== -Deprecated name Identical to Possibly intended numpy type -================== ================================= ================================================================== -``numpy.bool`` ``bool`` `numpy.bool_` -``numpy.int`` ``int`` `numpy.int_` (default int dtype), `numpy.cint` (C ``int``) -``numpy.float`` ``float`` `numpy.float_`, `numpy.double` (equivalent) -``numpy.complex`` ``complex`` `numpy.complex_`, `numpy.cdouble` (equivalent) -``numpy.object`` ``object`` `numpy.object_` -``numpy.str`` ``str`` `numpy.str_` -``numpy.long`` ``int`` (``long`` on Python 2) `numpy.int_` (C ``long``), `numpy.longlong` (largest integer type) -``numpy.unicode`` ``str`` (``unicode`` on Python 2) `numpy.unicode_` -================== ================================= ================================================================== - -Note that for technical reasons these deprecation warnings will only be emitted -on Python 3.7 and above. diff --git a/doc/release/upcoming_changes/15666.improvement.rst b/doc/release/upcoming_changes/15666.improvement.rst deleted file mode 100644 index c42d70952..000000000 --- a/doc/release/upcoming_changes/15666.improvement.rst +++ /dev/null @@ -1,8 +0,0 @@ -Improved string representation for polynomials (__str__) --------------------------------------------------------- - -The string representation (``__str__``) of all six polynomial types in -`numpy.polynomial` has been updated to give the polynomial as a mathematical -expression instead of an array of coefficients. Two package-wide formats for -the polynomial expressions are available - one using Unicode characters for -superscripts and subscripts, and another using only ASCII characters. diff --git a/doc/release/upcoming_changes/15759.improvement.rst b/doc/release/upcoming_changes/15759.improvement.rst deleted file mode 100644 index 0a1b255f7..000000000 --- a/doc/release/upcoming_changes/15759.improvement.rst +++ /dev/null @@ -1,4 +0,0 @@ -Remove the Accelerate library as a candidate LAPACK library ------------------------------------------------------------ -Apple no longer supports Accelerate. Remove it. - diff --git a/doc/release/upcoming_changes/15886.deprecation.rst b/doc/release/upcoming_changes/15886.deprecation.rst deleted file mode 100644 index 050817e66..000000000 --- a/doc/release/upcoming_changes/15886.deprecation.rst +++ /dev/null @@ -1,7 +0,0 @@ -Passing ``shape=None`` to functions with a non-optional shape argument is deprecated ------------------------------------------------------------------------------------- -Previously, this was an alias for passing ``shape=()``. -This deprecation is emitted by `PyArray_IntpConverter` in the C API. If your -API is intended to support passing `None`, then you should check for `None` -prior to invoking the converter, so as to be able to distinguish `None` and -``()``. diff --git a/doc/release/upcoming_changes/15900.deprecation.rst b/doc/release/upcoming_changes/15900.deprecation.rst deleted file mode 100644 index 22be711d0..000000000 --- a/doc/release/upcoming_changes/15900.deprecation.rst +++ /dev/null @@ -1,16 +0,0 @@ -Indexing errors will be reported even when index result is empty ----------------------------------------------------------------- -In the future, NumPy will raise an IndexError when an -integer array index contains out of bound values even if a non-indexed -dimension is of length 0. This will now emit a DeprecationWarning. -This can happen when the array is previously empty, or an empty -slice is involved:: - - arr1 = np.zeros((5, 0)) - arr1[[20]] - arr2 = np.zeros((5, 5)) - arr2[[20], :0] - -Previously the non-empty index ``[20]`` was not checked for correctness. -It will now be checked causing a deprecation warning which will be turned -into an error. This also applies to assignments. diff --git a/doc/release/upcoming_changes/15997.improvement.rst b/doc/release/upcoming_changes/15997.improvement.rst deleted file mode 100644 index 9b5feacb8..000000000 --- a/doc/release/upcoming_changes/15997.improvement.rst +++ /dev/null @@ -1,12 +0,0 @@ -Object arrays containing multi-line objects have a more readable ``repr`` -------------------------------------------------------------------------- -If elements of an object array have a ``repr`` containing new lines, then the -wrapped lines will be aligned by column. Notably, this improves the ``repr`` of -nested arrays:: - - >>> np.array([np.eye(2), np.eye(3)], dtype=object) - array([array([[1., 0.], - [0., 1.]]), - array([[1., 0., 0.], - [0., 1., 0.], - [0., 0., 1.]])], dtype=object) diff --git a/doc/release/upcoming_changes/16056.deprecation.rst b/doc/release/upcoming_changes/16056.deprecation.rst deleted file mode 100644 index 788b8c30a..000000000 --- a/doc/release/upcoming_changes/16056.deprecation.rst +++ /dev/null @@ -1,13 +0,0 @@ -Inexact matches for mode and searchside are deprecated ------------------------------------------------------- -Inexact and case insensitive matches for mode and searchside were -valid inputs earlier and will give a DeprecationWarning now. -For example, below are some example usages which are now deprecated and will -give a DeprecationWarning. - - import numpy as np - arr = np.array([[3, 6, 6], [4, 5, 1]]) - # mode: inexact match - np.ravel_multi_index(arr, (7, 6), mode="clap") # should be "clip" - # searchside: inexact match - np.searchsorted(arr[0], 4, side='random') # should be "right" diff --git a/doc/release/upcoming_changes/16134.compatibility.rst b/doc/release/upcoming_changes/16134.compatibility.rst deleted file mode 100644 index 373cecec0..000000000 --- a/doc/release/upcoming_changes/16134.compatibility.rst +++ /dev/null @@ -1,8 +0,0 @@ -Same kind casting in concatenate with ``axis=None`` ---------------------------------------------------- -When `~numpy.concatenate` is called with `axis=None`, -the flattened arrays were cast with ``unsafe``. Any other axis -choice uses "same kind". That different default -has been deprecated and "same kind" casting will be used -instead. The new ``casting`` keyword argument -can be used to retain the old behaviour. diff --git a/doc/release/upcoming_changes/16134.improvement.rst b/doc/release/upcoming_changes/16134.improvement.rst deleted file mode 100644 index 0699f44bd..000000000 --- a/doc/release/upcoming_changes/16134.improvement.rst +++ /dev/null @@ -1,6 +0,0 @@ -Concatenate supports providing an output dtype ----------------------------------------------- -Support was added to `~numpy.concatenate` to provide -an output ``dtype`` and ``casting`` using keyword -arguments. The ``dtype`` argument cannot be provided -in conjunction with the ``out`` one. diff --git a/doc/release/upcoming_changes/16156.deprecation.rst b/doc/release/upcoming_changes/16156.deprecation.rst deleted file mode 100644 index 153cc4428..000000000 --- a/doc/release/upcoming_changes/16156.deprecation.rst +++ /dev/null @@ -1,5 +0,0 @@ -Deprecation of `numpy.dual` ---------------------------- -The module `numpy.dual` is deprecated. Instead of importing functions -from `numpy.dual`, the functions should be imported directly from NumPy -or SciPy. diff --git a/doc/release/upcoming_changes/16200.compatibility.rst b/doc/release/upcoming_changes/16200.compatibility.rst deleted file mode 100644 index 2bbdd883e..000000000 --- a/doc/release/upcoming_changes/16200.compatibility.rst +++ /dev/null @@ -1,76 +0,0 @@ -NumPy Scalars are cast when assigned to arrays ----------------------------------------------- - -When creating or assigning to arrays, in all relevant cases NumPy -scalars will now be cast identically to NumPy arrays. In particular -this changes the behaviour in some cases which previously raised an -error:: - - np.array([np.float64(np.nan)], dtype=np.int64) - -will succeed and return an undefined result (usually the smallest possible -integer). This also affects assignments:: - - arr[0] = np.float64(np.nan) - -At this time, NumPy retains the behaviour for:: - - np.array(np.float64(np.nan), dtype=np.int64) - -The above changes do not affect Python scalars: - - np.array([float("NaN")], dtype=np.int64) - -remains unaffected (``np.nan`` is a Python ``float``, not a NumPy one). -Unlike signed integers, unsigned integers do not retain this special case, -since they always behaved more like casting. -The following code stops raising an error:: - - np.array([np.float64(np.nan)], dtype=np.uint64) - -To avoid backward compatibility issues, at this time assignment from -``datetime64`` scalar to strings of too short length remains supported. -This means that ``np.asarray(np.datetime64("2020-10-10"), dtype="S5")`` -succeeds now, when it failed before. In the long term this may be -deprecated or the unsafe cast may be allowed generally to make assignment -of arrays and scalars behave consistently. - - -Array coercion changes when Strings and other types are mixed -------------------------------------------------------------- - -When stringss and other types are mixed, such as:: - - np.array(["string", np.float64(3.)], dtype="S") - -The results will change, which may lead to string dtypes with longer strings -in some cases. In particularly, if ``dtype="S"`` is not provided any numerical -value will lead to a string results long enough to hold all possible numerical -values. (e.g. "S32" for floats). Note that you should always provide -``dtype="S"`` when converting non-strings to strings. - -If ``dtype="S"`` is provided the results will be largely identical to before, -but NumPy scalars (not a Python float like ``1.0``), will still enforce -a uniform string length:: - - np.array([np.float64(3.)], dtype="S") # gives "S32" - np.array([3.0], dtype="S") # gives "S3" - -while previously the first version gave the same result as the second. - - -Array coercion restructure --------------------------- - -Array coercion has been restructured. In general, this should not affect -users. In extremely rare corner cases where array-likes are nested:: - - np.array([array_like1]) - -things will now be more consistent with:: - - np.array([np.array(array_like1)]) - -which could potentially change output subtly for badly defined array-likes. -We are not aware of any such case where the results were not clearly -incorrect previously. diff --git a/doc/release/upcoming_changes/16232.deprecation.rst b/doc/release/upcoming_changes/16232.deprecation.rst deleted file mode 100644 index d1ac7f044..000000000 --- a/doc/release/upcoming_changes/16232.deprecation.rst +++ /dev/null @@ -1,6 +0,0 @@ -``outer`` and ``ufunc.outer`` deprecated for matrix ---------------------------------------------------- -``np.matrix`` use with `~numpy.outer` or generic ufunc outer -calls such as ``numpy.add.outer``. Previously, matrix was -converted to an array here. This will not be done in the future -requiring a manual conversion to arrays. diff --git a/doc/release/upcoming_changes/16350.compatibility.rst b/doc/release/upcoming_changes/16350.compatibility.rst deleted file mode 100644 index 67673a6b1..000000000 --- a/doc/release/upcoming_changes/16350.compatibility.rst +++ /dev/null @@ -1,8 +0,0 @@ -Writing to the result of `numpy.broadcast_arrays` will export readonly buffers ------------------------------------------------------------------------------- - -In NumPy 1.17 `numpy.broadcast_arrays` started warning when the resulting array -was written to. This warning was skipped when the array was used through the -buffer interface (e.g. ``memoryview(arr)``). The same thing will now occur for the -two protocols ``__array_interface__``, and ``__array_struct__`` returning read-only -buffers instead of giving a warning.
\ No newline at end of file diff --git a/doc/release/upcoming_changes/16476.new_feature.rst b/doc/release/upcoming_changes/16476.new_feature.rst deleted file mode 100644 index acfe0bd72..000000000 --- a/doc/release/upcoming_changes/16476.new_feature.rst +++ /dev/null @@ -1,9 +0,0 @@ -``norm=backward``, ``forward`` keyword options for ``numpy.fft`` functions --------------------------------------------------------------------------- -The keyword argument option ``norm=backward`` is added as an alias for ``None`` -and acts as the default option; using it has the direct transforms unscaled -and the inverse transforms scaled by ``1/n``. - -Using the new keyword argument option ``norm=forward`` has the direct -transforms scaled by ``1/n`` and the inverse transforms unscaled (i.e. exactly -opposite to the default option ``norm=backward``). diff --git a/doc/release/upcoming_changes/16515.new_feature.rst b/doc/release/upcoming_changes/16515.new_feature.rst deleted file mode 100644 index 5b3803429..000000000 --- a/doc/release/upcoming_changes/16515.new_feature.rst +++ /dev/null @@ -1,8 +0,0 @@ -NumPy is now typed ------------------- -Type annotations have been added for large parts of NumPy. There is -also a new `numpy.typing` module that contains useful types for -end-users. The currently available types are - -- ``ArrayLike``: for objects that can be coerced to an array -- ``DtypeLike``: for objects that can be coerced to a dtype diff --git a/doc/release/upcoming_changes/16519.improvement.rst b/doc/release/upcoming_changes/16519.improvement.rst deleted file mode 100644 index 50c4305e5..000000000 --- a/doc/release/upcoming_changes/16519.improvement.rst +++ /dev/null @@ -1,4 +0,0 @@ -Thread-safe f2py callback functions ------------------------------------ - -Callback functions in f2py are now threadsafe. diff --git a/doc/release/upcoming_changes/16554.compatibility.rst b/doc/release/upcoming_changes/16554.compatibility.rst deleted file mode 100644 index a9f3f07e0..000000000 --- a/doc/release/upcoming_changes/16554.compatibility.rst +++ /dev/null @@ -1,10 +0,0 @@ -Numeric-style type names have been removed from type dictionaries ------------------------------------------------------------------ - -To stay in sync with the deprecation for ``np.dtype("Complex64")`` -and other numeric-style (capital case) types. These were removed -from ``np.sctypeDict`` and ``np.typeDict``. You should use -the lower case versions instead. Note that ``"Complex64"`` -corresponds to ``"complex128"`` and ``"Complex32"`` corresponds -to ``"complex64"``. The numpy style (new) versions, denote the full -size and not the size of the real/imaginary part. diff --git a/doc/release/upcoming_changes/16554.deprecation.rst b/doc/release/upcoming_changes/16554.deprecation.rst deleted file mode 100644 index 5602d2d53..000000000 --- a/doc/release/upcoming_changes/16554.deprecation.rst +++ /dev/null @@ -1,8 +0,0 @@ -Further Numeric Style types Deprecated --------------------------------------- - -The remaining numeric-style type codes ``Bytes0``, ``Str0``, -``Uint32``, ``Uint64``, and ``Datetime64`` -have been deprecated. The lower-case variants should be used -instead. For bytes and string ``"S"`` and ``"U"`` -are further alternatives. diff --git a/doc/release/upcoming_changes/16554.expired.rst b/doc/release/upcoming_changes/16554.expired.rst deleted file mode 100644 index 9b5718f8a..000000000 --- a/doc/release/upcoming_changes/16554.expired.rst +++ /dev/null @@ -1,5 +0,0 @@ -* The deprecation of numeric style type-codes ``np.dtype("Complex64")`` - (with upper case spelling), is expired. ``"Complex64"`` corresponded to - ``"complex128"`` and ``"Complex32"`` corresponded to ``"complex64"``. -* The deprecation of ``np.sctypeNA`` and ``np.typeNA`` is expired. Both - have been removed from the public API. Use ``np.typeDict`` instead. diff --git a/doc/release/upcoming_changes/16558.new_feature.rst b/doc/release/upcoming_changes/16558.new_feature.rst deleted file mode 100644 index 9bd508e83..000000000 --- a/doc/release/upcoming_changes/16558.new_feature.rst +++ /dev/null @@ -1,9 +0,0 @@ -``numpy.typing`` is accessible at runtime ------------------------------------------ -The types in ``numpy.typing`` can now be imported at runtime. Code -like the following will now work: - -.. code:: python - - from numpy.typing import ArrayLike - x: ArrayLike = [1, 2, 3, 4] diff --git a/doc/release/upcoming_changes/16589.compatibility.rst b/doc/release/upcoming_changes/16589.compatibility.rst deleted file mode 100644 index d65fb43f6..000000000 --- a/doc/release/upcoming_changes/16589.compatibility.rst +++ /dev/null @@ -1,8 +0,0 @@ -``nickname`` attribute removed from ABCPolyBase ------------------------------------------------ - -An abstract property ``nickname`` has been removed from ``ABCPolyBase`` as it -was no longer used in the derived convenience classes. -This may affect users who have derived classes from ``ABCPolyBase`` and -overridden the methods for representation and display, e.g. ``__str__``, -``__repr__``, ``_repr_latex``, etc. diff --git a/doc/release/upcoming_changes/16592.compatibility.rst b/doc/release/upcoming_changes/16592.compatibility.rst deleted file mode 100644 index 289e768fc..000000000 --- a/doc/release/upcoming_changes/16592.compatibility.rst +++ /dev/null @@ -1,13 +0,0 @@ -float->timedelta and uint64->timedelta promotion will raise a TypeError ------------------------------------------------------------------------ -Float and timedelta promotion consistently raises a TypeError. -``np.promote_types("float32", "m8")`` aligns with -``np.promote_types("m8", "float32")`` now and both raise a TypeError. -Previously, ``np.promote_types("float32", "m8")`` returned ``"m8"`` which -was considered a bug. - -Uint64 and timedelta promotion consistently raises a TypeError. -``np.promote_types("uint64", "m8")`` aligns with -``np.promote_types("m8", "uint64")`` now and both raise a TypeError. -Previously, ``np.promote_types("uint64", "m8")`` returned ``"m8"`` which -was considered a bug. diff --git a/doc/release/upcoming_changes/16650.compatibility.rst b/doc/release/upcoming_changes/16650.compatibility.rst deleted file mode 100644 index 653232355..000000000 --- a/doc/release/upcoming_changes/16650.compatibility.rst +++ /dev/null @@ -1,16 +0,0 @@ -`numpy.genfromtxt` now correctly unpacks structured arrays ----------------------------------------------------------- -Previously, `numpy.genfromtxt` failed to unpack if it was called with -``unpack=True`` and a structured datatype was passed to the ``dtype`` argument -(or ``dtype=None`` was passed and a structured datatype was inferred). -For example:: - - >>> data = StringIO("21 58.0\n35 72.0") - >>> np.genfromtxt(data, dtype=None, unpack=True) - array([(21, 58.), (35, 72.)], dtype=[('f0', '<i8'), ('f1', '<f8')]) - -Structured arrays will now correctly unpack into a list of arrays, -one for each column:: - - >>> np.genfromtxt(data, dtype=None, unpack=True) - [array([21, 35]), array([58., 72.])] diff --git a/doc/release/upcoming_changes/16675.improvement.rst b/doc/release/upcoming_changes/16675.improvement.rst deleted file mode 100644 index bc70d7e0f..000000000 --- a/doc/release/upcoming_changes/16675.improvement.rst +++ /dev/null @@ -1,4 +0,0 @@ -`numpy.core.records.fromfile` now supports file-like objects ------------------------------------------------------------- -`numpy.rec.fromfile` can now use file-like objects, for instance -:py:class:`io.BytesIO` diff --git a/doc/release/upcoming_changes/16730.improvement.rst b/doc/release/upcoming_changes/16730.improvement.rst deleted file mode 100644 index 44ec03caf..000000000 --- a/doc/release/upcoming_changes/16730.improvement.rst +++ /dev/null @@ -1,9 +0,0 @@ -Use f90 compiler specified in command line args --------------------------------------------------------- - -The compiler command selection for Fortran Portland Group Compiler is changed in `numpy.distutils.fcompiler`. -This only affects the linking command. -This forces the use of the executable provided by the command line option (if provided) -instead of the pgfortran executable. -If no executable is provided to the command line option it defaults to the pgf90 executable, -wich is an alias for pgfortran according to the PGI documentation. diff --git a/doc/release/upcoming_changes/16815.compatibility.rst b/doc/release/upcoming_changes/16815.compatibility.rst deleted file mode 100644 index 4089b16d1..000000000 --- a/doc/release/upcoming_changes/16815.compatibility.rst +++ /dev/null @@ -1,8 +0,0 @@ -`mgrid`, `r_`, etc. fixed to consistently return correct outputs for non-default precision inputs -------------------------------------------------------------------------------------------------- -Previously, ``np.mgrid[np.float32(0.1):np.float32(0.35):np.float32(0.1),]`` -and ``np.r_[0:10:np.complex64(3j)]`` failed to return meaningful output. -This bug potentially affects `mgrid`, `ogrid`, `r_`, and `c_` when an -input with dtype other than the default `float64` and `complex128` -and equivalent Python types were used. -The methods have been fixed to handle varying precision correctly. diff --git a/doc/release/upcoming_changes/16841.change.rst b/doc/release/upcoming_changes/16841.change.rst deleted file mode 100644 index d9499b6f4..000000000 --- a/doc/release/upcoming_changes/16841.change.rst +++ /dev/null @@ -1,19 +0,0 @@ -`np.linspace` on integers now use floor ---------------------------------------- -When using a `int` dtype in `numpy.linspace`, previously float values would -be rounded towards zero. Now `numpy.floor` is used instead, which rounds toward -``-inf``. This changes the results for negative values. For example, the -following would previously give:: - - >>> np.linspace(-3, 1, 8, dtype=int) - array([-3, -2, -1, -1, 0, 0, 0, 1]) - -and now results in:: - - >>> np.linspace(-3, 1, 8, dtype=int) - array([-3, -3, -2, -2, -1, -1, 0, 1]) - -The former result can still be obtained with:: - - >>> np.linspace(-3, 1, 8).astype(int) - array([-3, -2, -1, -1, 0, 0, 0, 1]) diff --git a/doc/release/upcoming_changes/16986.improvement.rst b/doc/release/upcoming_changes/16986.improvement.rst deleted file mode 100644 index 391322d9d..000000000 --- a/doc/release/upcoming_changes/16986.improvement.rst +++ /dev/null @@ -1,7 +0,0 @@ -Add NumPy declarations for Cython 3.0 and later ------------------------------------------------ - -The pxd declarations for Cython 3.0 were improved to avoid using deprecated -NumPy C-API features. Extension modules built with Cython 3.0+ that use NumPy -can now set the C macro ``NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION`` to avoid -C compiler warnings about deprecated API usage. diff --git a/doc/release/upcoming_changes/17010.compatibility.rst b/doc/release/upcoming_changes/17010.compatibility.rst deleted file mode 100644 index 72ca0a963..000000000 --- a/doc/release/upcoming_changes/17010.compatibility.rst +++ /dev/null @@ -1,24 +0,0 @@ -Boolean array indices with mismatching shapes now properly give ``IndexError`` ------------------------------------------------------------------------------- - -Previously, if a boolean array index matched the size of the indexed array but -not the shape, it was incorrectly allowed in some cases. In other cases, it -gave an error, but the error was incorrectly a ``ValueError`` with a message -about broadcasting instead of the correct ``IndexError``. - -For example, the following used to incorrectly give ``ValueError: operands -could not be broadcast together with shapes (2,2) (1,4)``: - -.. code:: python - - np.empty((2, 2))[np.array([[True, False, False, False]])] - -And the following used to incorrectly return ``array([], dtype=float64)``: - -.. code:: python - - np.empty((2, 2))[np.array([[False, False, False, False]])] - -Both now correctly give ``IndexError: boolean index did not match indexed -array along dimension 0; dimension is 2 but corresponding boolean dimension is -1``. diff --git a/doc/release/upcoming_changes/17029.compatibility.rst b/doc/release/upcoming_changes/17029.compatibility.rst deleted file mode 100644 index 69069ce18..000000000 --- a/doc/release/upcoming_changes/17029.compatibility.rst +++ /dev/null @@ -1,14 +0,0 @@ -Casting errors interrupt Iteration ----------------------------------- -When iterating while casting values, an error may stop the iteration -earlier than before. In any case, a failed casting operation always -returned undefined, partial results. Those may now be even more -undefined and partial. -For users of the ``NpyIter`` C-API such cast errors will now -cause the `iternext()` function to return 0 and thus abort -iteration. -Currently, there is no API to detect such an error directly. -It is necessary to check ``PyErr_Occurred()``, which -may be problematic in combination with ``NpyIter_Reset``. -These issues always existed, but new API could be added -if required by users. diff --git a/doc/release/upcoming_changes/17067.expired.rst b/doc/release/upcoming_changes/17067.expired.rst deleted file mode 100644 index a1065d2c3..000000000 --- a/doc/release/upcoming_changes/17067.expired.rst +++ /dev/null @@ -1,8 +0,0 @@ -Financial functions removed ---------------------------- -In accordance with NEP 32, the financial functions are removed -from NumPy 1.20. The functions that have been removed are ``fv``, -``ipmt``, ``irr``, ``mirr``, ``nper``, ``npv``, ``pmt``, ``ppmt``, -``pv``, and ``rate``. These functions are available in the -`numpy_financial <https://pypi.org/project/numpy-financial>`_ -library. diff --git a/doc/release/upcoming_changes/17068.compatibility.rst b/doc/release/upcoming_changes/17068.compatibility.rst deleted file mode 100644 index 7aa4e58ae..000000000 --- a/doc/release/upcoming_changes/17068.compatibility.rst +++ /dev/null @@ -1,4 +0,0 @@ -f2py generated code may return unicode instead of byte strings --------------------------------------------------------------- -Some byte strings previously returned by f2py generated code may now be unicode -strings. This results from the ongoing Python2 -> Python3 cleanup. diff --git a/doc/release/upcoming_changes/17116.expired.rst b/doc/release/upcoming_changes/17116.expired.rst deleted file mode 100644 index d8a3a43d5..000000000 --- a/doc/release/upcoming_changes/17116.expired.rst +++ /dev/null @@ -1,2 +0,0 @@ -* The 14-year deprecation of ``np.ctypeslib.ctypes_load_library`` is expired. - Use :func:`~numpy.ctypeslib.load_library` instead, which is identical. diff --git a/doc/release/upcoming_changes/17219.new_feature.rst b/doc/release/upcoming_changes/17219.new_feature.rst deleted file mode 100644 index a6985ef0d..000000000 --- a/doc/release/upcoming_changes/17219.new_feature.rst +++ /dev/null @@ -1,12 +0,0 @@ -Negation of user-defined BLAS/LAPACK detection order ----------------------------------------------------- -`distutils` allows negation of libraries when determining BLAS/LAPACK -libraries. -This may be used to remove an item from the library resolution phase, i.e. -to disallow NetLIB libraries one could do:: - -.. code:: bash - - NPY_BLAS_ORDER='^blas' NPY_LAPACK_ORDER='^lapack' python setup.py build - -which will use any of the accelerated libraries instead. diff --git a/doc/release/upcoming_changes/17233.deprecation.rst b/doc/release/upcoming_changes/17233.deprecation.rst deleted file mode 100644 index 7615b85c4..000000000 --- a/doc/release/upcoming_changes/17233.deprecation.rst +++ /dev/null @@ -1,4 +0,0 @@ -The ``ndincr`` method of ``ndindex`` is deprecated --------------------------------------------------- -The documentation has warned against using this function since NumPy 1.8. -Use ``next(it)`` instead of ``it.ndincr()``. diff --git a/doc/release/upcoming_changes/17241.compatibility.rst b/doc/release/upcoming_changes/17241.compatibility.rst deleted file mode 100644 index 671f73d1e..000000000 --- a/doc/release/upcoming_changes/17241.compatibility.rst +++ /dev/null @@ -1,6 +0,0 @@ -The first element of the ``__array_interface__["data"]`` tuple must be an integer ----------------------------------------------------------------------------------- -This has been the documented interface for many years, but there was still -code that would accept a byte string representation of the pointer address. -That code has been removed, passing the address as a byte string will now -raise an error. diff --git a/doc/release/upcoming_changes/17419.deprecation.rst b/doc/release/upcoming_changes/17419.deprecation.rst deleted file mode 100644 index fcab3a8ad..000000000 --- a/doc/release/upcoming_changes/17419.deprecation.rst +++ /dev/null @@ -1,24 +0,0 @@ -Arrays cannot be using subarray dtypes --------------------------------------- -Array creation and casting using ``np.array(obj, dtype)`` -and ``arr.astype(dtype)`` will not support ``dtype`` -to be a subarray dtype such as ``np.dtype("(2)i,")``. - -For such a ``dtype`` the following behaviour occurs currently:: - - res = np.array(obj, dtype) - - res.dtype is not dtype - res.dtype is dtype.base - res.shape[-dtype.ndim:] == dtype.shape - -The shape of the dtype is included into the array. -This leads to inconsistencies when ``obj`` is: - -* a scalar, such as ``np.array(1, dtype="(2)i")`` -* an array, such as ``np.array(np.array([1]), dtype="(2)i")`` - -In most cases the work-around is to pass the output dtype directly -and possibly check ``res.shape[-dtype.ndim:] == dtype.shape``. -If this is insufficient, please open an issue on the NumPy issue -tracker. diff --git a/doc/release/upcoming_changes/17456.new_feature.rst b/doc/release/upcoming_changes/17456.new_feature.rst deleted file mode 100644 index 7ab014e77..000000000 --- a/doc/release/upcoming_changes/17456.new_feature.rst +++ /dev/null @@ -1,5 +0,0 @@ -``dtype`` option for `cov` and `corrcoef` ----------------------------------------------------- -The ``dtype`` option is now available for `numpy.cov` and `numpy.corrcoef`. -It specifies which data-type the returned result should have. -By default the functions still return a `numpy.float64` result. diff --git a/doc/release/upcoming_changes/17535.new_function.rst b/doc/release/upcoming_changes/17535.new_function.rst deleted file mode 100644 index 4c3c11de4..000000000 --- a/doc/release/upcoming_changes/17535.new_function.rst +++ /dev/null @@ -1,15 +0,0 @@ -`numpy.broadcast_shapes` is a new user-facing function ------------------------------------------------------- -`broadcast_shapes` gets the resulting shape from -broadcasting the given shape tuples against each other. - -.. code:: python - - >>> np.broadcast_shapes((1, 2), (3, 1)) - (3, 2) - - >>> np.broadcast_shapes(2, (3, 1)) - (3, 2) - - >>> np.broadcast_shapes((6, 7), (5, 6, 1), (7,), (5, 1, 7)) - (5, 6, 7) diff --git a/doc/release/upcoming_changes/17580.compatibility.rst b/doc/release/upcoming_changes/17580.compatibility.rst deleted file mode 100644 index b8e1849af..000000000 --- a/doc/release/upcoming_changes/17580.compatibility.rst +++ /dev/null @@ -1,4 +0,0 @@ -The numpy.i file for swig is Python 3 only. -------------------------------------------- -Uses of Python 2.7 C-API functions have been updated to Python 3 only. Users -who need the old version should take it from an older version of NumPy. diff --git a/doc/release/upcoming_changes/17727.performance.rst b/doc/release/upcoming_changes/17727.performance.rst new file mode 100755 index 000000000..7b447a3b2 --- /dev/null +++ b/doc/release/upcoming_changes/17727.performance.rst @@ -0,0 +1,7 @@ +Improved performance in integer division of NumPy arrays
+--------------------------------------------------------
+Integer division of NumPy arrays now uses `libdivide <https://libdivide.com/>`
+when the divisor is a constant. With the usage of libdivde and
+other minor optimizations, there is a large speedup.
+The ``//`` operator and ``np.floor_divide`` makes use
+of the new changes.
diff --git a/doc/release/upcoming_changes/17900.expired.rst b/doc/release/upcoming_changes/17900.expired.rst new file mode 100644 index 000000000..810d67241 --- /dev/null +++ b/doc/release/upcoming_changes/17900.expired.rst @@ -0,0 +1,2 @@ +* The ``shape`` argument `numpy.unravel_index` cannot be passed + as ``dims`` keyword argument anymore. (Was deprecated in NumPy 1.16.) diff --git a/doc/release/upcoming_changes/17921.compatibility.rst b/doc/release/upcoming_changes/17921.compatibility.rst new file mode 100644 index 000000000..a1e2fb2d0 --- /dev/null +++ b/doc/release/upcoming_changes/17921.compatibility.rst @@ -0,0 +1,6 @@ +Validate input values in ``Generator.uniform`` +---------------------------------------------- +Checked that ``high - low >= 0`` in ``np.random.Generator.uniform``. Raises +``ValueError`` if ``low > high``. Previously out-of-order inputs were accepted +and silently swapped, so that if ``low > high``, the value generated was +``high + (low - high) * random()``. diff --git a/doc/release/upcoming_changes/README.rst b/doc/release/upcoming_changes/README.rst index 7f6476bda..ff5ca514c 100644 --- a/doc/release/upcoming_changes/README.rst +++ b/doc/release/upcoming_changes/README.rst @@ -21,11 +21,17 @@ Each file should be named like ``<PULL REQUEST>.<TYPE>.rst``, where backwards compatible. (Not to be used for removal of deprecated features.) * ``c_api``: Changes in the Numpy C-API exported functions * ``new_feature``: New user facing features like ``kwargs``. -* ``improvement``: Performance and edge-case changes +* ``improvement``: General improvements and edge-case changes which are + not new features or compatibility related. +* ``performance``: Performance changes that should not affect other behaviour. * ``change``: Other changes * ``highlight``: Adds a highlight bullet point to use as a possibly highlight of the release. +It is possible to add two files with different categories (and text) if both +are relevant. For example a change may improve performance but have some +compatibility concerns. + Most categories should be formatted as paragraphs with a heading. So for example: ``123.new_feature.rst`` would have the content:: diff --git a/doc/source/_templates/autosummary/attribute.rst b/doc/source/_templates/autosummary/attribute.rst index a6ed600ef..9e0eaa25f 100644 --- a/doc/source/_templates/autosummary/attribute.rst +++ b/doc/source/_templates/autosummary/attribute.rst @@ -6,5 +6,8 @@ attribute -.. auto{{ objtype }}:: {{ objname }} +.. auto{{ objtype }}:: {{ fullname | replace("numpy.", "numpy::") }} +{# In the fullname (e.g. `numpy.ma.MaskedArray.methodname`), the module name +is ambiguous. Using a `::` separator (e.g. `numpy::ma.MaskedArray.methodname`) +specifies `numpy` as the module name. #} diff --git a/doc/source/_templates/autosummary/base.rst b/doc/source/_templates/autosummary/base.rst index 0331154a7..91bfff9ba 100644 --- a/doc/source/_templates/autosummary/base.rst +++ b/doc/source/_templates/autosummary/base.rst @@ -10,5 +10,8 @@ property {% endif %} -.. auto{{ objtype }}:: {{ objname }} +.. auto{{ objtype }}:: {{ fullname | replace("numpy.", "numpy::") }} +{# In the fullname (e.g. `numpy.ma.MaskedArray.methodname`), the module name +is ambiguous. Using a `::` separator (e.g. `numpy::ma.MaskedArray.methodname`) +specifies `numpy` as the module name. #} diff --git a/doc/source/_templates/autosummary/member.rst b/doc/source/_templates/autosummary/member.rst index f1f30e123..c0dcd5ed2 100644 --- a/doc/source/_templates/autosummary/member.rst +++ b/doc/source/_templates/autosummary/member.rst @@ -6,6 +6,8 @@ member -.. auto{{ objtype }}:: {{ objname }} - +.. auto{{ objtype }}:: {{ fullname | replace("numpy.", "numpy::") }} +{# In the fullname (e.g. `numpy.ma.MaskedArray.methodname`), the module name +is ambiguous. Using a `::` separator (e.g. `numpy::ma.MaskedArray.methodname`) +specifies `numpy` as the module name. #} diff --git a/doc/source/_templates/autosummary/method.rst b/doc/source/_templates/autosummary/method.rst index 8abda8677..0dd226393 100644 --- a/doc/source/_templates/autosummary/method.rst +++ b/doc/source/_templates/autosummary/method.rst @@ -6,5 +6,8 @@ method -.. auto{{ objtype }}:: {{ objname }} +.. auto{{ objtype }}:: {{ fullname | replace("numpy.", "numpy::") }} +{# In the fullname (e.g. `numpy.ma.MaskedArray.methodname`), the module name +is ambiguous. Using a `::` separator (e.g. `numpy::ma.MaskedArray.methodname`) +specifies `numpy` as the module name. #} diff --git a/doc/source/dev/development_advanced_debugging.rst b/doc/source/dev/development_advanced_debugging.rst new file mode 100644 index 000000000..fa4014fdb --- /dev/null +++ b/doc/source/dev/development_advanced_debugging.rst @@ -0,0 +1,190 @@ +======================== +Advanced debugging tools +======================== + +If you reached here, you want to dive into, or use, more advanced tooling. +This is usually not necessary for first time contributers and most +day-to-day developement. +These are used more rarely, for example close to a new NumPy release, +or when a large or particular complex change was made. + +Since not all of these tools are used on a regular bases and only available +on some systems, please expect differences, issues, or quirks; +we will be happy to help if you get stuck and appreciate any improvements +or suggestions to these workflows. + + +Finding C errors with additional tooling +######################################## + +Most development will not require more than a typical debugging toolchain +as shown in :ref:`Debugging <debugging>`. +But for example memory leaks can be particularly subtle or difficult to +narrow down. + +We do not expect any of these tools to be run by most contributors. +However, you can ensure that we can track down such issues more easily easier: + +* Tests should cover all code paths, incluing error paths. +* Try to write short and simple tests. If you have a very complicated test + consider creating an additional simpler test as well. + This can be helpful, because often it is only easy to find which test + triggers an issue and not which line of the test. +* Never use ``np.empty`` if data is read/used. ``valgrind`` will notice this + and report an error. When you do not care about values, you can generate + random values instead. + +This will help us catch any oversights before your change is released +and means you do not have to worry about making reference counting errors, +which can be intimidating. + + +Python debug build for finding memory leaks +=========================================== + +Debug builds of Python are easily available for example on ``debian`` systems, +and can be used on all platforms. +Running a test or terminal is usually as easy as:: + + python3.8d runtests.py + # or + python3.8d runtests.py --ipython + +and were already mentioned in :ref:`Debugging <debugging>`. + +A Python debug build will help: + +- Find bugs which may otherwise cause random behaviour. + One example is when an object is still used after it has been deleted. + +- Python debug builds allows to check correct reference counting. + This works using the additional commands:: + + sys.gettotalrefcount() + sys.getallocatedblocks() + + +Use together with ``pytest`` +---------------------------- + +Running the test suite only with a debug python build will not find many +errors on its own. An additional advantage of a debug build of Python is that +it allows detecting memory leaks. + +A tool to make this easier is `pytest-leaks`_, which can be installed using ``pip``. +Unfortunately, ``pytest`` itself may leak memory, but good results can usually +(currently) be achieved by removing:: + + @pytest.fixture(autouse=True) + def add_np(doctest_namespace): + doctest_namespace['np'] = numpy + + @pytest.fixture(autouse=True) + def env_setup(monkeypatch): + monkeypatch.setenv('PYTHONHASHSEED', '0') + +from ``numpy/conftest.py`` (This may change with new ``pytest-leaks`` versions +or ``pytest`` updates). + +This allows to run the test suite, or part of it, conveniently:: + + python3.8d runtests.py -t numpy/core/tests/test_multiarray.py -- -R2:3 -s + +where ``-R2:3`` is the ``pytest-leaks`` command (see its documentation), the +``-s`` causes output to print and may be necessary (in some versions captured +output was detected as a leak). + +Note that some tests are known (or even designed) to leak references, we try +to mark them, but expect some false positives. + +.. _pytest-leaks: https://github.com/abalkin/pytest-leaks + +``valgrind`` +============ + +Valgrind is a powerful tool to find certain memory access problems and should +be run on complicated C code. +Basic use of ``valgrind`` usually requires no more than:: + + PYTHONMALLOC=malloc python runtests.py + +where ``PYTHONMALLOC=malloc`` is necessary to avoid false positives from python +itself. +Depending on the system and valgrind version, you may see more false positives. +``valgrind`` supports "suppressions" to ignore some of these, and Python does +have a supression file (and even a compile time option) which may help if you +find it necessary. + +Valgrind helps: + +- Find use of uninitialized variables/memory. + +- Detect memory access violations (reading or writing outside of allocated + memory). + +- Find *many* memory leaks. Note that for *most* leaks the python + debug build approach (and ``pytest-leaks``) is much more sensitive. + The reason is that ``valgrind`` can only detect if memory is definitely + lost. If:: + + dtype = np.dtype(np.int64) + arr.astype(dtype=dtype) + + Has incorrect reference counting for ``dtype``, this is a bug, but valgrind + cannot see it because ``np.dtype(np.int64)`` always returns the same object. + However, not all dtypes are singletons, so this might leak memory for + different input. + In rare cases NumPy uses ``malloc`` and not the Python memory allocators + which are invisible to the Python debug build. + ``malloc`` should normally be avoided, but there are some exceptions + (e.g. the ``PyArray_Dims`` structure is public API and cannot use the + Python allocators.) + +Even though using valgrind for memory leak detection is slow and less sensitive +it can be a convenient: you can run most programs with valgrind without +modification. + +Things to be aware of: + +- Valgrind does not support the numpy ``longdouble``, this means that tests + will fail or be flagged errors that are completely fine. + +- Expect some errors before and after running your NumPy code. + +- Caches can mean that errors (specifically memory leaks) may not be detected + or are only detect at a later, unrelated time. + +A big advantage of valgrind is that it has no requirements aside from valgrind +itself (although you probably want to use debug builds for better tracebacks). + + +Use together with ``pytest`` +---------------------------- +You can run the test suite with valgrind which may be sufficient +when you are only interested in a few tests:: + + PYTHOMMALLOC=malloc valgrind python runtests.py \ + -t numpy/core/tests/test_multiarray.py -- --continue-on-collection-errors + +Note the ``--continue-on-collection-errors``, which is currently necessary due to +missing ``longdouble`` support causing failures (this will usually not be +necessary if you do not run the full test suite). + +If you wish to detect memory leaks you will also require ``--show-leak-kinds=definite`` +and possibly more valgrind options. Just as for ``pytest-leaks`` certain +tests are known to leak cause errors in valgrind and may or may not be marked +as such. + +We have developed `pytest-valgrind`_ which: + +- Reports errors for each test individually + +- Narrows down memory leaks to individual tests (by default valgrind + only checks for memory leaks after a program stops, which is very + cumbersome). + +Please refer to its ``README`` for more information (it includes an example +command for NumPy). + +.. _pytest-valgrind: https://github.com/seberg/pytest-valgrind + diff --git a/doc/source/dev/development_environment.rst b/doc/source/dev/development_environment.rst index cb027c662..013414568 100644 --- a/doc/source/dev/development_environment.rst +++ b/doc/source/dev/development_environment.rst @@ -207,6 +207,8 @@ repo, use one of:: $ git reset --hard +.. _debugging: + Debugging --------- diff --git a/doc/source/dev/index.rst b/doc/source/dev/index.rst index 4641a7e2f..bcd144d71 100644 --- a/doc/source/dev/index.rst +++ b/doc/source/dev/index.rst @@ -12,6 +12,7 @@ Contributing to NumPy Git Basics <gitwash/index> development_environment development_workflow + development_advanced_debugging ../benchmarking NumPy C style guide <https://numpy.org/neps/nep-0045-c_style_guide.html> releasing @@ -302,6 +303,7 @@ The rest of the story Git Basics <gitwash/index> development_environment development_workflow + development_advanced_debugging reviewer_guidelines ../benchmarking NumPy C style guide <https://numpy.org/neps/nep-0045-c_style_guide.html> diff --git a/doc/source/glossary.rst b/doc/source/glossary.rst index 17071c8f1..57e3bcf92 100644 --- a/doc/source/glossary.rst +++ b/doc/source/glossary.rst @@ -502,7 +502,7 @@ Glossary Some NumPy routines always return views, some always return copies, some may return one or the other, and for some the choice can be specified. - Responsiblity for managing views and copies falls to the programmer. + Responsibility for managing views and copies falls to the programmer. :func:`numpy.shares_memory` will check whether ``b`` is a view of ``a``, but an exact answer isn't always feasible, as the documentation page explains. diff --git a/doc/source/reference/arrays.ndarray.rst b/doc/source/reference/arrays.ndarray.rst index 6b805904a..191367058 100644 --- a/doc/source/reference/arrays.ndarray.rst +++ b/doc/source/reference/arrays.ndarray.rst @@ -1,11 +1,11 @@ +.. currentmodule:: numpy + .. _arrays.ndarray: ****************************************** The N-dimensional array (:class:`ndarray`) ****************************************** -.. currentmodule:: numpy - An :class:`ndarray` is a (usually fixed-size) multidimensional container of items of the same type and size. The number of dimensions and items in an array is defined by its :attr:`shape <ndarray.shape>`, diff --git a/doc/source/reference/arrays.nditer.cython.rst b/doc/source/reference/arrays.nditer.cython.rst index 2cc7763ed..43aad9927 100644 --- a/doc/source/reference/arrays.nditer.cython.rst +++ b/doc/source/reference/arrays.nditer.cython.rst @@ -5,7 +5,7 @@ Those who want really good performance out of their low level operations should strongly consider directly using the iteration API provided in C, but for those who are not comfortable with C or C++, Cython is a good middle ground with reasonable performance tradeoffs. For -the :class:`nditer` object, this means letting the iterator take care +the :class:`~numpy.nditer` object, this means letting the iterator take care of broadcasting, dtype conversion, and buffering, while giving the inner loop to Cython. diff --git a/doc/source/reference/c-api/array.rst b/doc/source/reference/c-api/array.rst index e9717d59a..3aa541b79 100644 --- a/doc/source/reference/c-api/array.rst +++ b/doc/source/reference/c-api/array.rst @@ -2960,9 +2960,9 @@ to. already a buffer object pointing to another object). If you need to hold on to the memory be sure to INCREF the base member. The chunk of memory is pointed to by *buf* ->ptr member and has length - *buf* ->len. The flags member of *buf* is :c:data:`NPY_BEHAVED_RO` with - the :c:data:`NPY_ARRAY_WRITEABLE` flag set if *obj* has a writeable buffer - interface. + *buf* ->len. The flags member of *buf* is :c:data:`NPY_ARRAY_ALIGNED` + with the :c:data:`NPY_ARRAY_WRITEABLE` flag set if *obj* has + a writeable buffer interface. .. c:function:: int PyArray_AxisConverter(PyObject* obj, int* axis) @@ -3136,7 +3136,7 @@ the C-API is needed then some additional steps must be taken. be defined in another compilation unit. * Whenever :c:macro:`PY_ARRAY_UNIQUE_SYMBOL` is #defined, it also changes the name of the variable holding the C-API, which - defaults to :c:data:`PyArray_API`, to whatever the macro is + defaults to ``PyArray_API``, to whatever the macro is #defined to. Checking the API Version diff --git a/doc/source/reference/c-api/types-and-structures.rst b/doc/source/reference/c-api/types-and-structures.rst index 87d4be6f3..763f985a6 100644 --- a/doc/source/reference/c-api/types-and-structures.rst +++ b/doc/source/reference/c-api/types-and-structures.rst @@ -79,6 +79,8 @@ PyArray_Type and PyArrayObject of :c:type:`NPY_AO` (deprecated) which is defined to be equivalent to :c:type:`PyArrayObject`. Direct access to the struct fields are deprecated. Use the ``PyArray_*(arr)`` form instead. + As of NumPy 1.20, the size of this struct is not considered part of + the NumPy ABI (see note at the end of the member list). .. code-block:: c @@ -92,6 +94,7 @@ PyArray_Type and PyArrayObject PyArray_Descr *descr; int flags; PyObject *weakreflist; + /* version dependend private members */ } PyArrayObject; .. c:macro:: PyObject_HEAD @@ -173,6 +176,27 @@ PyArray_Type and PyArrayObject This member allows array objects to have weak references (using the weakref module). + .. note:: + + Further members are considered private and version dependend. If the size + of the struct is important for your code, special care must be taken. + A possible use-case when this is relevant is subclassing in C. + If your code relies on ``sizeof(PyArrayObject)`` to be constant, + you must add the following check at import time: + + .. code-block:: c + + if (sizeof(PyArrayObject) < PyArray_Type.tp_basicsize) { + PyErr_SetString(PyExc_ImportError, + "Binary incompatibility with NumPy, must recompile/update X."); + return NULL; + } + + To ensure that your code does not have to be compiled for a specific + NumPy version, you may add a constant, leaving room for changes in NumPy. + A solution guaranteed to be compatible with any future NumPy version + requires the use of a runtime calculate offset and allocation size. + PyArrayDescr_Type and PyArray_Descr ----------------------------------- @@ -412,7 +436,8 @@ PyArrayDescr_Type and PyArray_Descr Metadata specific to the C implementation of the particular dtype. Added for NumPy 1.7.0. - .. c:member:: Npy_hash_t *hash + .. c:type:: npy_hash_t + .. c:member:: npy_hash_t *hash Currently unused. Reserved for future use in caching hash values. diff --git a/doc/source/reference/global_state.rst b/doc/source/reference/global_state.rst index 7bf9310e8..b59467210 100644 --- a/doc/source/reference/global_state.rst +++ b/doc/source/reference/global_state.rst @@ -83,3 +83,18 @@ in C which iterates through arrays that may or may not be contiguous in memory. Most users will have no reason to change these; for details see the :ref:`memory layout <memory-layout>` documentation. + +Using the new casting implementation +------------------------------------ + +Within NumPy 1.20 it is possible to enable the new experimental casting +implementation for testing purposes. To do this set:: + + NPY_USE_NEW_CASTINGIMPL=1 + +Setting the flag is only useful to aid with NumPy developement to ensure the +new version is bug free and should be avoided for production code. +It is a helpful test for projects that either create custom datatypes or +use for example complicated structured dtypes. The flag is expected to be +removed in 1.21 with the new version being always in use. + diff --git a/doc/source/reference/maskedarray.baseclass.rst b/doc/source/reference/maskedarray.baseclass.rst index 5c1bdda23..5a0f99651 100644 --- a/doc/source/reference/maskedarray.baseclass.rst +++ b/doc/source/reference/maskedarray.baseclass.rst @@ -242,8 +242,8 @@ Comparison operators: MaskedArray.__eq__ MaskedArray.__ne__ -Truth value of an array (:func:`bool()`): -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Truth value of an array (:class:`bool() <bool>`): +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autosummary:: :toctree: generated/ diff --git a/doc/source/reference/routines.indexing.rst b/doc/source/reference/routines.indexing.rst index aeec1a1bb..eebbf4989 100644 --- a/doc/source/reference/routines.indexing.rst +++ b/doc/source/reference/routines.indexing.rst @@ -42,6 +42,7 @@ Indexing-like operations diag diagonal select + lib.stride_tricks.sliding_window_view lib.stride_tricks.as_strided Inserting data into arrays diff --git a/doc/source/reference/routines.ma.rst b/doc/source/reference/routines.ma.rst index 18248fe09..d961cbf02 100644 --- a/doc/source/reference/routines.ma.rst +++ b/doc/source/reference/routines.ma.rst @@ -67,6 +67,9 @@ Inspecting the array ma.size ma.is_masked ma.is_mask + ma.isMaskedArray + ma.isMA + ma.isarray ma.MaskedArray.all diff --git a/doc/source/reference/routines.polynomials.rst b/doc/source/reference/routines.polynomials.rst index e74c5a683..da481ae4c 100644 --- a/doc/source/reference/routines.polynomials.rst +++ b/doc/source/reference/routines.polynomials.rst @@ -9,24 +9,165 @@ of the `numpy.polynomial` package, introduced in NumPy 1.4. Prior to NumPy 1.4, `numpy.poly1d` was the class of choice and it is still available in order to maintain backward compatibility. -However, the newer Polynomial package is more complete than `numpy.poly1d` -and its convenience classes are better behaved in the numpy environment. +However, the newer `polynomial package <numpy.polynomial>` is more complete +and its `convenience classes <routines.polynomials.classes>` provide a +more consistent, better-behaved interface for working with polynomial +expressions. Therefore :mod:`numpy.polynomial` is recommended for new coding. -Transition notice ------------------ -The various routines in the Polynomial package all deal with -series whose coefficients go from degree zero upward, -which is the *reverse order* of the Poly1d convention. -The easy way to remember this is that indexes -correspond to degree, i.e., coef[i] is the coefficient of the term of -degree i. +.. note:: **Terminology** + The term *polynomial module* refers to the old API defined in + `numpy.lib.polynomial`, which includes the :class:`numpy.poly1d` class and + the polynomial functions prefixed with *poly* accessible from the `numpy` + namespace (e.g. `numpy.polyadd`, `numpy.polyval`, `numpy.polyfit`, etc.). + + The term *polynomial package* refers to the new API definied in + `numpy.polynomial`, which includes the convenience classes for the + different kinds of polynomials (`numpy.polynomial.Polynomial`, + `numpy.polynomial.Chebyshev`, etc.). + +Transitioning from `numpy.poly1d` to `numpy.polynomial` +------------------------------------------------------- + +As noted above, the :class:`poly1d class <numpy.poly1d>` and associated +functions defined in ``numpy.lib.polynomial``, such as `numpy.polyfit` +and `numpy.poly`, are considered legacy and should **not** be used in new +code. +Since NumPy version 1.4, the `numpy.polynomial` package is preferred for +working with polynomials. + +Quick Reference +~~~~~~~~~~~~~~~ + +The following table highlights some of the main differences between the +legacy polynomial module and the polynomial package for common tasks. +The `~numpy.polynomial.polynomial.Polynomial` class is imported for brevity:: + + from numpy.polynomial import Polynomial + + ++------------------------+------------------------------+---------------------------------------+ +| **How to...** | Legacy (`numpy.poly1d`) | `numpy.polynomial` | ++------------------------+------------------------------+---------------------------------------+ +| Create a | ``p = np.poly1d([1, 2, 3])`` | ``p = Polynomial([3, 2, 1])`` | +| polynomial object | | | +| from coefficients [1]_ | | | ++------------------------+------------------------------+---------------------------------------+ +| Create a polynomial | ``r = np.poly([-1, 1])`` | ``p = Polynomial.fromroots([-1, 1])`` | +| object from roots | ``p = np.poly1d(r)`` | | ++------------------------+------------------------------+---------------------------------------+ +| Fit a polynomial of | | | +| degree ``deg`` to data | ``np.polyfit(x, y, deg)`` | ``Polynomial.fit(x, y, deg)`` | ++------------------------+------------------------------+---------------------------------------+ + + +.. [1] Note the reversed ordering of the coefficients + +Transition Guide +~~~~~~~~~~~~~~~~ + +There are significant differences between ``numpy.lib.polynomial`` and +`numpy.polynomial`. +The most significant difference is the ordering of the coefficients for the +polynomial expressions. +The various routines in `numpy.polynomial` all +deal with series whose coefficients go from degree zero upward, +which is the *reverse order* of the poly1d convention. +The easy way to remember this is that indices +correspond to degree, i.e., ``coef[i]`` is the coefficient of the term of +degree *i*. + +Though the difference in convention may be confusing, it is straightforward to +convert from the legacy polynomial API to the new. +For example, the following demonstrates how you would convert a `numpy.poly1d` +instance representing the expression :math:`x^{2} + 2x + 3` to a +`~numpy.polynomial.polynomial.Polynomial` instance representing the same +expression:: + + >>> p1d = np.poly1d([1, 2, 3]) + >>> p = np.polynomial.Polynomial(p1d.coef[::-1]) + +In addition to the ``coef`` attribute, polynomials from the polynomial +package also have ``domain`` and ``window`` attributes. +These attributes are most relevant when fitting +polynomials to data, though it should be noted that polynomials with +different ``domain`` and ``window`` attributes are not considered equal, and +can't be mixed in arithmetic:: + + >>> p1 = np.polynomial.Polynomial([1, 2, 3]) + >>> p1 + Polynomial([1., 2., 3.], domain=[-1, 1], window=[-1, 1]) + >>> p2 = np.polynomial.Polynomial([1, 2, 3], domain=[-2, 2]) + >>> p1 == p2 + False + >>> p1 + p2 + Traceback (most recent call last): + ... + TypeError: Domains differ + +See the documentation for the +`convenience classes <routines.polynomials.classes>`_ for further details on +the ``domain`` and ``window`` attributes. + +Another major difference bewteen the legacy polynomial module and the +polynomial package is polynomial fitting. In the old module, fitting was +done via the `~numpy.polyfit` function. In the polynomial package, the +`~numpy.polynomial.polynomial.Polynomial.fit` class method is preferred. For +example, consider a simple linear fit to the following data: + +.. ipython:: python + + rg = np.random.default_rng() + x = np.arange(10) + y = np.arange(10) + rg.standard_normal(10) + +With the legacy polynomial module, a linear fit (i.e. polynomial of degree 1) +could be applied to these data with `~numpy.polyfit`: + +.. ipython:: python + + np.polyfit(x, y, deg=1) + +With the new polynomial API, the `~numpy.polynomial.polynomial.Polynomial.fit` +class method is preferred: + +.. ipython:: python + + p_fitted = np.polynomial.Polynomial.fit(x, y, deg=1) + p_fitted + +Note that the coefficients are given *in the scaled domain* defined by the +linear mapping between the ``window`` and ``domain``. +`~numpy.polynomial.polynomial.Polynomial.convert` can be used to get the +coefficients in the unscaled data domain. + +.. ipython:: python + + p_fitted.convert() + +Documentation for the `~numpy.polynomial` Package +------------------------------------------------- + +In addition to standard power series polynomials, the polynomial package +provides several additional kinds of polynomials including Chebyshev, +Hermite (two subtypes), Laguerre, and Legendre polynomials. +Each of these has an associated +`convenience class <routines.polynomials.classes>` available from the +`numpy.polynomial` namespace that provides a consistent interface for working +with polynomials regardless of their type. .. toctree:: :maxdepth: 1 routines.polynomials.classes + +Documentation pertaining to specific functions defined for each kind of +polynomial individually can be found in the corresponding module documentation: + +.. toctree:: + :maxdepth: 1 + routines.polynomials.polynomial routines.polynomials.chebyshev routines.polynomials.hermite @@ -36,6 +177,9 @@ degree i. routines.polynomials.polyutils +Documentation for Legacy Polynomials +------------------------------------ + .. toctree:: :maxdepth: 2 diff --git a/doc/source/release.rst b/doc/source/release.rst index 1c77755fd..29199fb83 100644 --- a/doc/source/release.rst +++ b/doc/source/release.rst @@ -5,7 +5,10 @@ Release Notes .. toctree:: :maxdepth: 3 + 1.21.0 <release/1.21.0-notes> 1.20.0 <release/1.20.0-notes> + 1.19.4 <release/1.19.4-notes> + 1.19.3 <release/1.19.3-notes> 1.19.2 <release/1.19.2-notes> 1.19.1 <release/1.19.1-notes> 1.19.0 <release/1.19.0-notes> diff --git a/doc/source/release/1.19.3-notes.rst b/doc/source/release/1.19.3-notes.rst new file mode 100644 index 000000000..f1f1fd2b3 --- /dev/null +++ b/doc/source/release/1.19.3-notes.rst @@ -0,0 +1,46 @@ +.. currentmodule:: numpy + +========================== +NumPy 1.19.3 Release Notes +========================== + +NumPy 1.19.3 is a small maintenance release with two major improvements: + +- Python 3.9 binary wheels on all supported platforms. +- OpenBLAS fixes for Windows 10 version 2004 fmod bug. + +This release supports Python 3.6-3.9 and is linked with OpenBLAS 0.3.12 to avoid +some of the fmod problems on Windows 10 version 2004. Microsoft is aware of the +problem and users should upgrade when the fix becomes available, the fix here +is limited in scope. + +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 +* Chris Brown + +* Daniel Vanzo + +* E. Madison Bray + +* Hugo van Kemenade + +* Ralf Gommers +* Sebastian Berg +* @danbeibei + + +Pull requests merged +==================== + +A total of 10 pull requests were merged for this release. + +* `#17298 <https://github.com/numpy/numpy/pull/17298>`__: BLD: set upper versions for build dependencies +* `#17336 <https://github.com/numpy/numpy/pull/17336>`__: BUG: Set deprecated fields to null in PyArray_InitArrFuncs +* `#17446 <https://github.com/numpy/numpy/pull/17446>`__: ENH: Warn on unsupported Python 3.10+ +* `#17450 <https://github.com/numpy/numpy/pull/17450>`__: MAINT: Update test_requirements.txt. +* `#17522 <https://github.com/numpy/numpy/pull/17522>`__: ENH: Support for the NVIDIA HPC SDK nvfortran compiler +* `#17568 <https://github.com/numpy/numpy/pull/17568>`__: BUG: Cygwin Workaround for #14787 on affected platforms +* `#17647 <https://github.com/numpy/numpy/pull/17647>`__: BUG: Fix memory leak of buffer-info cache due to relaxed strides +* `#17652 <https://github.com/numpy/numpy/pull/17652>`__: MAINT: Backport openblas_support from master. +* `#17653 <https://github.com/numpy/numpy/pull/17653>`__: TST: Add Python 3.9 to the CI testing on Windows, Mac. +* `#17660 <https://github.com/numpy/numpy/pull/17660>`__: TST: Simplify source path names in test_extending. diff --git a/doc/source/release/1.19.4-notes.rst b/doc/source/release/1.19.4-notes.rst new file mode 100644 index 000000000..e7c0863f4 --- /dev/null +++ b/doc/source/release/1.19.4-notes.rst @@ -0,0 +1,30 @@ +.. currentmodule:: numpy + +========================== +NumPy 1.19.4 Release Notes +========================== + +NumPy 1.19.4 is a quick release to revert the OpenBLAS library version. It was +hoped that the 0.3.12 OpenBLAS version used in 1.19.3 would work around the +Microsoft fmod bug, but problems in some docker environments turned up. Instead, +1.19.4 will use the older library and run a sanity check on import, raising an +error if the problem is detected. Microsoft is aware of the problem and has +promised a fix, users should upgrade when it becomes available. + +This release supports Python 3.6-3.9 + +Contributors +============ + +A total of 1 people contributed to this release. People with a "+" by their +names contributed a patch for the first time. + +* Charles Harris + +Pull requests merged +==================== + +A total of 2 pull requests were merged for this release. + +* `#17679 <https://github.com/numpy/numpy/pull/17679>`__: MAINT: Add check for Windows 10 version 2004 bug. +* `#17680 <https://github.com/numpy/numpy/pull/17680>`__: REV: Revert OpenBLAS to 1.19.2 version for 1.19.4 diff --git a/doc/source/release/1.20.0-notes.rst b/doc/source/release/1.20.0-notes.rst index d91bea762..9f46a3e80 100644 --- a/doc/source/release/1.20.0-notes.rst +++ b/doc/source/release/1.20.0-notes.rst @@ -3,4 +3,931 @@ ========================== NumPy 1.20.0 Release Notes ========================== +This NumPy release is the largest so made to date, some 648 PRs contributed by +182 people have been merged. See the list of highlights below for more details. +The Python versions supported for this release are 3.7-3.9, support for Python +3.6 has been dropped. Highlights are + +- Annotations for NumPy functions. This work is ongoing and improvements can + be expected pending feedback from users. + +- Wider use of SIMD to increase execution speed of ufuncs. Much work has been + done in introducing universal functions that will ease use of modern + features across different hardware platforms. This work is ongoing. + +- Preliminary work in changing the dtype and casting implementations in order to + provide an easier path to extending dtypes. This work is ongoing but enough + has been done to allow experimentation and feedback. + +- Extensive documentation improvements comprising some 185 PR merges. This work + is ongoing and part of the larger project to improve NumPy's online presence + and usefulness to new users. + +- Further cleanups related to removing Python 2.7. This improves code + readability and removes technical debt. + +- Preliminary support for the upcoming Cython 3.0. + + +New functions +============= + +The random.Generator class has a new ``permuted`` function. +----------------------------------------------------------- +The new function differs from ``shuffle`` and ``permutation`` in that the +subarrays indexed by an axis are permuted rather than the axis being treated as +a separate 1-D array for every combination of the other indexes. For example, +it is now possible to permute the rows or columns of a 2-D array. + +(`gh-15121 <https://github.com/numpy/numpy/pull/15121>`__) + +``sliding_window_view`` provides a sliding window view for numpy arrays +----------------------------------------------------------------------- +`numpy.lib.stride_tricks.sliding_window_view` constructs views on numpy +arrays that offer a sliding or moving window access to the array. This allows +for the simple implementation of certain algorithms, such as running means. + +(`gh-17394 <https://github.com/numpy/numpy/pull/17394>`__) + +`numpy.broadcast_shapes` is a new user-facing function +------------------------------------------------------ +`~numpy.broadcast_shapes` gets the resulting shape from +broadcasting the given shape tuples against each other. + +.. code:: python + + >>> np.broadcast_shapes((1, 2), (3, 1)) + (3, 2) + + >>> np.broadcast_shapes(2, (3, 1)) + (3, 2) + + >>> np.broadcast_shapes((6, 7), (5, 6, 1), (7,), (5, 1, 7)) + (5, 6, 7) + +(`gh-17535 <https://github.com/numpy/numpy/pull/17535>`__) + + +Deprecations +============ + +Using the aliases of builtin types like ``np.int`` is deprecated +---------------------------------------------------------------- + +For a long time, ``np.int`` has been an alias of the builtin ``int``. This is +repeatedly a cause of confusion for newcomers, and is also simply not useful. + +These aliases have been deprecated. The table below shows the full list of +deprecated aliases, along with their exact meaning. Replacing uses of items in +the first column with the contents of the second column will work identically +and silence the deprecation warning. + +In many cases, it may have been intended to use the types from the third column. +Be aware that use of these types may result in subtle but desirable behavior +changes. + +================== ================================= ================================================================== +Deprecated name Identical to Possibly intended numpy type +================== ================================= ================================================================== +``numpy.bool`` ``bool`` `numpy.bool_` +``numpy.int`` ``int`` `numpy.int_` (default int dtype), `numpy.cint` (C ``int``) +``numpy.float`` ``float`` `numpy.float_`, `numpy.double` (equivalent) +``numpy.complex`` ``complex`` `numpy.complex_`, `numpy.cdouble` (equivalent) +``numpy.object`` ``object`` `numpy.object_` +``numpy.str`` ``str`` `numpy.str_` +``numpy.long`` ``int`` (``long`` on Python 2) `numpy.int_` (C ``long``), `numpy.longlong` (largest integer type) +``numpy.unicode`` ``str`` (``unicode`` on Python 2) `numpy.unicode_` +================== ================================= ================================================================== + +Note that for technical reasons these deprecation warnings will only be emitted +on Python 3.7 and above. + +(`gh-14882 <https://github.com/numpy/numpy/pull/14882>`__) + +Passing ``shape=None`` to functions with a non-optional shape argument is deprecated +------------------------------------------------------------------------------------ +Previously, this was an alias for passing ``shape=()``. +This deprecation is emitted by `PyArray_IntpConverter` in the C API. If your +API is intended to support passing ``None``, then you should check for ``None`` +prior to invoking the converter, so as to be able to distinguish ``None`` and +``()``. + +(`gh-15886 <https://github.com/numpy/numpy/pull/15886>`__) + +Indexing errors will be reported even when index result is empty +---------------------------------------------------------------- +In the future, NumPy will raise an IndexError when an +integer array index contains out of bound values even if a non-indexed +dimension is of length 0. This will now emit a DeprecationWarning. +This can happen when the array is previously empty, or an empty +slice is involved:: + + arr1 = np.zeros((5, 0)) + arr1[[20]] + arr2 = np.zeros((5, 5)) + arr2[[20], :0] + +Previously the non-empty index ``[20]`` was not checked for correctness. +It will now be checked causing a deprecation warning which will be turned +into an error. This also applies to assignments. + +(`gh-15900 <https://github.com/numpy/numpy/pull/15900>`__) + +Inexact matches for ``mode`` and ``searchside`` are deprecated +-------------------------------------------------------------- +Inexact and case insensitive matches for ``mode`` and ``searchside`` were valid +inputs earlier and will give a DeprecationWarning now. For example, below are +some example usages which are now deprecated and will give a +DeprecationWarning:: + + import numpy as np + arr = np.array([[3, 6, 6], [4, 5, 1]]) + # mode: inexact match + np.ravel_multi_index(arr, (7, 6), mode="clap") # should be "clip" + # searchside: inexact match + np.searchsorted(arr[0], 4, side='random') # should be "right" + +(`gh-16056 <https://github.com/numpy/numpy/pull/16056>`__) + +Deprecation of `numpy.dual` +--------------------------- +The module `numpy.dual` is deprecated. Instead of importing functions +from `numpy.dual`, the functions should be imported directly from NumPy +or SciPy. + +(`gh-16156 <https://github.com/numpy/numpy/pull/16156>`__) + +``outer`` and ``ufunc.outer`` deprecated for matrix +--------------------------------------------------- +``np.matrix`` use with `~numpy.outer` or generic ufunc outer +calls such as ``numpy.add.outer``. Previously, matrix was +converted to an array here. This will not be done in the future +requiring a manual conversion to arrays. + +(`gh-16232 <https://github.com/numpy/numpy/pull/16232>`__) + +Further Numeric Style types Deprecated +-------------------------------------- + +The remaining numeric-style type codes ``Bytes0``, ``Str0``, +``Uint32``, ``Uint64``, and ``Datetime64`` +have been deprecated. The lower-case variants should be used +instead. For bytes and string ``"S"`` and ``"U"`` +are further alternatives. + +(`gh-16554 <https://github.com/numpy/numpy/pull/16554>`__) + +The ``ndincr`` method of ``ndindex`` is deprecated +-------------------------------------------------- +The documentation has warned against using this function since NumPy 1.8. +Use ``next(it)`` instead of ``it.ndincr()``. + +(`gh-17233 <https://github.com/numpy/numpy/pull/17233>`__) + + +Future Changes +============== + +Arrays cannot be using subarray dtypes +-------------------------------------- +Array creation and casting using ``np.array(arr, dtype)`` +and ``arr.astype(dtype)`` will use different logic when ``dtype`` +is a subarray dtype such as ``np.dtype("(2)i,")``. + +For such a ``dtype`` the following behaviour is true:: + + res = np.array(arr, dtype) + + res.dtype is not dtype + res.dtype is dtype.base + res.shape == arr.shape + dtype.shape + +But ``res`` is filled using the logic:: + + res = np.empty(arr.shape + dtype.shape, dtype=dtype.base) + res[...] = arr + +which uses incorrect broadcasting (and often leads to an error). +In the future, this will instead cast each element individually, +leading to the same result as:: + + res = np.array(arr, dtype=np.dtype(["f", dtype]))["f"] + +Which can normally be used to opt-in to the new behaviour. + +This change does not affect ``np.array(list, dtype="(2)i,")`` unless the +``list`` itself includes at least one array. In particular, the behaviour +is unchanged for a list of tuples. + +(`gh-17596 <https://github.com/numpy/numpy/pull/17596>`__) + + +Expired deprecations +==================== + +* The deprecation of numeric style type-codes ``np.dtype("Complex64")`` + (with upper case spelling), is expired. ``"Complex64"`` corresponded to + ``"complex128"`` and ``"Complex32"`` corresponded to ``"complex64"``. +* The deprecation of ``np.sctypeNA`` and ``np.typeNA`` is expired. Both + have been removed from the public API. Use ``np.typeDict`` instead. + + (`gh-16554 <https://github.com/numpy/numpy/pull/16554>`__) + +* The 14-year deprecation of ``np.ctypeslib.ctypes_load_library`` is expired. + Use :func:`~numpy.ctypeslib.load_library` instead, which is identical. + + (`gh-17116 <https://github.com/numpy/numpy/pull/17116>`__) + +Financial functions removed +--------------------------- +In accordance with NEP 32, the financial functions are removed +from NumPy 1.20. The functions that have been removed are ``fv``, +``ipmt``, ``irr``, ``mirr``, ``nper``, ``npv``, ``pmt``, ``ppmt``, +``pv``, and ``rate``. These functions are available in the +`numpy_financial <https://pypi.org/project/numpy-financial>`_ +library. + +(`gh-17067 <https://github.com/numpy/numpy/pull/17067>`__) + + +Compatibility notes +=================== + +``isinstance(dtype, np.dtype)`` and not ``type(dtype) is not np.dtype`` +----------------------------------------------------------------------- +NumPy dtypes are not direct instances of ``np.dtype`` anymore. Code that +may have used ``type(dtype) is np.dtype`` will always return ``False`` and +must be updated to use the correct version ``isinstance(dtype, np.dtype)``. + +This change also affects the C-side macro ``PyArray_DescrCheck`` if compiled +against a NumPy older than 1.16.6. If code uses this macro and wishes to +compile against an older version of NumPy, it must replace the macro +(see also `C API changes`_ section). + + +Same kind casting in concatenate with ``axis=None`` +--------------------------------------------------- +When `~numpy.concatenate` is called with ``axis=None``, +the flattened arrays were cast with ``unsafe``. Any other axis +choice uses "same kind". That different default +has been deprecated and "same kind" casting will be used +instead. The new ``casting`` keyword argument +can be used to retain the old behaviour. + +(`gh-16134 <https://github.com/numpy/numpy/pull/16134>`__) + +NumPy Scalars are cast when assigned to arrays +---------------------------------------------- + +When creating or assigning to arrays, in all relevant cases NumPy +scalars will now be cast identically to NumPy arrays. In particular +this changes the behaviour in some cases which previously raised an +error:: + + np.array([np.float64(np.nan)], dtype=np.int64) + +will succeed and return an undefined result (usually the smallest possible +integer). This also affects assignments:: + + arr[0] = np.float64(np.nan) + +At this time, NumPy retains the behaviour for:: + + np.array(np.float64(np.nan), dtype=np.int64) + +The above changes do not affect Python scalars:: + + np.array([float("NaN")], dtype=np.int64) + +remains unaffected (``np.nan`` is a Python ``float``, not a NumPy one). +Unlike signed integers, unsigned integers do not retain this special case, +since they always behaved more like casting. +The following code stops raising an error:: + + np.array([np.float64(np.nan)], dtype=np.uint64) + +To avoid backward compatibility issues, at this time assignment from +``datetime64`` scalar to strings of too short length remains supported. +This means that ``np.asarray(np.datetime64("2020-10-10"), dtype="S5")`` +succeeds now, when it failed before. In the long term this may be +deprecated or the unsafe cast may be allowed generally to make assignment +of arrays and scalars behave consistently. + + +Array coercion changes when Strings and other types are mixed +------------------------------------------------------------- + +When strings and other types are mixed, such as:: + + np.array(["string", np.float64(3.)], dtype="S") + +The results will change, which may lead to string dtypes with longer strings +in some cases. In particularly, if ``dtype="S"`` is not provided any numerical +value will lead to a string results long enough to hold all possible numerical +values. (e.g. "S32" for floats). Note that you should always provide +``dtype="S"`` when converting non-strings to strings. + +If ``dtype="S"`` is provided the results will be largely identical to before, +but NumPy scalars (not a Python float like ``1.0``), will still enforce +a uniform string length:: + + np.array([np.float64(3.)], dtype="S") # gives "S32" + np.array([3.0], dtype="S") # gives "S3" + +Previously the first version gave the same result as the second. + + +Array coercion restructure +-------------------------- + +Array coercion has been restructured. In general, this should not affect +users. In extremely rare corner cases where array-likes are nested:: + + np.array([array_like1]) + +Things will now be more consistent with:: + + np.array([np.array(array_like1)]) + +This could potentially subtly change output for badly defined array-likes. +We are not aware of any such case where the results were not clearly +incorrect previously. + +(`gh-16200 <https://github.com/numpy/numpy/pull/16200>`__) + +Writing to the result of `numpy.broadcast_arrays` will export readonly buffers +------------------------------------------------------------------------------ + +In NumPy 1.17 `numpy.broadcast_arrays` started warning when the resulting array +was written to. This warning was skipped when the array was used through the +buffer interface (e.g. ``memoryview(arr)``). The same thing will now occur for the +two protocols ``__array_interface__``, and ``__array_struct__`` returning read-only +buffers instead of giving a warning. + +(`gh-16350 <https://github.com/numpy/numpy/pull/16350>`__) + +Numeric-style type names have been removed from type dictionaries +----------------------------------------------------------------- + +To stay in sync with the deprecation for ``np.dtype("Complex64")`` +and other numeric-style (capital case) types. These were removed +from ``np.sctypeDict`` and ``np.typeDict``. You should use +the lower case versions instead. Note that ``"Complex64"`` +corresponds to ``"complex128"`` and ``"Complex32"`` corresponds +to ``"complex64"``. The numpy style (new) versions, denote the full +size and not the size of the real/imaginary part. + +(`gh-16554 <https://github.com/numpy/numpy/pull/16554>`__) + +The ``operator.concat`` function now raises TypeError for array arguments +------------------------------------------------------------------------- +The previous behavior was to fall back to addition and add the two arrays, +which was thought to be unexpected behavior for a concatenation function. + +(`gh-16570 <https://github.com/numpy/numpy/pull/16570>`__) + +``nickname`` attribute removed from ABCPolyBase +----------------------------------------------- + +An abstract property ``nickname`` has been removed from ``ABCPolyBase`` as it +was no longer used in the derived convenience classes. +This may affect users who have derived classes from ``ABCPolyBase`` and +overridden the methods for representation and display, e.g. ``__str__``, +``__repr__``, ``_repr_latex``, etc. + +(`gh-16589 <https://github.com/numpy/numpy/pull/16589>`__) + +``float->timedelta`` and ``uint64->timedelta`` promotion will raise a TypeError +------------------------------------------------------------------------------- +Float and timedelta promotion consistently raises a TypeError. +``np.promote_types("float32", "m8")`` aligns with +``np.promote_types("m8", "float32")`` now and both raise a TypeError. +Previously, ``np.promote_types("float32", "m8")`` returned ``"m8"`` which +was considered a bug. + +Uint64 and timedelta promotion consistently raises a TypeError. +``np.promote_types("uint64", "m8")`` aligns with +``np.promote_types("m8", "uint64")`` now and both raise a TypeError. +Previously, ``np.promote_types("uint64", "m8")`` returned ``"m8"`` which +was considered a bug. + +(`gh-16592 <https://github.com/numpy/numpy/pull/16592>`__) + +``numpy.genfromtxt`` now correctly unpacks structured arrays +------------------------------------------------------------ +Previously, `numpy.genfromtxt` failed to unpack if it was called with +``unpack=True`` and a structured datatype was passed to the ``dtype`` argument +(or ``dtype=None`` was passed and a structured datatype was inferred). +For example:: + + >>> data = StringIO("21 58.0\n35 72.0") + >>> np.genfromtxt(data, dtype=None, unpack=True) + array([(21, 58.), (35, 72.)], dtype=[('f0', '<i8'), ('f1', '<f8')]) + +Structured arrays will now correctly unpack into a list of arrays, +one for each column:: + + >>> np.genfromtxt(data, dtype=None, unpack=True) + [array([21, 35]), array([58., 72.])] + +(`gh-16650 <https://github.com/numpy/numpy/pull/16650>`__) + +``mgrid``, ``r_``, etc. consistently return correct outputs for non-default precision input +------------------------------------------------------------------------------------------- +Previously, ``np.mgrid[np.float32(0.1):np.float32(0.35):np.float32(0.1),]`` +and ``np.r_[0:10:np.complex64(3j)]`` failed to return meaningful output. +This bug potentially affects `~numpy.mgrid`, `~numpy.ogrid`, `~numpy.r_`, +and `~numpy.c_` when an input with dtype other than the default +``float64`` and ``complex128`` and equivalent Python types were used. +The methods have been fixed to handle varying precision correctly. + +(`gh-16815 <https://github.com/numpy/numpy/pull/16815>`__) + +Boolean array indices with mismatching shapes now properly give ``IndexError`` +------------------------------------------------------------------------------ + +Previously, if a boolean array index matched the size of the indexed array but +not the shape, it was incorrectly allowed in some cases. In other cases, it +gave an error, but the error was incorrectly a ``ValueError`` with a message +about broadcasting instead of the correct ``IndexError``. + +For example, the following used to incorrectly give ``ValueError: operands +could not be broadcast together with shapes (2,2) (1,4)``: + +.. code:: python + + np.empty((2, 2))[np.array([[True, False, False, False]])] + +And the following used to incorrectly return ``array([], dtype=float64)``: + +.. code:: python + + np.empty((2, 2))[np.array([[False, False, False, False]])] + +Both now correctly give ``IndexError: boolean index did not match indexed +array along dimension 0; dimension is 2 but corresponding boolean dimension is +1``. + +(`gh-17010 <https://github.com/numpy/numpy/pull/17010>`__) + +Casting errors interrupt Iteration +---------------------------------- +When iterating while casting values, an error may stop the iteration +earlier than before. In any case, a failed casting operation always +returned undefined, partial results. Those may now be even more +undefined and partial. +For users of the ``NpyIter`` C-API such cast errors will now +cause the `iternext()` function to return 0 and thus abort +iteration. +Currently, there is no API to detect such an error directly. +It is necessary to check ``PyErr_Occurred()``, which +may be problematic in combination with ``NpyIter_Reset``. +These issues always existed, but new API could be added +if required by users. + +(`gh-17029 <https://github.com/numpy/numpy/pull/17029>`__) + +f2py generated code may return unicode instead of byte strings +-------------------------------------------------------------- +Some byte strings previously returned by f2py generated code may now be unicode +strings. This results from the ongoing Python2 -> Python3 cleanup. + +(`gh-17068 <https://github.com/numpy/numpy/pull/17068>`__) + +The first element of the ``__array_interface__["data"]`` tuple must be an integer +---------------------------------------------------------------------------------- +This has been the documented interface for many years, but there was still +code that would accept a byte string representation of the pointer address. +That code has been removed, passing the address as a byte string will now +raise an error. + +(`gh-17241 <https://github.com/numpy/numpy/pull/17241>`__) + +poly1d respects the dtype of all-zero argument +---------------------------------------------- +Previously, constructing an instance of ``poly1d`` with all-zero +coefficients would cast the coefficients to ``np.float64``. +This affected the output dtype of methods which construct +``poly1d`` instances internally, such as ``np.polymul``. + +(`gh-17577 <https://github.com/numpy/numpy/pull/17577>`__) + +The numpy.i file for swig is Python 3 only. +------------------------------------------- +Uses of Python 2.7 C-API functions have been updated to Python 3 only. Users +who need the old version should take it from an older version of NumPy. + +(`gh-17580 <https://github.com/numpy/numpy/pull/17580>`__) + +Void dtype discovery in ``np.array`` +------------------------------------ +In calls using ``np.array(..., dtype="V")``, ``arr.astype("V")``, +and similar a TypeError will now be correctly raised unless all +elements have the identical void length. An example for this is:: + + np.array([b"1", b"12"], dtype="V") + +Which previously returned an array with dtype ``"V2"`` which +cannot represent ``b"1"`` faithfully. + +(`gh-17706 <https://github.com/numpy/numpy/pull/17706>`__) + + +C API changes +============= + +The ``PyArray_DescrCheck`` macro is modified +-------------------------------------------- +The ``PyArray_DescrCheck`` macro has been updated since NumPy 1.16.6 to be:: + + #define PyArray_DescrCheck(op) PyObject_TypeCheck(op, &PyArrayDescr_Type) + +Starting with NumPy 1.20 code that is compiled against an earlier version +will be API incompatible with NumPy 1.20. +The fix is to either compile against 1.16.6 (if the NumPy 1.16 release is +the oldest release you wish to support), or manually inline the macro by +replacing it with the new definition:: + + PyObject_TypeCheck(op, &PyArrayDescr_Type) + +which is compatible with all NumPy versions. + + +Size of ``np.ndarray`` and ``np.void_`` changed +----------------------------------------------- +The size of the ``PyArrayObject`` and ``PyVoidScalarObject`` +structures have changed. The following header definition has been +removed:: + + #define NPY_SIZEOF_PYARRAYOBJECT (sizeof(PyArrayObject_fields)) + +since the size must not be considered a compile time constant: it will +change for different runtime versions of NumPy. + +The most likely relevant use are potential subclasses written in C which +will have to be recompiled and should be updated. Please see the +documentation for :c:type:`PyArrayObject` for more details and contact +the NumPy developers if you are affected by this change. + +NumPy will attempt to give a graceful error but a program expecting a +fixed structure size may have undefined behaviour and likely crash. + +(`gh-16938 <https://github.com/numpy/numpy/pull/16938>`__) + + +New Features +============ + +``where`` keyword argument for ``numpy.all`` and ``numpy.any`` functions +------------------------------------------------------------------------ +The keyword argument ``where`` is added and allows to only consider specified +elements or subaxes from an array in the Boolean evaluation of ``all`` and +``any``. This new keyword is available to the functions ``all`` and ``any`` +both via ``numpy`` directly or in the methods of ``numpy.ndarray``. + +Any broadcastable Boolean array or a scalar can be set as ``where``. It +defaults to ``True`` to evaluate the functions for all elements in an array if +``where`` is not set by the user. Examples are given in the documentation of +the functions. + + +``where`` keyword argument for ``numpy`` functions ``mean``, ``std``, ``var`` +----------------------------------------------------------------------------- +The keyword argument ``where`` is added and allows to limit the scope in the +calculation of ``mean``, ``std`` and ``var`` to only a subset of elements. It +is available both via ``numpy`` directly or in the methods of +``numpy.ndarray``. + +Any broadcastable Boolean array or a scalar can be set as ``where``. It +defaults to ``True`` to evaluate the functions for all elements in an array if +``where`` is not set by the user. Examples are given in the documentation of +the functions. + +(`gh-15852 <https://github.com/numpy/numpy/pull/15852>`__) + +``norm=backward``, ``forward`` keyword options for ``numpy.fft`` functions +-------------------------------------------------------------------------- +The keyword argument option ``norm=backward`` is added as an alias for ``None`` +and acts as the default option; using it has the direct transforms unscaled +and the inverse transforms scaled by ``1/n``. + +Using the new keyword argument option ``norm=forward`` has the direct +transforms scaled by ``1/n`` and the inverse transforms unscaled (i.e. exactly +opposite to the default option ``norm=backward``). + +(`gh-16476 <https://github.com/numpy/numpy/pull/16476>`__) + +NumPy is now typed +------------------ +Type annotations have been added for large parts of NumPy. There is +also a new `numpy.typing` module that contains useful types for +end-users. The currently available types are + +- ``ArrayLike``: for objects that can be coerced to an array +- ``DtypeLike``: for objects that can be coerced to a dtype + +(`gh-16515 <https://github.com/numpy/numpy/pull/16515>`__) + +``numpy.typing`` is accessible at runtime +----------------------------------------- +The types in ``numpy.typing`` can now be imported at runtime. Code +like the following will now work: + +.. code:: python + + from numpy.typing import ArrayLike + x: ArrayLike = [1, 2, 3, 4] + +(`gh-16558 <https://github.com/numpy/numpy/pull/16558>`__) + +New ``__f2py_numpy_version__`` attribute for f2py generated modules. +-------------------------------------------------------------------- +Because f2py is released together with NumPy, ``__f2py_numpy_version__`` +provides a way to track the version f2py used to generate the module. + +(`gh-16594 <https://github.com/numpy/numpy/pull/16594>`__) + +``mypy`` tests can be run via runtests.py +----------------------------------------- +Currently running mypy with the NumPy stubs configured requires +either: + +* Installing NumPy +* Adding the source directory to MYPYPATH and linking to the ``mypy.ini`` + +Both options are somewhat inconvenient, so add a ``--mypy`` option to runtests +that handles setting things up for you. This will also be useful in the future +for any typing codegen since it will ensure the project is built before type +checking. + +(`gh-17123 <https://github.com/numpy/numpy/pull/17123>`__) + +Negation of user defined BLAS/LAPACK detection order +---------------------------------------------------- +`~numpy.distutils` allows negation of libraries when determining BLAS/LAPACK +libraries. +This may be used to remove an item from the library resolution phase, i.e. +to disallow NetLIB libraries one could do: + +.. code:: bash + + NPY_BLAS_ORDER='^blas' NPY_LAPACK_ORDER='^lapack' python setup.py build + +That will use any of the accelerated libraries instead. + +(`gh-17219 <https://github.com/numpy/numpy/pull/17219>`__) + +Allow passing optimizations arguments to asv build +-------------------------------------------------- +It is now possible to pass ``-j``, ``--cpu-baseline``, ``--cpu-dispatch`` and +``--disable-optimization`` flags to ASV build when the ``--bench-compare`` +argument is used. + +(`gh-17284 <https://github.com/numpy/numpy/pull/17284>`__) + +The NVIDIA HPC SDK nvfortran compiler is now supported +------------------------------------------------------ +Support for the nvfortran compiler, a version of pgfortran, has been added. + +(`gh-17344 <https://github.com/numpy/numpy/pull/17344>`__) + +``dtype`` option for ``cov`` and ``corrcoef`` +--------------------------------------------- +The ``dtype`` option is now available for `numpy.cov` and `numpy.corrcoef`. +It specifies which data-type the returned result should have. +By default the functions still return a `numpy.float64` result. + +(`gh-17456 <https://github.com/numpy/numpy/pull/17456>`__) + + +Improvements +============ + +Improved string representation for polynomials (``__str__``) +------------------------------------------------------------ + +The string representation (``__str__``) of all six polynomial types in +`numpy.polynomial` has been updated to give the polynomial as a mathematical +expression instead of an array of coefficients. Two package-wide formats for +the polynomial expressions are available - one using Unicode characters for +superscripts and subscripts, and another using only ASCII characters. + +(`gh-15666 <https://github.com/numpy/numpy/pull/15666>`__) + +Remove the Accelerate library as a candidate LAPACK library +----------------------------------------------------------- +Apple no longer supports Accelerate. Remove it. + +(`gh-15759 <https://github.com/numpy/numpy/pull/15759>`__) + +Object arrays containing multi-line objects have a more readable ``repr`` +------------------------------------------------------------------------- +If elements of an object array have a ``repr`` containing new lines, then the +wrapped lines will be aligned by column. Notably, this improves the ``repr`` of +nested arrays:: + + >>> np.array([np.eye(2), np.eye(3)], dtype=object) + array([array([[1., 0.], + [0., 1.]]), + array([[1., 0., 0.], + [0., 1., 0.], + [0., 0., 1.]])], dtype=object) + +(`gh-15997 <https://github.com/numpy/numpy/pull/15997>`__) + +Concatenate supports providing an output dtype +---------------------------------------------- +Support was added to `~numpy.concatenate` to provide +an output ``dtype`` and ``casting`` using keyword +arguments. The ``dtype`` argument cannot be provided +in conjunction with the ``out`` one. + +(`gh-16134 <https://github.com/numpy/numpy/pull/16134>`__) + +Thread safe f2py callback functions +----------------------------------- + +Callback functions in f2py are now thread safe. + +(`gh-16519 <https://github.com/numpy/numpy/pull/16519>`__) + +`numpy.core.records.fromfile` now supports file-like objects +------------------------------------------------------------ +`numpy.rec.fromfile` can now use file-like objects, for instance +:py:class:`io.BytesIO` + +(`gh-16675 <https://github.com/numpy/numpy/pull/16675>`__) + +RPATH support on AIX added to distutils +--------------------------------------- +This allows SciPy to be built on AIX. + +(`gh-16710 <https://github.com/numpy/numpy/pull/16710>`__) + +Use f90 compiler specified by the command line args +--------------------------------------------------- + +The compiler command selection for Fortran Portland Group Compiler is changed +in `numpy.distutils.fcompiler`. This only affects the linking command. This +forces the use of the executable provided by the command line option (if +provided) instead of the pgfortran executable. If no executable is provided to +the command line option it defaults to the pgf90 executable, wich is an alias +for pgfortran according to the PGI documentation. + +(`gh-16730 <https://github.com/numpy/numpy/pull/16730>`__) + +Add NumPy declarations for Cython 3.0 and later +----------------------------------------------- + +The pxd declarations for Cython 3.0 were improved to avoid using deprecated +NumPy C-API features. Extension modules built with Cython 3.0+ that use NumPy +can now set the C macro ``NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION`` to avoid +C compiler warnings about deprecated API usage. + +(`gh-16986 <https://github.com/numpy/numpy/pull/16986>`__) + +Make the window functions exactly symmetric +------------------------------------------- +Make sure the window functions provided by NumPy are symmetric. There were +previously small deviations from symmetry due to numerical precision that are +now avoided by better arrangement of the computation. + +(`gh-17195 <https://github.com/numpy/numpy/pull/17195>`__) + + +Performance improvements and changes +==================================== + +Enable multi-platform SIMD compiler optimizations +------------------------------------------------- + +A series of improvements for NumPy infrastructure to pave the way to +**NEP-38**, that can be summarized as follow: + +- **New Build Arguments** + + - ``--cpu-baseline`` to specify the minimal set of required + optimizations, default value is ``min`` which provides the minimum + CPU features that can safely run on a wide range of users + platforms. + + - ``--cpu-dispatch`` to specify the dispatched set of additional + optimizations, default value is ``max -xop -fma4`` which enables + all CPU features, except for AMD legacy features. + + - ``--disable-optimization`` to explicitly disable the whole new + improvements, It also adds a new **C** compiler #definition + called ``NPY_DISABLE_OPTIMIZATION`` which it can be used as + guard for any SIMD code. + +- **Advanced CPU dispatcher** + + A flexible cross-architecture CPU dispatcher built on the top of + Python/Numpy distutils, support all common compilers with a wide range of + CPU features. + + The new dispatcher requires a special file extension ``*.dispatch.c`` to + mark the dispatch-able **C** sources. These sources have the ability to be + compiled multiple times so that each compilation process represents certain + CPU features and provides different #definitions and flags that affect the + code paths. + +- **New auto-generated C header ``core/src/common/_cpu_dispatch.h``** + + This header is generated by the distutils module ``ccompiler_opt``, and + contains all the #definitions and headers of instruction sets, that had been + configured through command arguments '--cpu-baseline' and '--cpu-dispatch'. + +- **New C header ``core/src/common/npy_cpu_dispatch.h``** + + This header contains all utilities that required for the whole CPU + dispatching process, it also can be considered as a bridge linking the new + infrastructure work with NumPy CPU runtime detection. + +- **Add new attributes to NumPy umath module(Python level)** + + - ``__cpu_baseline__`` a list contains the minimal set of required + optimizations that supported by the compiler and platform according to the + specified values to command argument '--cpu-baseline'. + + - ``__cpu_dispatch__`` a list contains the dispatched set of additional + optimizations that supported by the compiler and platform according to the + specified values to command argument '--cpu-dispatch'. + +- **Print the supported CPU features during the run of PytestTester** + +(`gh-13516 <https://github.com/numpy/numpy/pull/13516>`__) + + +Changes +======= + +Changed behavior of ``divmod(1., 0.)`` and related functions +------------------------------------------------------------ +The changes also assure that different compiler versions have the same behavior +for nan or inf usages in these operations. This was previously compiler +dependent, we now force the invalid and divide by zero flags, making the +results the same across compilers. For example, gcc-5, gcc-8, or gcc-9 now +result in the same behavior. The changes are tabulated below: + +.. list-table:: Summary of New Behavior + :widths: auto + :header-rows: 1 + + * - Operator + - Old Warning + - New Warning + - Old Result + - New Result + - Works on MacOS + * - np.divmod(1.0, 0.0) + - Invalid + - Invalid and Dividebyzero + - nan, nan + - inf, nan + - Yes + * - np.fmod(1.0, 0.0) + - Invalid + - Invalid + - nan + - nan + - No? Yes + * - np.floor_divide(1.0, 0.0) + - Invalid + - Dividebyzero + - nan + - inf + - Yes + * - np.remainder(1.0, 0.0) + - Invalid + - Invalid + - nan + - nan + - Yes + +(`gh-16161 <https://github.com/numpy/numpy/pull/16161>`__) + +``np.linspace`` on integers now uses floor +------------------------------------------ +When using a ``int`` dtype in `numpy.linspace`, previously float values would +be rounded towards zero. Now `numpy.floor` is used instead, which rounds toward +``-inf``. This changes the results for negative values. For example, the +following would previously give:: + + >>> np.linspace(-3, 1, 8, dtype=int) + array([-3, -2, -1, -1, 0, 0, 0, 1]) + +and now results in:: + + >>> np.linspace(-3, 1, 8, dtype=int) + array([-3, -3, -2, -2, -1, -1, 0, 1]) + +The former result can still be obtained with:: + + >>> np.linspace(-3, 1, 8).astype(int) + array([-3, -2, -1, -1, 0, 0, 0, 1]) + +(`gh-16841 <https://github.com/numpy/numpy/pull/16841>`__) + + diff --git a/doc/source/release/1.21.0-notes.rst b/doc/source/release/1.21.0-notes.rst new file mode 100644 index 000000000..5fda1f631 --- /dev/null +++ b/doc/source/release/1.21.0-notes.rst @@ -0,0 +1,6 @@ +.. currentmodule:: numpy + +========================== +NumPy 1.21.0 Release Notes +========================== + diff --git a/doc/source/user/absolute_beginners.rst b/doc/source/user/absolute_beginners.rst index 5873eb108..126f5f2a3 100644 --- a/doc/source/user/absolute_beginners.rst +++ b/doc/source/user/absolute_beginners.rst @@ -1090,7 +1090,7 @@ To learn more about finding the unique elements in an array, see `unique`. Transposing and reshaping a matrix ---------------------------------- -*This section covers* ``arr.reshape()``, ``arr.transpose()``, ``arr.T()`` +*This section covers* ``arr.reshape()``, ``arr.transpose()``, ``arr.T`` ----- @@ -1114,7 +1114,7 @@ You simply need to pass in the new dimensions that you want for the matrix. :: .. image:: images/np_reshape.png -You can also use ``.transpose`` to reverse or change the axes of an array +You can also use ``.transpose()`` to reverse or change the axes of an array according to the values you specify. If you start with this array:: @@ -1131,6 +1131,13 @@ You can transpose your array with ``arr.transpose()``. :: [1, 4], [2, 5]]) +You can also use ``arr.T``:: + + >>> arr.T + array([[0, 3], + [1, 4], + [2, 5]]) + To learn more about transposing and reshaping arrays, see `transpose` and `reshape`. @@ -1138,12 +1145,12 @@ To learn more about transposing and reshaping arrays, see `transpose` and How to reverse an array ----------------------- -*This section covers* ``np.flip`` +*This section covers* ``np.flip()`` ----- NumPy's ``np.flip()`` function allows you to flip, or reverse, the contents of -an array along an axis. When using ``np.flip``, specify the array you would like +an array along an axis. When using ``np.flip()``, specify the array you would like to reverse and the axis. If you don't specify the axis, NumPy will reverse the contents along all of the axes of your input array. diff --git a/doc/source/user/basics.rec.rst b/doc/source/user/basics.rec.rst index 3dba65361..0524fde8e 100644 --- a/doc/source/user/basics.rec.rst +++ b/doc/source/user/basics.rec.rst @@ -619,8 +619,8 @@ appropriate `view <numpy-ndarray-view>`_:: >>> recordarr = arr.view(dtype=np.dtype((np.record, arr.dtype)), ... type=np.recarray) -For convenience, viewing an ndarray as type :class:`np.recarray` will -automatically convert to :class:`np.record` datatype, so the dtype can be left +For convenience, viewing an ndarray as type :class:`numpy.recarray` will +automatically convert to :class:`numpy.record` datatype, so the dtype can be left out of the view:: >>> recordarr = arr.view(np.recarray) diff --git a/doc/source/user/basics.rst b/doc/source/user/basics.rst index e0fc0ece3..66f3f9ee9 100644 --- a/doc/source/user/basics.rst +++ b/doc/source/user/basics.rst @@ -1,14 +1,18 @@ -************ -NumPy basics -************ +****************** +NumPy fundamentals +****************** + +These documents clarify concepts, design decisions, and technical +constraints in NumPy. This is a great place to understand the +fundamental NumPy ideas and philosophy. .. toctree:: :maxdepth: 1 - basics.types basics.creation - basics.io basics.indexing + basics.io + basics.types basics.broadcasting basics.byteswapping basics.rec diff --git a/doc/source/user/images/np_indexing.png b/doc/source/user/images/np_indexing.png Binary files differindex 4303ec35b..863b2d46f 100644 --- a/doc/source/user/images/np_indexing.png +++ b/doc/source/user/images/np_indexing.png diff --git a/doc/source/user/quickstart.rst b/doc/source/user/quickstart.rst index 387a7f715..8fdc6ec36 100644 --- a/doc/source/user/quickstart.rst +++ b/doc/source/user/quickstart.rst @@ -359,7 +359,7 @@ existing array rather than create a new one. >>> a += b # b is not automatically converted to integer type Traceback (most recent call last): ... - numpy.core._exceptions.UFuncTypeError: Cannot cast ufunc 'add' output from dtype('float64') to dtype('int64') with casting rule 'same_kind' + numpy.core._exceptions._UFuncOutputCastingError: Cannot cast ufunc 'add' output from dtype('float64') to dtype('int64') with casting rule 'same_kind' When operating with arrays of different types, the type of the resulting array corresponds to the more general or precise one (a behavior known diff --git a/doc/source/user/theory.broadcasting.rst b/doc/source/user/theory.broadcasting.rst index b37edeacc..a82d78e6c 100644 --- a/doc/source/user/theory.broadcasting.rst +++ b/doc/source/user/theory.broadcasting.rst @@ -69,7 +69,7 @@ numpy on Windows 2000 with one million element arrays. *Figure 1* *In the simplest example of broadcasting, the scalar ``b`` is - stretched to become an array of with the same shape as ``a`` so the shapes + stretched to become an array of same shape as ``a`` so the shapes are compatible for element-by-element multiplication.* |