diff options
author | mattip <matti.picus@gmail.com> | 2018-09-12 22:13:31 +0300 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2018-09-12 22:13:31 +0300 |
commit | 552b4ebb6db6af33f1e953ed4a96e5b11b6e3967 (patch) | |
tree | cdbd235e96de7bdc3c540cbe56c92013f53a9b5b /doc | |
parent | ea0322bd6310462c1485ce82ff08775816f7b3a6 (diff) | |
parent | 99f7ad58fcfa3d09897426e468a66840026dbce8 (diff) | |
download | numpy-552b4ebb6db6af33f1e953ed4a96e5b11b6e3967.tar.gz |
Merge 'master' into branch
Diffstat (limited to 'doc')
35 files changed, 1723 insertions, 364 deletions
diff --git a/doc/HOWTO_DOCUMENT.rst.txt b/doc/HOWTO_DOCUMENT.rst.txt index 6b3640d8d..8f0d2fbae 100644 --- a/doc/HOWTO_DOCUMENT.rst.txt +++ b/doc/HOWTO_DOCUMENT.rst.txt @@ -1 +1 @@ -This document has been replaced, see https://numpydoc.readthedocs.io/en/latest/ +This document has been replaced, see https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard diff --git a/doc/RELEASE_WALKTHROUGH.rst.txt b/doc/RELEASE_WALKTHROUGH.rst.txt index 260e0c1b7..c3400194c 100644 --- a/doc/RELEASE_WALKTHROUGH.rst.txt +++ b/doc/RELEASE_WALKTHROUGH.rst.txt @@ -2,15 +2,18 @@ This file contains a walkthrough of the NumPy 1.14.5 release on Linux. The commands can be copied into the command line, but be sure to replace 1.14.5 by the correct version. + Release Walkthrough ==================== + Backport Pull Requests ---------------------- Changes that have been marked for this release must be backported to the maintenance/1.14.x branch. + Update Release documentation ---------------------------- @@ -21,17 +24,19 @@ the final list of changes and contributors. This text can be generated by:: 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 latter tend to be +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. + Finish the Release Note ----------------------- Fill out the release note ``doc/release/1.14.5-notes.rst`` calling out significant changes. + Prepare the release commit -------------------------- @@ -60,6 +65,7 @@ requires write permission to the numpy repository:: As an example, see the 1.14.3 REL commit: `<https://github.com/numpy/numpy/commit/73299826729be58cec179b52c656adfcaefada93>`_. + Build source releases --------------------- @@ -70,6 +76,7 @@ source releases in the latter. :: $ cython --version # check that you have the correct cython version $ paver sdist # sdist will do a git clean -xdf, so we omit that + Build wheels ------------ @@ -102,6 +109,7 @@ need to restart them. .. example_: https://github.com/MacPython/numpy-wheels/commit/fed9c04629c155e7804282eb803d81097244598d + Download wheels --------------- @@ -121,8 +129,16 @@ upload later using ``twine``:: $ ./wheel-uploader -u $CDN_URL -n -v -w $NPY_WHLS -t macosx numpy 1.14.5 If you do this often, consider making CDN_URL and NPY_WHLS part of your default -environment. Note that we need local copies of the files in order to generate -hashes to include in the README files generated later. +environment. + +Generate the README files +------------------------- + +This needs to be done after all installers are present, but before the pavement +file is updated for continued development. + + $ paver write_release_and_log + Tag the release --------------- @@ -144,6 +160,7 @@ push the tag upstream:: We wait until this point to push the tag because it is very difficult to change the tag after it has been pushed. + Reset the maintenance branch into a development state ----------------------------------------------------- @@ -172,13 +189,10 @@ avoid synchronization problems 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. + Upload files to github ---------------------- -Generate the ``release/README.*`` files:: - - $ paver write_release_and_log - Go to `<https://github.com/numpy/numpy/releases>`_, there should be a ``v1.14.5 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. @@ -230,6 +244,7 @@ This assumes that you have forked `<https://github.com/scipy/scipy.org>`_:: Now go to your fork and make a pull request for the branch. + Announce to mailing lists ------------------------- @@ -238,9 +253,10 @@ scipy-user, and python-announce-list mailing lists. Look at previous announcements for the basic template. The contributor and PR lists are the same as generated for the release notes above. + Post-Release Tasks ------------------ Forward port the documentation changes ``doc/release/1.14.5-notes.rst``, -``doc/changelog/1.14.5-changelog.rst`` and add the release note to +``doc/changelog/1.14.5-changelog.rst`` and add the release note to ``doc/source/release.rst``. diff --git a/doc/changelog/1.15.0-changelog.rst b/doc/changelog/1.15.0-changelog.rst new file mode 100644 index 000000000..b76b9699a --- /dev/null +++ b/doc/changelog/1.15.0-changelog.rst @@ -0,0 +1,584 @@ + +Contributors +============ + +A total of 133 people contributed to this release. People with a "+" by their +names contributed a patch for the first time. + +* Aaron Critchley + +* Aarthi + +* Aarthi Agurusa + +* Alex Thomas + +* Alexander Belopolsky +* Allan Haldane +* Anas Khan + +* Andras Deak +* Andrey Portnoy + +* Anna Chiara +* Aurelien Jarno + +* Baurzhan Muftakhidinov +* Berend Kapelle + +* Bernhard M. Wiedemann +* Bjoern Thiel + +* Bob Eldering +* Cenny Wenner + +* Charles Harris +* ChloeColeongco + +* Chris Billington + +* Christopher + +* Chun-Wei Yuan + +* Claudio Freire + +* Daniel Smith +* Darcy Meyer + +* David Abdurachmanov + +* David Freese +* Deepak Kumar Gouda + +* Dennis Weyland + +* Derrick Williams + +* Dmitriy Shalyga + +* Eric Cousineau + +* Eric Larson +* Eric Wieser +* Evgeni Burovski +* Frederick Lefebvre + +* Gaspar Karm + +* Geoffrey Irving +* Gerhard Hobler + +* Gerrit Holl +* Guo Ci + +* Hameer Abbasi + +* Han Shen +* Hiroyuki V. Yamazaki + +* Hong Xu +* Ihor Melnyk + +* Jaime Fernandez +* Jake VanderPlas + +* James Tocknell + +* Jarrod Millman +* Jeff VanOss + +* John Kirkham +* Jonas Rauber + +* Jonathan March + +* Joseph Fox-Rabinovitz +* Julian Taylor +* Junjie Bai + +* Juris Bogusevs + +* Jörg Döpfert +* Kenichi Maehashi + +* Kevin Sheppard +* Kimikazu Kato + +* Kirit Thadaka + +* Kritika Jalan + +* Kyle Sunden + +* Lakshay Garg + +* Lars G + +* Licht Takeuchi +* Louis Potok + +* Luke Zoltan Kelley +* MSeifert04 + +* Mads R. B. Kristensen + +* Malcolm Smith + +* Mark Harfouche + +* Marten H. van Kerkwijk + +* Marten van Kerkwijk +* Matheus Vieira Portela + +* Mathieu Lamarre +* Mathieu Sornay + +* Matthew Brett +* Matthew Rocklin + +* Matthias Bussonnier +* Matti Picus +* Michael Droettboom +* Miguel Sánchez de León Peque + +* Mike Toews + +* Milo + +* Nathaniel J. Smith +* Nelle Varoquaux +* Nicholas Nadeau, P.Eng., AVS + +* Nick Minkyu Lee + +* Nikita + +* Nikita Kartashov + +* Nils Becker + +* Oleg Zabluda +* Orestis Floros + +* Pat Gunn + +* Paul van Mulbregt + +* Pauli Virtanen +* Pierre Chanial + +* Ralf Gommers +* Raunak Shah + +* Robert Kern +* Russell Keith-Magee + +* Ryan Soklaski + +* Samuel Jackson + +* Sebastian Berg +* Siavash Eliasi + +* Simon Conseil +* Simon Gibbons +* Stefan Krah + +* Stefan van der Walt +* Stephan Hoyer +* Subhendu + +* Subhendu Ranjan Mishra + +* Tai-Lin Wu + +* Tobias Fischer + +* Toshiki Kataoka + +* Tyler Reddy + +* Unknown + +* Varun Nayyar +* Victor Rodriguez + +* Warren Weckesser +* William D. Irons + +* Zane Bradley + +* cclauss + +* fo40225 + +* lapack_lite code generator + +* lumbric + +* luzpaz + +* mamrehn + +* tynn + +* xoviat + +Pull requests merged +==================== + +A total of 438 pull requests were merged for this release. + +* `#8157 <https://github.com/numpy/numpy/pull/8157>`__: BUG: void .item() doesn't hold reference to original array +* `#8774 <https://github.com/numpy/numpy/pull/8774>`__: ENH: Add gcd and lcm ufuncs +* `#8819 <https://github.com/numpy/numpy/pull/8819>`__: ENH: Implement axes keyword argument for gufuncs. +* `#8952 <https://github.com/numpy/numpy/pull/8952>`__: MAINT: Removed duplicated code around `ufunc->identity` +* `#9686 <https://github.com/numpy/numpy/pull/9686>`__: DEP: Deprecate non-tuple nd-indices +* `#9980 <https://github.com/numpy/numpy/pull/9980>`__: MAINT: Implement `lstsq` as a `gufunc` +* `#9998 <https://github.com/numpy/numpy/pull/9998>`__: ENH: Nditer as context manager +* `#10073 <https://github.com/numpy/numpy/pull/10073>`__: ENH: Implement fft.fftshift/ifftshift with np.roll for improved... +* `#10078 <https://github.com/numpy/numpy/pull/10078>`__: DOC: document nested_iters +* `#10128 <https://github.com/numpy/numpy/pull/10128>`__: BUG: Prefix library names with `lib` on windows. +* `#10142 <https://github.com/numpy/numpy/pull/10142>`__: DEP: Pending deprecation warning for matrix +* `#10154 <https://github.com/numpy/numpy/pull/10154>`__: MAINT: Use a StructSequence in place of the typeinfo tuples +* `#10158 <https://github.com/numpy/numpy/pull/10158>`__: BUG: Fix a few smaller valgrind errors +* `#10178 <https://github.com/numpy/numpy/pull/10178>`__: MAINT: Prepare master for 1.15 development. +* `#10186 <https://github.com/numpy/numpy/pull/10186>`__: MAINT: Move histogram and histogramdd into their own module +* `#10187 <https://github.com/numpy/numpy/pull/10187>`__: BUG: Extra space is inserted on first line for long elements +* `#10192 <https://github.com/numpy/numpy/pull/10192>`__: DEP: Deprecate the pickle aliases +* `#10193 <https://github.com/numpy/numpy/pull/10193>`__: BUG: Fix bugs found by testing in release mode. +* `#10194 <https://github.com/numpy/numpy/pull/10194>`__: BUG, MAINT: Ufunc reduce reference leak +* `#10195 <https://github.com/numpy/numpy/pull/10195>`__: DOC: Fixup percentile docstring, from review in gh-9213 +* `#10196 <https://github.com/numpy/numpy/pull/10196>`__: BUG: Fix regression in np.ma.load in gh-10055 +* `#10199 <https://github.com/numpy/numpy/pull/10199>`__: ENH: Quantile +* `#10203 <https://github.com/numpy/numpy/pull/10203>`__: MAINT: Update development branch version to 1.15.0. +* `#10205 <https://github.com/numpy/numpy/pull/10205>`__: BUG: Handle NaNs correctly in arange +* `#10207 <https://github.com/numpy/numpy/pull/10207>`__: ENH: Allow `np.r_` to accept 0d arrays +* `#10208 <https://github.com/numpy/numpy/pull/10208>`__: MAINT: Improve error message for void(-1) +* `#10210 <https://github.com/numpy/numpy/pull/10210>`__: DOC: change 'a'->'prototype' in empty_like docs (addresses #10209) +* `#10211 <https://github.com/numpy/numpy/pull/10211>`__: MAINT,ENH: remove MaskedArray.astype, as the base type does everything. +* `#10212 <https://github.com/numpy/numpy/pull/10212>`__: DOC: fix minor typos +* `#10213 <https://github.com/numpy/numpy/pull/10213>`__: ENH: Set up proposed NEP process +* `#10214 <https://github.com/numpy/numpy/pull/10214>`__: DOC: add warning to isclose function +* `#10216 <https://github.com/numpy/numpy/pull/10216>`__: BUG: Fix broken format string picked up by LGTM.com +* `#10220 <https://github.com/numpy/numpy/pull/10220>`__: DOC: clarify that np.absolute == np.abs +* `#10223 <https://github.com/numpy/numpy/pull/10223>`__: ENH: added masked version of 'numpy.stack' with tests. +* `#10225 <https://github.com/numpy/numpy/pull/10225>`__: ENH: distutils: parallelize builds by default +* `#10226 <https://github.com/numpy/numpy/pull/10226>`__: BUG: distutils: use correct top-level package name +* `#10229 <https://github.com/numpy/numpy/pull/10229>`__: BUG: distutils: fix extra DLL loading in certain scenarios +* `#10231 <https://github.com/numpy/numpy/pull/10231>`__: BUG: Fix sign-compare warnings in datetime.c and datetime_strings.c. +* `#10232 <https://github.com/numpy/numpy/pull/10232>`__: BUG: Don't reimplement isclose in np.ma +* `#10237 <https://github.com/numpy/numpy/pull/10237>`__: DOC: give correct version of np.nansum change +* `#10241 <https://github.com/numpy/numpy/pull/10241>`__: MAINT: Avoid repeated validation of percentiles in nanpercentile +* `#10247 <https://github.com/numpy/numpy/pull/10247>`__: MAINT: fix typo +* `#10248 <https://github.com/numpy/numpy/pull/10248>`__: DOC: Add installation notes for Linux users +* `#10249 <https://github.com/numpy/numpy/pull/10249>`__: MAINT: Fix tests failures on travis CI merge. +* `#10250 <https://github.com/numpy/numpy/pull/10250>`__: MAINT: Check for `__array_ufunc__` before doing anything else. +* `#10251 <https://github.com/numpy/numpy/pull/10251>`__: ENH: Enable AVX2/AVX512 support to numpy +* `#10252 <https://github.com/numpy/numpy/pull/10252>`__: MAINT: Workaround for new travis sdist failures. +* `#10255 <https://github.com/numpy/numpy/pull/10255>`__: MAINT: Fix loop and simd sign-compare warnings. +* `#10257 <https://github.com/numpy/numpy/pull/10257>`__: BUG: duplicate message print if warning raises an exception +* `#10259 <https://github.com/numpy/numpy/pull/10259>`__: BUG: Make sure einsum default value of `optimize` is True. +* `#10260 <https://github.com/numpy/numpy/pull/10260>`__: ENH: Add pytest support +* `#10261 <https://github.com/numpy/numpy/pull/10261>`__: MAINT: Extract helper functions from histogram +* `#10262 <https://github.com/numpy/numpy/pull/10262>`__: DOC: Add missing release note for #10207 +* `#10263 <https://github.com/numpy/numpy/pull/10263>`__: BUG: Fix strange behavior of infinite-step-size/underflow-case... +* `#10264 <https://github.com/numpy/numpy/pull/10264>`__: MAINT: Fix (some) yield warnings +* `#10266 <https://github.com/numpy/numpy/pull/10266>`__: BUG: distutils: fix locale decoding errors +* `#10268 <https://github.com/numpy/numpy/pull/10268>`__: BUG: Fix misleading error when coercing to array +* `#10269 <https://github.com/numpy/numpy/pull/10269>`__: MAINT: extract private helper function to compute histogram bin... +* `#10271 <https://github.com/numpy/numpy/pull/10271>`__: BUG: Allow nan values in the data when the bins are explicit +* `#10278 <https://github.com/numpy/numpy/pull/10278>`__: ENH: Add support for datetimes to histograms +* `#10282 <https://github.com/numpy/numpy/pull/10282>`__: MAINT: Extract helper function for last-bound-inclusive search_sorted +* `#10283 <https://github.com/numpy/numpy/pull/10283>`__: MAINT: Fallback on the default sequence multiplication behavior +* `#10284 <https://github.com/numpy/numpy/pull/10284>`__: MAINT/BUG: Tidy gen_umath +* `#10286 <https://github.com/numpy/numpy/pull/10286>`__: BUG: Fix memory leak (#10157). +* `#10287 <https://github.com/numpy/numpy/pull/10287>`__: ENH: Allow ptp to take an axis tuple and keepdims +* `#10292 <https://github.com/numpy/numpy/pull/10292>`__: BUG: Masked singleton can be reshaped to be non-scalar +* `#10293 <https://github.com/numpy/numpy/pull/10293>`__: MAINT: Fix sign-compare warnings in mem_overlap.c. +* `#10294 <https://github.com/numpy/numpy/pull/10294>`__: MAINT: pytest cleanups +* `#10298 <https://github.com/numpy/numpy/pull/10298>`__: DOC: Explain np.digitize and np.searchsorted more clearly +* `#10300 <https://github.com/numpy/numpy/pull/10300>`__: MAINT, DOC: Documentation and misc. typos +* `#10303 <https://github.com/numpy/numpy/pull/10303>`__: MAINT: Array wrap/prepare identification cleanup +* `#10309 <https://github.com/numpy/numpy/pull/10309>`__: MAINT: deduplicate check_nonreorderable_axes +* `#10314 <https://github.com/numpy/numpy/pull/10314>`__: BUG: Ensure `__array_finalize__` cannot back-mangle shape +* `#10316 <https://github.com/numpy/numpy/pull/10316>`__: DOC: add documentation about how to handle new array printing +* `#10320 <https://github.com/numpy/numpy/pull/10320>`__: BUG: skip the extra-dll directory when there are no DLLS +* `#10323 <https://github.com/numpy/numpy/pull/10323>`__: MAINT: Remove duplicated code for promoting dtype and array types. +* `#10324 <https://github.com/numpy/numpy/pull/10324>`__: BUG: Fix crashes when using float32 values in uniform histograms +* `#10325 <https://github.com/numpy/numpy/pull/10325>`__: MAINT: Replace manual expansion of PyArray_MinScalarType with... +* `#10327 <https://github.com/numpy/numpy/pull/10327>`__: MAINT: Fix misc. typos +* `#10333 <https://github.com/numpy/numpy/pull/10333>`__: DOC: typo fix in numpy.linalg.det docstring +* `#10334 <https://github.com/numpy/numpy/pull/10334>`__: DOC: Fix typos in docs for partition method +* `#10336 <https://github.com/numpy/numpy/pull/10336>`__: DOC: Post 1.14.0 release updates. +* `#10337 <https://github.com/numpy/numpy/pull/10337>`__: ENH: Show the silenced error and traceback in warning `__cause__` +* `#10341 <https://github.com/numpy/numpy/pull/10341>`__: BUG: fix config where PATH isn't set on win32 +* `#10342 <https://github.com/numpy/numpy/pull/10342>`__: BUG: arrays not being flattened in `union1d` +* `#10346 <https://github.com/numpy/numpy/pull/10346>`__: ENH: Check matching inputs/outputs in umath generation +* `#10352 <https://github.com/numpy/numpy/pull/10352>`__: BUG: Fix einsum optimize logic for singleton dimensions +* `#10354 <https://github.com/numpy/numpy/pull/10354>`__: BUG: fix error message not formatted in einsum +* `#10359 <https://github.com/numpy/numpy/pull/10359>`__: BUG: do not optimize einsum with only 2 arguments. +* `#10361 <https://github.com/numpy/numpy/pull/10361>`__: BUG: complex repr has extra spaces, missing + +* `#10362 <https://github.com/numpy/numpy/pull/10362>`__: MAINT: Update download URL in setup.py. +* `#10367 <https://github.com/numpy/numpy/pull/10367>`__: BUG: add missing paren and remove quotes from repr of fieldless... +* `#10371 <https://github.com/numpy/numpy/pull/10371>`__: BUG: fix einsum issue with unicode input and py2 +* `#10381 <https://github.com/numpy/numpy/pull/10381>`__: BUG/ENH: Improve output for structured non-void types +* `#10388 <https://github.com/numpy/numpy/pull/10388>`__: ENH: Add types for int and uint of explicit sizes to swig. +* `#10390 <https://github.com/numpy/numpy/pull/10390>`__: MAINT: Adjust type promotion in linalg.norm +* `#10391 <https://github.com/numpy/numpy/pull/10391>`__: BUG: Make dtype.descr error for out-of-order fields +* `#10392 <https://github.com/numpy/numpy/pull/10392>`__: DOC: Document behaviour of `np.concatenate` with `axis=None` +* `#10401 <https://github.com/numpy/numpy/pull/10401>`__: BUG: Resize bytes_ columns in genfromtxt +* `#10402 <https://github.com/numpy/numpy/pull/10402>`__: DOC: added "steals a reference" to PyArray_FromAny +* `#10406 <https://github.com/numpy/numpy/pull/10406>`__: ENH: add `np.printoptions`, a context manager +* `#10411 <https://github.com/numpy/numpy/pull/10411>`__: BUG: Revert multifield-indexing adds padding bytes for NumPy... +* `#10412 <https://github.com/numpy/numpy/pull/10412>`__: ENH: Fix repr of np.record objects to match np.void types +* `#10414 <https://github.com/numpy/numpy/pull/10414>`__: MAINT: Fix sign-compare warnings in umath_linalg. +* `#10415 <https://github.com/numpy/numpy/pull/10415>`__: MAINT: Fix sign-compare warnings in npy_binsearch, npy_partition. +* `#10416 <https://github.com/numpy/numpy/pull/10416>`__: MAINT: Fix sign-compare warnings in dragon4.c. +* `#10418 <https://github.com/numpy/numpy/pull/10418>`__: MAINT: Remove repeated #ifdefs implementing `isinstance(x, basestring)`... +* `#10420 <https://github.com/numpy/numpy/pull/10420>`__: DOC: Fix version added labels in numpy.unique docs +* `#10421 <https://github.com/numpy/numpy/pull/10421>`__: DOC: Fix type of axis in nanfunctions +* `#10423 <https://github.com/numpy/numpy/pull/10423>`__: MAINT: Update zesty to artful for i386 testing +* `#10426 <https://github.com/numpy/numpy/pull/10426>`__: DOC: Add version when linalg.norm accepted axis +* `#10427 <https://github.com/numpy/numpy/pull/10427>`__: DOC: Fix typo in docs for argpartition +* `#10430 <https://github.com/numpy/numpy/pull/10430>`__: MAINT: Use ValueError for duplicate field names in lookup +* `#10433 <https://github.com/numpy/numpy/pull/10433>`__: DOC: Add 1.14.1 release notes template (forward port) +* `#10434 <https://github.com/numpy/numpy/pull/10434>`__: MAINT: Move `tools/announce.py` to `tools/changelog.py`. +* `#10441 <https://github.com/numpy/numpy/pull/10441>`__: BUG: Fix nan_to_num return with integer input +* `#10443 <https://github.com/numpy/numpy/pull/10443>`__: BUG: Fix various Big-Endian test failures (ppc64) +* `#10444 <https://github.com/numpy/numpy/pull/10444>`__: MAINT: Implement float128 dragon4 for IBM double-double (ppc64) +* `#10451 <https://github.com/numpy/numpy/pull/10451>`__: BUG: prevent the MSVC 14.1 compiler (Visual Studio 2017) from... +* `#10453 <https://github.com/numpy/numpy/pull/10453>`__: Revert "BUG: prevent the MSVC 14.1 compiler (Visual Studio 2017)... +* `#10458 <https://github.com/numpy/numpy/pull/10458>`__: BLD: Use zip_safe=False in setup() call +* `#10459 <https://github.com/numpy/numpy/pull/10459>`__: MAINT: Remove duplicated logic between array_wrap and array_prepare +* `#10463 <https://github.com/numpy/numpy/pull/10463>`__: ENH: Add entry_points for f2py, conv_template, and from_template. +* `#10465 <https://github.com/numpy/numpy/pull/10465>`__: MAINT: Fix miscellaneous sign-compare warnings. +* `#10472 <https://github.com/numpy/numpy/pull/10472>`__: DOC: Document A@B in Matlab/NumPy summary table +* `#10473 <https://github.com/numpy/numpy/pull/10473>`__: BUG: Fixed polydiv for Complex Numbers +* `#10475 <https://github.com/numpy/numpy/pull/10475>`__: DOC: Add CircleCI builder for devdocs +* `#10476 <https://github.com/numpy/numpy/pull/10476>`__: DOC: fix formatting in interp example +* `#10477 <https://github.com/numpy/numpy/pull/10477>`__: BUG: Align type definition with generated lapack +* `#10478 <https://github.com/numpy/numpy/pull/10478>`__: DOC: Minor punctuation cleanups and improved explanation. +* `#10479 <https://github.com/numpy/numpy/pull/10479>`__: BUG: Fix calling ufuncs with a positional output argument. +* `#10482 <https://github.com/numpy/numpy/pull/10482>`__: BUG: Add missing DECREF in Py2 int() cast +* `#10484 <https://github.com/numpy/numpy/pull/10484>`__: MAINT: Remove unused code path for applying maskedarray domains... +* `#10497 <https://github.com/numpy/numpy/pull/10497>`__: DOC: Tell matlab users about np.block +* `#10498 <https://github.com/numpy/numpy/pull/10498>`__: MAINT: Remove special cases in np.unique +* `#10501 <https://github.com/numpy/numpy/pull/10501>`__: BUG: fromregex: asbytes called on regexp objects +* `#10502 <https://github.com/numpy/numpy/pull/10502>`__: MAINT: Use AxisError in swapaxes, unique, and diagonal +* `#10503 <https://github.com/numpy/numpy/pull/10503>`__: BUG: Fix unused-result warning. +* `#10506 <https://github.com/numpy/numpy/pull/10506>`__: MAINT: Delete unused `_build_utils/common.py` +* `#10508 <https://github.com/numpy/numpy/pull/10508>`__: BUG: Add missing `#define _MULTIARRAYMODULE` to vdot.c +* `#10509 <https://github.com/numpy/numpy/pull/10509>`__: MAINT: Use new-style format strings for clarity +* `#10516 <https://github.com/numpy/numpy/pull/10516>`__: MAINT: Allow errors to escape from InitOperators +* `#10518 <https://github.com/numpy/numpy/pull/10518>`__: ENH: Add a repr to np._NoValue +* `#10522 <https://github.com/numpy/numpy/pull/10522>`__: MAINT: Remove the unmaintained umath ``__version__`` constant. +* `#10524 <https://github.com/numpy/numpy/pull/10524>`__: BUG: fix np.save issue with python 2.7.5 +* `#10529 <https://github.com/numpy/numpy/pull/10529>`__: BUG: Provide a better error message for out-of-order fields +* `#10543 <https://github.com/numpy/numpy/pull/10543>`__: DEP: Issue FutureWarning when malformed records detected. +* `#10544 <https://github.com/numpy/numpy/pull/10544>`__: BUG: infinite recursion in str of 0d subclasses +* `#10546 <https://github.com/numpy/numpy/pull/10546>`__: BUG: In numpy.i, clear CARRAY flag if wrapped buffer is not C_CONTIGUOUS. +* `#10547 <https://github.com/numpy/numpy/pull/10547>`__: DOC: Fix incorrect formula in gradient docstring. +* `#10548 <https://github.com/numpy/numpy/pull/10548>`__: BUG: Set missing exception after malloc +* `#10549 <https://github.com/numpy/numpy/pull/10549>`__: ENH: Make NpzFile conform to the Mapping protocol +* `#10553 <https://github.com/numpy/numpy/pull/10553>`__: MAINT: Cleanups to promote_types and result_types +* `#10554 <https://github.com/numpy/numpy/pull/10554>`__: DOC: promote_types is not associative by design, +* `#10555 <https://github.com/numpy/numpy/pull/10555>`__: BUG: Add missing PyErr_NoMemory() after malloc +* `#10564 <https://github.com/numpy/numpy/pull/10564>`__: BUG: Provide correct format in Py_buffer for scalars +* `#10566 <https://github.com/numpy/numpy/pull/10566>`__: BUG: Fix travis failure in previous commit +* `#10571 <https://github.com/numpy/numpy/pull/10571>`__: BUG: Fix corner-case behavior of cond() and use SVD when possible +* `#10576 <https://github.com/numpy/numpy/pull/10576>`__: MAINT: Fix misc. documentation typos +* `#10583 <https://github.com/numpy/numpy/pull/10583>`__: MAINT: Fix typos in DISTUTILS.rst.txt. +* `#10588 <https://github.com/numpy/numpy/pull/10588>`__: BUG: Revert sort optimization in np.unique. +* `#10589 <https://github.com/numpy/numpy/pull/10589>`__: BUG: fix entry_points typo for from-template +* `#10591 <https://github.com/numpy/numpy/pull/10591>`__: ENH: Add histogram_bin_edges function and test +* `#10592 <https://github.com/numpy/numpy/pull/10592>`__: DOC: Corrected url for Guide to NumPy book; see part of #8520,... +* `#10596 <https://github.com/numpy/numpy/pull/10596>`__: MAINT: Update sphinxext submodule hash. +* `#10599 <https://github.com/numpy/numpy/pull/10599>`__: ENH: Make flatnonzero call asanyarray before ravel() +* `#10603 <https://github.com/numpy/numpy/pull/10603>`__: MAINT: Improve error message in histogram. +* `#10604 <https://github.com/numpy/numpy/pull/10604>`__: MAINT: Fix Misc. typos +* `#10606 <https://github.com/numpy/numpy/pull/10606>`__: MAINT: Do not use random roots when testing roots. +* `#10618 <https://github.com/numpy/numpy/pull/10618>`__: MAINT: Stop using non-tuple indices internally +* `#10619 <https://github.com/numpy/numpy/pull/10619>`__: BUG: np.ma.flatnotmasked_contiguous behaves differently on mask=nomask... +* `#10621 <https://github.com/numpy/numpy/pull/10621>`__: BUG: deallocate recursive closure in arrayprint.py +* `#10623 <https://github.com/numpy/numpy/pull/10623>`__: BUG: Correctly identify comma seperated dtype strings +* `#10625 <https://github.com/numpy/numpy/pull/10625>`__: BUG: Improve the accuracy of the FFT implementation +* `#10635 <https://github.com/numpy/numpy/pull/10635>`__: ENH: Implement initial kwarg for ufunc.add.reduce +* `#10641 <https://github.com/numpy/numpy/pull/10641>`__: MAINT: Post 1.14.1 release updates for master branch +* `#10650 <https://github.com/numpy/numpy/pull/10650>`__: BUG: Fix missing NPY_VISIBILITY_HIDDEN on npy_longdouble_to_PyLong +* `#10653 <https://github.com/numpy/numpy/pull/10653>`__: MAINT: Remove duplicate implementation for aliased functions. +* `#10657 <https://github.com/numpy/numpy/pull/10657>`__: BUG: f2py: fix f2py generated code to work on Pypy +* `#10658 <https://github.com/numpy/numpy/pull/10658>`__: BUG: Make np.partition and np.sort work on np.matrix when axis=None +* `#10660 <https://github.com/numpy/numpy/pull/10660>`__: BUG/MAINT: Remove special cases for 0d arrays in interp +* `#10661 <https://github.com/numpy/numpy/pull/10661>`__: MAINT: Unify reductions in fromnumeric.py +* `#10665 <https://github.com/numpy/numpy/pull/10665>`__: ENH: umath: don't make temporary copies for in-place accumulation +* `#10666 <https://github.com/numpy/numpy/pull/10666>`__: BUG: fix complex casting error in cov with aweights +* `#10669 <https://github.com/numpy/numpy/pull/10669>`__: MAINT: Covariance must be symmetric as well as positive-semidefinite. +* `#10670 <https://github.com/numpy/numpy/pull/10670>`__: DEP: Deprecate np.sum(generator) +* `#10671 <https://github.com/numpy/numpy/pull/10671>`__: DOC/MAINT: More misc. typos +* `#10672 <https://github.com/numpy/numpy/pull/10672>`__: ENH: Allow dtype field names to be ascii encoded unicode in Python2 +* `#10676 <https://github.com/numpy/numpy/pull/10676>`__: BUG: F2py mishandles quoted control characters +* `#10677 <https://github.com/numpy/numpy/pull/10677>`__: STY: Minor stylistic cleanup of numeric.py +* `#10679 <https://github.com/numpy/numpy/pull/10679>`__: DOC: zeros, empty, and ones now have consistent docstrings +* `#10684 <https://github.com/numpy/numpy/pull/10684>`__: ENH: Modify intersect1d to return common indices +* `#10689 <https://github.com/numpy/numpy/pull/10689>`__: BLD: Add configuration changes to allow cross platform builds... +* `#10691 <https://github.com/numpy/numpy/pull/10691>`__: DOC: add versionadded for NDArrayOperatorsMixin. +* `#10694 <https://github.com/numpy/numpy/pull/10694>`__: DOC: Improve docstring of memmap +* `#10698 <https://github.com/numpy/numpy/pull/10698>`__: BUG: Further back-compat fix for subclassed array repr (forward... +* `#10699 <https://github.com/numpy/numpy/pull/10699>`__: DOC: Grammar of np.gradient docstring +* `#10702 <https://github.com/numpy/numpy/pull/10702>`__: TST, DOC: Upload devdocs and neps after circleci build +* `#10703 <https://github.com/numpy/numpy/pull/10703>`__: MAINT: NEP process updates +* `#10708 <https://github.com/numpy/numpy/pull/10708>`__: BUG: fix problem with modifing pyf lines containing ';' in f2py +* `#10710 <https://github.com/numpy/numpy/pull/10710>`__: BUG: fix error message in numpy.select +* `#10711 <https://github.com/numpy/numpy/pull/10711>`__: MAINT: Hard tab and whitespace cleanup. +* `#10715 <https://github.com/numpy/numpy/pull/10715>`__: MAINT: Fixed C++ guard in f2py test. +* `#10716 <https://github.com/numpy/numpy/pull/10716>`__: BUG: dragon4 fractional output mode adds too many trailing zeros +* `#10718 <https://github.com/numpy/numpy/pull/10718>`__: BUG: Fix bug in asserting near equality of float16 arrays. +* `#10719 <https://github.com/numpy/numpy/pull/10719>`__: DOC: add documentation for constants +* `#10720 <https://github.com/numpy/numpy/pull/10720>`__: BUG: distutils: Remove named templates from the processed output... +* `#10722 <https://github.com/numpy/numpy/pull/10722>`__: MAINT: Misc small fixes. +* `#10730 <https://github.com/numpy/numpy/pull/10730>`__: DOC: Fix minor typo in how-to-document. +* `#10732 <https://github.com/numpy/numpy/pull/10732>`__: BUG: Fix `setup.py build install egg_info`, which did not previously... +* `#10734 <https://github.com/numpy/numpy/pull/10734>`__: DOC: Post 1.14.2 release update. +* `#10737 <https://github.com/numpy/numpy/pull/10737>`__: MAINT: Fix low-hanging PyPy compatibility issues +* `#10739 <https://github.com/numpy/numpy/pull/10739>`__: BUG: Fix histogram bins="auto" for data with little variance +* `#10740 <https://github.com/numpy/numpy/pull/10740>`__: MAINT, TST: Fixes for Python 3.7 +* `#10743 <https://github.com/numpy/numpy/pull/10743>`__: MAINT: Import abstract classes from collections.abc +* `#10745 <https://github.com/numpy/numpy/pull/10745>`__: ENH: Add object loops to the comparison ufuncs +* `#10746 <https://github.com/numpy/numpy/pull/10746>`__: MAINT: Fix typo in warning message +* `#10748 <https://github.com/numpy/numpy/pull/10748>`__: DOC: a.size and np.prod(a.shape) are not equivalent +* `#10750 <https://github.com/numpy/numpy/pull/10750>`__: DOC: Add graph showing different behaviors of np.percentile +* `#10755 <https://github.com/numpy/numpy/pull/10755>`__: DOC: Move bin estimator documentation from `histogram` to `histogram_bin_edges` +* `#10758 <https://github.com/numpy/numpy/pull/10758>`__: TST: Change most travisci tests to Python3.6. +* `#10763 <https://github.com/numpy/numpy/pull/10763>`__: BUG: floating types should override tp_print +* `#10766 <https://github.com/numpy/numpy/pull/10766>`__: MAINT: Remove the unused scalarmath getters for fmod and sqrt +* `#10773 <https://github.com/numpy/numpy/pull/10773>`__: BUG: Use dummy_threading on platforms that don't support threading +* `#10774 <https://github.com/numpy/numpy/pull/10774>`__: BUG: Fix SQRT_MIN for platforms with 8-byte long double +* `#10775 <https://github.com/numpy/numpy/pull/10775>`__: BUG: Return NULL from PyInit_* when exception is raised +* `#10777 <https://github.com/numpy/numpy/pull/10777>`__: MAINT: Remove use of unittest in NumPy tests. +* `#10778 <https://github.com/numpy/numpy/pull/10778>`__: BUG: test, fix for missing flags['WRITEBACKIFCOPY'] key +* `#10781 <https://github.com/numpy/numpy/pull/10781>`__: ENH: NEP index builder +* `#10785 <https://github.com/numpy/numpy/pull/10785>`__: DOC: Fixed author name in reference to book +* `#10786 <https://github.com/numpy/numpy/pull/10786>`__: ENH: Add "stablesort" option to inp.sort as an alias for "mergesort". +* `#10790 <https://github.com/numpy/numpy/pull/10790>`__: TST: Various fixes prior to switching to pytest +* `#10795 <https://github.com/numpy/numpy/pull/10795>`__: BUG: Allow spaces in output string of einsum +* `#10796 <https://github.com/numpy/numpy/pull/10796>`__: BUG: fix wrong inplace vectorization on overlapping arguments +* `#10798 <https://github.com/numpy/numpy/pull/10798>`__: BUG: error checking before mapping of einsum axes. +* `#10800 <https://github.com/numpy/numpy/pull/10800>`__: DOC: Add remarks about array vs scalar output to every ufunc +* `#10802 <https://github.com/numpy/numpy/pull/10802>`__: BUG/DOC/MAINT: Tidy up histogramdd +* `#10807 <https://github.com/numpy/numpy/pull/10807>`__: DOC: Update link to tox in development docs (#10806) +* `#10812 <https://github.com/numpy/numpy/pull/10812>`__: MAINT: Rearrange `numpy/testing` files +* `#10814 <https://github.com/numpy/numpy/pull/10814>`__: BUG: verify the OS supports avx instruction +* `#10822 <https://github.com/numpy/numpy/pull/10822>`__: BUG: fixes exception in numpy.genfromtxt, see #10780 +* `#10824 <https://github.com/numpy/numpy/pull/10824>`__: BUG: test, fix PyArray_DiscardWritebackIfCopy refcount issue... +* `#10826 <https://github.com/numpy/numpy/pull/10826>`__: BUG: np.squeeze() now respects older API axis expectation +* `#10827 <https://github.com/numpy/numpy/pull/10827>`__: ENH: Add tester for pytest. +* `#10828 <https://github.com/numpy/numpy/pull/10828>`__: BUG: fix obvious mistake in testing/decorators warning. +* `#10829 <https://github.com/numpy/numpy/pull/10829>`__: BLD: use Python 3.6 instead of 2.7 as default for doc build. +* `#10830 <https://github.com/numpy/numpy/pull/10830>`__: BUG: Fix obvious warning bugs. +* `#10831 <https://github.com/numpy/numpy/pull/10831>`__: DOC: Fix minor typos +* `#10832 <https://github.com/numpy/numpy/pull/10832>`__: ENH: datetime64: support AC dates starting with '+' +* `#10833 <https://github.com/numpy/numpy/pull/10833>`__: ENH: Add support for the 64-bit RISC-V architecture +* `#10834 <https://github.com/numpy/numpy/pull/10834>`__: DOC: note that NDEBUG should be set when OPT should increase... +* `#10836 <https://github.com/numpy/numpy/pull/10836>`__: MAINT: Fix script name for pushing NEP docs to repo +* `#10840 <https://github.com/numpy/numpy/pull/10840>`__: MAINT: Fix typo in code example. +* `#10842 <https://github.com/numpy/numpy/pull/10842>`__: TST: Switch to pytest +* `#10849 <https://github.com/numpy/numpy/pull/10849>`__: DOC: fix examples in docstring for np.flip +* `#10850 <https://github.com/numpy/numpy/pull/10850>`__: DEP: Issue deprecation warnings for some imports. +* `#10858 <https://github.com/numpy/numpy/pull/10858>`__: MAINT: Post pytest switch cleanup +* `#10859 <https://github.com/numpy/numpy/pull/10859>`__: MAINT: Remove yield tests +* `#10860 <https://github.com/numpy/numpy/pull/10860>`__: BUG: core: fix NPY_TITLE_KEY macro on pypy +* `#10863 <https://github.com/numpy/numpy/pull/10863>`__: MAINT: More Histogramdd cleanup +* `#10867 <https://github.com/numpy/numpy/pull/10867>`__: DOC: Cross Link full/full_like in a few see-also sections. +* `#10869 <https://github.com/numpy/numpy/pull/10869>`__: BUG: Fix encoding regression in ma/bench.py (Issue #10868) +* `#10871 <https://github.com/numpy/numpy/pull/10871>`__: MAINT: Remove unnecessary special case in np.histogramdd for... +* `#10872 <https://github.com/numpy/numpy/pull/10872>`__: ENH: Extend np.flip to work over multiple axes +* `#10874 <https://github.com/numpy/numpy/pull/10874>`__: DOC: State in docstring that lexsort is stable (#10873). +* `#10875 <https://github.com/numpy/numpy/pull/10875>`__: BUG: fix savetxt, loadtxt for '+-' in complex +* `#10878 <https://github.com/numpy/numpy/pull/10878>`__: DOC: rework documents and silence warnings during sphinx build +* `#10882 <https://github.com/numpy/numpy/pull/10882>`__: BUG: have `_array_from_buffer_3118` correctly handle errors +* `#10883 <https://github.com/numpy/numpy/pull/10883>`__: DOC: Fix negative binomial documentation. +* `#10885 <https://github.com/numpy/numpy/pull/10885>`__: TST: Re-enable test display on appveyor +* `#10890 <https://github.com/numpy/numpy/pull/10890>`__: MAINT: lstsq: compute residuals inside the ufunc +* `#10891 <https://github.com/numpy/numpy/pull/10891>`__: TST: Extract a helper function to test for reference cycles +* `#10898 <https://github.com/numpy/numpy/pull/10898>`__: ENH: Have dtype transfer for equivalent user dtypes prefer user-defined... +* `#10901 <https://github.com/numpy/numpy/pull/10901>`__: DOC, BUG : Bad link to `np.random.randint` +* `#10903 <https://github.com/numpy/numpy/pull/10903>`__: DOC: Fix link in `See Also` section of `randn` docstring. +* `#10907 <https://github.com/numpy/numpy/pull/10907>`__: TST: reactivate module docstring tests, fix float formatting +* `#10911 <https://github.com/numpy/numpy/pull/10911>`__: BUG: Fix casting between npy_half and float in einsum +* `#10916 <https://github.com/numpy/numpy/pull/10916>`__: BUG: Add missing underscore to prototype in check_embedded_lapack +* `#10919 <https://github.com/numpy/numpy/pull/10919>`__: BUG: Pass non-None outputs to `__array_prepare__` and `__array_wrap__` +* `#10921 <https://github.com/numpy/numpy/pull/10921>`__: DOC: clear up warnings, fix matplotlib plot +* `#10923 <https://github.com/numpy/numpy/pull/10923>`__: BUG: fixed dtype alignment for array of structs in case of converting... +* `#10925 <https://github.com/numpy/numpy/pull/10925>`__: DOC: Fix typos in 1.15.0 changelog +* `#10936 <https://github.com/numpy/numpy/pull/10936>`__: DOC: Fix NumpyVersion example (closes gh-10935) +* `#10938 <https://github.com/numpy/numpy/pull/10938>`__: MAINT: One step closer to vectorizing lstsq +* `#10940 <https://github.com/numpy/numpy/pull/10940>`__: DOC: fix broken links for developer documentation +* `#10943 <https://github.com/numpy/numpy/pull/10943>`__: ENH: Add a search box to the sidebar in the docs +* `#10945 <https://github.com/numpy/numpy/pull/10945>`__: MAINT: Remove references to the 2008 documentation marathon +* `#10946 <https://github.com/numpy/numpy/pull/10946>`__: BUG: 'style' arg to array2string broken in legacy mode +* `#10949 <https://github.com/numpy/numpy/pull/10949>`__: DOC: cleanup documentation, continuation of nditer PR #9998 +* `#10951 <https://github.com/numpy/numpy/pull/10951>`__: BUG: it.close() disallows access to iterator, fixes #10950 +* `#10953 <https://github.com/numpy/numpy/pull/10953>`__: MAINT: address extraneous shape tuple checks in descriptor.c +* `#10958 <https://github.com/numpy/numpy/pull/10958>`__: MAINT, DOC: Fix typos +* `#10967 <https://github.com/numpy/numpy/pull/10967>`__: DOC: add quantile, nanquantile to toc +* `#10970 <https://github.com/numpy/numpy/pull/10970>`__: WIP: Remove fragile use of `__array_interface__` in ctypeslib.as_array +* `#10971 <https://github.com/numpy/numpy/pull/10971>`__: MAINT: Remove workaround for gh-10891 +* `#10973 <https://github.com/numpy/numpy/pull/10973>`__: DOC: advise against use of matrix. +* `#10975 <https://github.com/numpy/numpy/pull/10975>`__: MAINT: move linalg tests using matrix to matrixlib +* `#10980 <https://github.com/numpy/numpy/pull/10980>`__: DOC: link to governance, convert external link to internal +* `#10984 <https://github.com/numpy/numpy/pull/10984>`__: MAINT: Added pytest cache folder to .gitignore +* `#10985 <https://github.com/numpy/numpy/pull/10985>`__: MAINT, ENH: Move matrix_power to linalg and allow higher dimensions. +* `#10986 <https://github.com/numpy/numpy/pull/10986>`__: MAINT: move all masked array matrix tests to matrixlib. +* `#10987 <https://github.com/numpy/numpy/pull/10987>`__: DOC: Correction to docstring example (result was correct) +* `#10988 <https://github.com/numpy/numpy/pull/10988>`__: MAINT: Small tidy-ups to ufunc_object.c +* `#10991 <https://github.com/numpy/numpy/pull/10991>`__: DOC: Update genfromtxt docs to use StringIO and u-strings +* `#10996 <https://github.com/numpy/numpy/pull/10996>`__: DOC: Make doc examples using StringIO python2-3 compatible +* `#11003 <https://github.com/numpy/numpy/pull/11003>`__: DOC: work around GH isaacs/github#316 to show SVG image +* `#11005 <https://github.com/numpy/numpy/pull/11005>`__: MAINT: Misc. typos +* `#11006 <https://github.com/numpy/numpy/pull/11006>`__: TST, BUILD: add latex to circleci doc build +* `#11008 <https://github.com/numpy/numpy/pull/11008>`__: REL: Fwd port 1.14.3 changelog +* `#11009 <https://github.com/numpy/numpy/pull/11009>`__: DOC: release walkthrough updates from 1.14.3 +* `#11010 <https://github.com/numpy/numpy/pull/11010>`__: Move remaining Matrix tests to matrixlib +* `#11011 <https://github.com/numpy/numpy/pull/11011>`__: MAINT: Simplify dimension-juggling in np.pad +* `#11012 <https://github.com/numpy/numpy/pull/11012>`__: MAINT: np.pad: Add helper functions for producing slices along... +* `#11018 <https://github.com/numpy/numpy/pull/11018>`__: ENH: Implement axis for generalized ufuncs. +* `#11023 <https://github.com/numpy/numpy/pull/11023>`__: BUG: np.histogramdd loses precision on its inputs, leading to... +* `#11026 <https://github.com/numpy/numpy/pull/11026>`__: MAINT: reduce code duplication in ufunc_frompyfunc +* `#11033 <https://github.com/numpy/numpy/pull/11033>`__: BUG: Fix padding with large integers +* `#11036 <https://github.com/numpy/numpy/pull/11036>`__: BUG: optimizing compilers can reorder call to npy_get_floatstatus +* `#11037 <https://github.com/numpy/numpy/pull/11037>`__: BUG: initialize value before use +* `#11038 <https://github.com/numpy/numpy/pull/11038>`__: ENH: Add `__deepcopy__` to MaskedConstant +* `#11043 <https://github.com/numpy/numpy/pull/11043>`__: BUG: reduce using SSE only warns if inside SSE loop +* `#11050 <https://github.com/numpy/numpy/pull/11050>`__: BUG: remove fast scalar power for arrays with object dtype +* `#11053 <https://github.com/numpy/numpy/pull/11053>`__: DOC: bump scipy-sphinx-theme to current version +* `#11055 <https://github.com/numpy/numpy/pull/11055>`__: DOC: Add explanation for comments=None in loadtxt. +* `#11056 <https://github.com/numpy/numpy/pull/11056>`__: MAINT: Improve performance of random permutation +* `#11057 <https://github.com/numpy/numpy/pull/11057>`__: BUG: use absolute imports in test files +* `#11066 <https://github.com/numpy/numpy/pull/11066>`__: MAINT: `distutils.system_info`: handle Accelerate like any other... +* `#11073 <https://github.com/numpy/numpy/pull/11073>`__: DOC: expand reasoning behind npy_*floatstatus_barrer() +* `#11076 <https://github.com/numpy/numpy/pull/11076>`__: BUG: Ensure `PyArray_AssignRawScalar` respects `NPY_NEEDS_INIT` +* `#11082 <https://github.com/numpy/numpy/pull/11082>`__: DOC: link to updated module docstring, not NEP +* `#11083 <https://github.com/numpy/numpy/pull/11083>`__: ENH: remove nose from travis tests +* `#11085 <https://github.com/numpy/numpy/pull/11085>`__: DOC: create label and ref, fixes broken link +* `#11086 <https://github.com/numpy/numpy/pull/11086>`__: DOC: Mention we can return unitinitialized values +* `#11089 <https://github.com/numpy/numpy/pull/11089>`__: BLD: cleanup `_configtest.o.d` during build +* `#11090 <https://github.com/numpy/numpy/pull/11090>`__: BUG: Added support for index values 27-52 in C einsum +* `#11091 <https://github.com/numpy/numpy/pull/11091>`__: BUG: Python2 doubles don't print correctly in interactive shell +* `#11094 <https://github.com/numpy/numpy/pull/11094>`__: DOC: add numpy.lib.format to docs and link to it +* `#11095 <https://github.com/numpy/numpy/pull/11095>`__: MAINT: Einsum argument parsing cleanup +* `#11097 <https://github.com/numpy/numpy/pull/11097>`__: BUG: fix datetime.timedelta->timedelta64 unit detection logic +* `#11098 <https://github.com/numpy/numpy/pull/11098>`__: ENH: Add keepdims argument for generalized ufuncs. +* `#11105 <https://github.com/numpy/numpy/pull/11105>`__: ENH: Add (put|take)_along_axis +* `#11111 <https://github.com/numpy/numpy/pull/11111>`__: BUG: fix case of ISA selector in ufunc selection +* `#11116 <https://github.com/numpy/numpy/pull/11116>`__: BUG: Typo in variable name in binary_repr +* `#11120 <https://github.com/numpy/numpy/pull/11120>`__: MAINT: remove redundant code in `MaskedArray.__new__` +* `#11122 <https://github.com/numpy/numpy/pull/11122>`__: BUG,MAINT: Ensure masked elements can be tested against nan and... +* `#11124 <https://github.com/numpy/numpy/pull/11124>`__: BUG: Ensure that fully masked arrays pass assert_array_equal. +* `#11134 <https://github.com/numpy/numpy/pull/11134>`__: DOC: Clarify tofile requirements +* `#11137 <https://github.com/numpy/numpy/pull/11137>`__: MAINT: move remaining MaskedArray matrix tests to matrixlib. +* `#11139 <https://github.com/numpy/numpy/pull/11139>`__: TST: turn some build warnings into errors +* `#11140 <https://github.com/numpy/numpy/pull/11140>`__: MAINT: Update artful to bionic for i386 testing +* `#11141 <https://github.com/numpy/numpy/pull/11141>`__: MAINT: Extract a helper function for prepending and appending +* `#11145 <https://github.com/numpy/numpy/pull/11145>`__: DOC: cleanup NEP creation +* `#11146 <https://github.com/numpy/numpy/pull/11146>`__: DOC: add a NEP to split MaskedArray into a separate package +* `#11148 <https://github.com/numpy/numpy/pull/11148>`__: TST: make build warning into an error in runtest.py +* `#11149 <https://github.com/numpy/numpy/pull/11149>`__: BUG: guessing datetime, time precedence +* `#11152 <https://github.com/numpy/numpy/pull/11152>`__: BENCH: Add basic benchmarks for numpy.pad +* `#11155 <https://github.com/numpy/numpy/pull/11155>`__: BUG: Prevent stackoverflow in conversion to datetime types +* `#11158 <https://github.com/numpy/numpy/pull/11158>`__: TST: disable gc in refcount test +* `#11159 <https://github.com/numpy/numpy/pull/11159>`__: TST: Skip ctypes dependent test that fails on Python < 2.7.7. +* `#11160 <https://github.com/numpy/numpy/pull/11160>`__: TST: windows builds now properly support floating error states +* `#11163 <https://github.com/numpy/numpy/pull/11163>`__: MAINT: Work around non-deterministic Python readdir order in... +* `#11167 <https://github.com/numpy/numpy/pull/11167>`__: MAINT: Cleanup dragon4 code in various ways +* `#11168 <https://github.com/numpy/numpy/pull/11168>`__: TST: linalg: add regression test for gh-8577 +* `#11169 <https://github.com/numpy/numpy/pull/11169>`__: MAINT: add sanity-checks to be run at import time +* `#11173 <https://github.com/numpy/numpy/pull/11173>`__: MAINT: Ensure that parsing errors are passed on even in tests. +* `#11176 <https://github.com/numpy/numpy/pull/11176>`__: MAINT: avoid setting non-existing gufunc strides for keepdims=True. +* `#11177 <https://github.com/numpy/numpy/pull/11177>`__: DOC: improvement of the documentation for gufunc. +* `#11178 <https://github.com/numpy/numpy/pull/11178>`__: TST: Test dimensions/indices found from parsed gufunc signatures. +* `#11180 <https://github.com/numpy/numpy/pull/11180>`__: BUG: void dtype setup checked offset not actual pointer for alignment +* `#11182 <https://github.com/numpy/numpy/pull/11182>`__: BUG: Avoid deprecated non-tuple indexing +* `#11184 <https://github.com/numpy/numpy/pull/11184>`__: MAINT: Add bitmask helper functions +* `#11185 <https://github.com/numpy/numpy/pull/11185>`__: MAINT: Add comments to long_double detection code +* `#11186 <https://github.com/numpy/numpy/pull/11186>`__: TST: Add np.core._multiarray_tests.format_float_OSprintf_g +* `#11187 <https://github.com/numpy/numpy/pull/11187>`__: MAINT: Use the more common -1 / 0 to indicate error / success +* `#11189 <https://github.com/numpy/numpy/pull/11189>`__: NEP: Array function protocol +* `#11190 <https://github.com/numpy/numpy/pull/11190>`__: DOC: Update NEP0 to clarify that discussion should happen on... +* `#11191 <https://github.com/numpy/numpy/pull/11191>`__: MAINT: remove darwin hardcoded LDOUBLE detection +* `#11193 <https://github.com/numpy/numpy/pull/11193>`__: BUG: Fix reference count/memory leak exposed by better testing +* `#11200 <https://github.com/numpy/numpy/pull/11200>`__: BUG: Bytes delimiter/comments in genfromtxt should be decoded +* `#11209 <https://github.com/numpy/numpy/pull/11209>`__: DOC: Fix doctest formatting in `rot90()` examples +* `#11218 <https://github.com/numpy/numpy/pull/11218>`__: BUG: Fixes einsum broadcasting bug when optimize=True +* `#11222 <https://github.com/numpy/numpy/pull/11222>`__: DOC: Make reference doc nditer examples python3 friendly +* `#11223 <https://github.com/numpy/numpy/pull/11223>`__: BUG: Forcibly promote shape to uint64 in numpy.memmap. +* `#11225 <https://github.com/numpy/numpy/pull/11225>`__: DOC: add existing recfunctions documentation to output +* `#11226 <https://github.com/numpy/numpy/pull/11226>`__: MAINT: add 'rst' to nep filename, fixup urls +* `#11229 <https://github.com/numpy/numpy/pull/11229>`__: NEP: New RNG policy +* `#11231 <https://github.com/numpy/numpy/pull/11231>`__: MAINT: ensure we do not create unnecessary tuples for outputs +* `#11238 <https://github.com/numpy/numpy/pull/11238>`__: MAINT: Don't update the flags a second time +* `#11239 <https://github.com/numpy/numpy/pull/11239>`__: MAINT: Use PyArray_NewFromDescr where possible, remove unused... +* `#11240 <https://github.com/numpy/numpy/pull/11240>`__: MAINT: Remove dead code backporting py2.6 warnings +* `#11246 <https://github.com/numpy/numpy/pull/11246>`__: BUG: Set ndarray.base before `__array_finalize__` +* `#11247 <https://github.com/numpy/numpy/pull/11247>`__: MAINT/BUG: Remove out-of-band reference count in PyArray_Newshape,... +* `#11248 <https://github.com/numpy/numpy/pull/11248>`__: MAINT: Don't update the flags a second time +* `#11249 <https://github.com/numpy/numpy/pull/11249>`__: BUG: Remove errant flag meddling in .real and .imag +* `#11252 <https://github.com/numpy/numpy/pull/11252>`__: DOC: show how to generate release notes in release walkthrough +* `#11257 <https://github.com/numpy/numpy/pull/11257>`__: BUG: ensure extobj and axes have their own references. +* `#11260 <https://github.com/numpy/numpy/pull/11260>`__: MAINT: Do proper cleanup in get_ufunc_arguments. +* `#11263 <https://github.com/numpy/numpy/pull/11263>`__: DOC: Update master after NumPy 1.14.4 release. +* `#11269 <https://github.com/numpy/numpy/pull/11269>`__: BUG: Correct use of NPY_UNUSED. +* `#11273 <https://github.com/numpy/numpy/pull/11273>`__: BUG: Remove invalid read in searchsorted if needle is empty +* `#11275 <https://github.com/numpy/numpy/pull/11275>`__: TST: Do not use empty arrays in tests (unless they are not read) +* `#11277 <https://github.com/numpy/numpy/pull/11277>`__: BUG: Work around past and present PEP3118 issues in ctypes +* `#11280 <https://github.com/numpy/numpy/pull/11280>`__: DOC: make docstring of np.interp clearer +* `#11286 <https://github.com/numpy/numpy/pull/11286>`__: BUG: einsum needs to check overlap on an out argument +* `#11287 <https://github.com/numpy/numpy/pull/11287>`__: DOC: Minor documentation improvements +* `#11291 <https://github.com/numpy/numpy/pull/11291>`__: BUG: Remove extra trailing parentheses. +* `#11293 <https://github.com/numpy/numpy/pull/11293>`__: DOC: fix hierarchy of numericaltype +* `#11296 <https://github.com/numpy/numpy/pull/11296>`__: BUG: Fix segfault on failing `__array_wrap__` +* `#11298 <https://github.com/numpy/numpy/pull/11298>`__: BUG: Undo behavior change in ma.masked_values(shrink=True) +* `#11307 <https://github.com/numpy/numpy/pull/11307>`__: BUG: Fix memmap regression when shape=None +* `#11314 <https://github.com/numpy/numpy/pull/11314>`__: MAINT: remove unused "npy_import" +* `#11315 <https://github.com/numpy/numpy/pull/11315>`__: MAINT: Package `tools/allocation_tracking` +* `#11319 <https://github.com/numpy/numpy/pull/11319>`__: REL, REV: Revert f2py fixes that exposed SciPy bug. +* `#11327 <https://github.com/numpy/numpy/pull/11327>`__: DOC: Update release notes for 1.15.0. +* `#11339 <https://github.com/numpy/numpy/pull/11339>`__: BUG: decref in failure path; replace PyObject_Type by Py_TYPE +* `#11352 <https://github.com/numpy/numpy/pull/11352>`__: DEP: Actually deprecate the normed argument to histogram +* `#11359 <https://github.com/numpy/numpy/pull/11359>`__: DOC: document new functions +* `#11367 <https://github.com/numpy/numpy/pull/11367>`__: BUG: add missing NpyIter_Close in einsum +* `#11368 <https://github.com/numpy/numpy/pull/11368>`__: BUG/TST: String indexing should just fail, not emit a futurewarning +* `#11389 <https://github.com/numpy/numpy/pull/11389>`__: ENH: Remove NpyIter_Close +* `#11392 <https://github.com/numpy/numpy/pull/11392>`__: BUG: Make scalar.squeeze accept axis arg +* `#11393 <https://github.com/numpy/numpy/pull/11393>`__: REL,MAINT: Update numpyconfig.h for 1.15. +* `#11394 <https://github.com/numpy/numpy/pull/11394>`__: MAINT: Update mailmap +* `#11403 <https://github.com/numpy/numpy/pull/11403>`__: DOC: Remove npyiter close from notes +* `#11427 <https://github.com/numpy/numpy/pull/11427>`__: BUG: Fix incorrect deprecation logic for histogram(normed=...)... +* `#11489 <https://github.com/numpy/numpy/pull/11489>`__: BUG: Ensure out is returned in einsum. +* `#11491 <https://github.com/numpy/numpy/pull/11491>`__: BUG/ENH: Einsum optimization path updates and bug fixes. +* `#11493 <https://github.com/numpy/numpy/pull/11493>`__: BUG: Revert #10229 to fix DLL loads on Windows. +* `#11494 <https://github.com/numpy/numpy/pull/11494>`__: MAINT: add PyPI classifier for Python 3.7 +* `#11495 <https://github.com/numpy/numpy/pull/11495>`__: BENCH: belated addition of lcm, gcd to ufunc benchmark. +* `#11496 <https://github.com/numpy/numpy/pull/11496>`__: BUG: Advanced indexing assignment incorrectly took 1-D fastpath +* `#11511 <https://github.com/numpy/numpy/pull/11511>`__: BUG: Fix #define for ppc64 and ppc64le +* `#11529 <https://github.com/numpy/numpy/pull/11529>`__: ENH: Add density argument to histogramdd. +* `#11532 <https://github.com/numpy/numpy/pull/11532>`__: BUG: Decref of field title caused segfault +* `#11540 <https://github.com/numpy/numpy/pull/11540>`__: DOC: Update the 1.15.0 release notes. +* `#11577 <https://github.com/numpy/numpy/pull/11577>`__: BLD: Modify cpu detection and printing to get working aarch64... +* `#11578 <https://github.com/numpy/numpy/pull/11578>`__: DOC: link to TESTS.rst.txt testing guidelines, tweak testing... +* `#11602 <https://github.com/numpy/numpy/pull/11602>`__: TST: Add Python 3.7 to CI testing diff --git a/doc/changelog/1.15.1-changelog.rst b/doc/changelog/1.15.1-changelog.rst new file mode 100644 index 000000000..42ba67c2b --- /dev/null +++ b/doc/changelog/1.15.1-changelog.rst @@ -0,0 +1,44 @@ + +Contributors +============ + +A total of 7 people contributed to this release. People with a "+" by their +names contributed a patch for the first time. + +* Charles Harris +* Chris Billington +* Elliott Sales de Andrade + +* Eric Wieser +* Jeremy Manning + +* Matti Picus +* Ralf Gommers + +Pull requests merged +==================== + +A total of 24 pull requests were merged for this release. + +* `#11647 <https://github.com/numpy/numpy/pull/11647>`__: MAINT: Filter Cython warnings in ``__init__.py`` +* `#11648 <https://github.com/numpy/numpy/pull/11648>`__: BUG: Fix doc source links to unwrap decorators +* `#11657 <https://github.com/numpy/numpy/pull/11657>`__: BUG: Ensure singleton dimensions are not dropped when converting... +* `#11661 <https://github.com/numpy/numpy/pull/11661>`__: BUG: Warn on Nan in minimum,maximum for scalars +* `#11665 <https://github.com/numpy/numpy/pull/11665>`__: BUG: cython sometimes emits invalid gcc attribute +* `#11682 <https://github.com/numpy/numpy/pull/11682>`__: BUG: Fix regression in void_getitem +* `#11698 <https://github.com/numpy/numpy/pull/11698>`__: BUG: Make matrix_power again work for object arrays. +* `#11700 <https://github.com/numpy/numpy/pull/11700>`__: BUG: Add missing PyErr_NoMemory after failing malloc +* `#11719 <https://github.com/numpy/numpy/pull/11719>`__: BUG: Fix undefined functions on big-endian systems. +* `#11720 <https://github.com/numpy/numpy/pull/11720>`__: MAINT: Make einsum optimize default to False. +* `#11746 <https://github.com/numpy/numpy/pull/11746>`__: BUG: Fix regression in loadtxt for bz2 text files in Python 2. +* `#11757 <https://github.com/numpy/numpy/pull/11757>`__: BUG: Revert use of `console_scripts`. +* `#11758 <https://github.com/numpy/numpy/pull/11758>`__: BUG: Fix Fortran kind detection for aarch64 & s390x. +* `#11759 <https://github.com/numpy/numpy/pull/11759>`__: BUG: Fix printing of longdouble on ppc64le. +* `#11760 <https://github.com/numpy/numpy/pull/11760>`__: BUG: Fixes for unicode field names in Python 2 +* `#11761 <https://github.com/numpy/numpy/pull/11761>`__: BUG: Increase required cython version on python 3.7 +* `#11763 <https://github.com/numpy/numpy/pull/11763>`__: BUG: check return value of _buffer_format_string +* `#11775 <https://github.com/numpy/numpy/pull/11775>`__: MAINT: Make assert_array_compare more generic. +* `#11776 <https://github.com/numpy/numpy/pull/11776>`__: TST: Fix urlopen stubbing. +* `#11777 <https://github.com/numpy/numpy/pull/11777>`__: BUG: Fix regression in intersect1d. +* `#11779 <https://github.com/numpy/numpy/pull/11779>`__: BUG: Fix test sensitive to platform byte order. +* `#11781 <https://github.com/numpy/numpy/pull/11781>`__: BUG: Avoid signed overflow in histogram +* `#11785 <https://github.com/numpy/numpy/pull/11785>`__: BUG: Fix pickle and memoryview for datetime64, timedelta64 scalars +* `#11786 <https://github.com/numpy/numpy/pull/11786>`__: BUG: Deprecation triggers segfault diff --git a/doc/neps/index.rst.tmpl b/doc/neps/index.rst.tmpl index 6cbad8eb2..e7b8fedba 100644 --- a/doc/neps/index.rst.tmpl +++ b/doc/neps/index.rst.tmpl @@ -1,12 +1,21 @@ -=========================== -NumPy Enhancement Proposals -=========================== - -NumPy Enhancement Proposals (NEPs) describe proposed changes to NumPy. -NEPs are modeled on Python Enhancement Proposals (PEPs), and are typically -written up when large changes to NumPy are proposed. +===================================== +Roadmap & NumPy Enhancement Proposals +===================================== + +This page provides an overview of development priorities for NumPy. +Specifically, it contains a roadmap with a higher-level overview, as +well as NumPy Enhancement Proposals (NEPs)—suggested changes +to the library—in various stages of discussion or completion (see `NEP +0 <nep-0000>`__). + +Roadmap +------- +.. toctree:: + :maxdepth: 1 -This page provides an overview of all NEPs. + The Scope of NumPy <scope> + Current roadmap <roadmap> + Wish list <https://github.com/numpy/numpy/issues?q=is%3Aopen+is%3Aissue+label%3A%2223+-+Wish+List%22> Meta-NEPs (NEPs about NEPs or Processes) ---------------------------------------- diff --git a/doc/neps/nep-0018-array-function-protocol.rst b/doc/neps/nep-0018-array-function-protocol.rst index 3e23a2e28..e7d433e37 100644 --- a/doc/neps/nep-0018-array-function-protocol.rst +++ b/doc/neps/nep-0018-array-function-protocol.rst @@ -7,9 +7,10 @@ NEP 18 — A dispatch mechanism for NumPy's high level array functions :Author: Marten van Kerkwijk <mhvk@astro.utoronto.ca> :Author: Hameer Abbasi <hameerabbasi@yahoo.com> :Author: Eric Wieser <wieser.eric@gmail.com> -:Status: Draft +:Status: Accepted :Type: Standards Track :Created: 2018-05-29 +:Resolution: https://mail.python.org/pipermail/numpy-discussion/2018-August/078493.html Abstact ------- @@ -381,10 +382,6 @@ decorator directly, but override implementation in terms of decorators, but they could still use a C equivalent of ``try_array_function_override``. If performance is not a concern, they could also be easily wrapped with a small Python wrapper. -- The ``__call__`` method of ``np.vectorize`` can't be decorated with - ``@array_function_dispatch``, because we should pass a ``vectorize`` object - itself as the ``func`` argument ``__array_function__``, not the unbound - ``vectorize.__call__`` method. - ``np.einsum`` does complicated argument parsing to handle two different function signatures. It would probably be best to avoid the overhead of parsing it twice in the typical case of no overrides. @@ -799,6 +796,31 @@ If we want to include them in the future, the easiest way to do so would be to update the ``array_function_dispatch`` decorator to add them as function attributes. +Callable objects generated at runtime +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +NumPy has some APIs that define callable objects *dynamically*, such as +``vectorize`` and methods on ``random.RandomState`` object. Examples can +also be found in other core libraries in the scientific Python stack, e.g., +distribution objects in scipy.stats and model objects in scikit-learn. It would +be nice to be able to write overloads for such callables, too. This presents a +challenge for the ``__array_function__`` protocol, because unlike the case for +functions there is no public object in the ``numpy`` namespace to pass into +the ``func`` argument. + +We could potentially handle this by establishing an alternative convention +for how the ``func`` argument could be inspected, e.g., by using +``func.__self__`` to obtain the class object and ``func.__func__`` to return +the unbound function object. However, some caution is in order, because +this would immesh what are currently implementation details as a permanent +features of the interface, such as the fact that ``vectorize`` is implemented as a +class rather than closure, or whether a method is implemented directly or using +a descriptor. + +Given the complexity and the limited use cases, we are also deferring on this +issue for now, but we are confident that ``__array_function__`` could be +expanded to accomodate these use cases in the future if need be. + Discussion ---------- diff --git a/doc/neps/nep-0021-advanced-indexing.rst b/doc/neps/nep-0021-advanced-indexing.rst index d883a5589..5acabbf16 100644 --- a/doc/neps/nep-0021-advanced-indexing.rst +++ b/doc/neps/nep-0021-advanced-indexing.rst @@ -311,7 +311,7 @@ Subclasses are a bit problematic in the light of these changes. There are some possible solutions for this. For most subclasses (those which do not provide ``__getitem__`` or ``__setitem__``) the special attributes should just work. Subclasses that *do* provide it must be updated accordingly -and should preferably not subclass working versions of these attributes. +and should preferably not subclass ``oindex`` and ``vindex``. All subclasses will inherit the attributes, however, the implementation of ``__getitem__`` on these attributes should test @@ -348,9 +348,12 @@ Backward compatibility ---------------------- As a new feature, no backward compatibility issues with the new ``vindex`` -and ``oindex`` attributes would arise. To facilitate backwards compatibility -as much as possible, we expect a long deprecation cycle for legacy indexing -behavior and propose the new ``legacy_index`` attribute. +and ``oindex`` attributes would arise. + +To facilitate backwards compatibility as much as possible, we expect a long +deprecation cycle for legacy indexing behavior and propose the new +``legacy_index`` attribute. + Some forward compatibility issues with subclasses that do not specifically implement the new methods may arise. @@ -500,7 +503,7 @@ Vectorized/inner indexing ------------------------- Multiple indices are broadcasted and iterated as one like fancy indexing, -but the new axes area always inserted at the front:: +but the new axes are always inserted at the front:: >>> arr.vindex[:, [0], [0, 1], :].shape (2, 5, 8) diff --git a/doc/neps/roadmap.rst b/doc/neps/roadmap.rst new file mode 100644 index 000000000..a45423711 --- /dev/null +++ b/doc/neps/roadmap.rst @@ -0,0 +1,115 @@ +============= +NumPy Roadmap +============= + +This is a live snapshot of tasks and features we will be investing resources +in. It may be used to encourage and inspire developers and to search for +funding. + +Interoperability protocols & duck typing +---------------------------------------- + +- `__array_function__` + + See `NEP 18`_ and a sample implementation_ + +- Array Duck-Typing + + `NEP 22`_ `np.asduckarray()` + +- Mixins like `NDArrayOperatorsMixin`: + + - for mutable arrays + - for reduction methods implemented as ufuncs + +Better dtypes +------------- + +- Easier custom dtypes + - Simplify and/or wrap the current C-API + - More consistent support for dtype metadata + - Support for writing a dtype in Python +- New string dtype(s): + - Encoded strings with fixed-width storage (utf8, latin1, ...) and/or + - Variable length strings (could share implementation with dtype=object, but are explicitly type-checked) + - One of these should probably be the default for text data. The current behavior on Python 3 is neither efficient nor user friendly. +- `np.int` should not be platform dependent +- better coercion for string + number + +Random number generation policy & rewrite +----------------------------------------- + +`NEP 19`_ and a `reference implementation`_ + +Indexing +-------- + +vindex/oindex `NEP 21`_ + +Infrastructure +-------------- + +NumPy is much more than just the code base itself, we also maintain +docs, CI, benchmarks, etc. + +- Rewrite numpy.org +- Benchmarking: improve the extent of the existing suite, and run & render + the results as part of the docs or website. + + - Hardware: find a machine that can reliably run serial benchmarks + - ASV produces graphs, could we set up a site? Currently at + https://pv.github.io/numpy-bench/, should that become a community resource? + +Functionality outside core +-------------------------- + +Some things inside NumPy do not actually match the `Scope of NumPy`. + +- A backend system for `numpy.fft` (so that e.g. `fft-mkl` doesn't need to monkeypatch numpy) + +- Rewrite masked arrays to not be a ndarray subclass -- maybe in a separate project? +- MaskedArray as a duck-array type, and/or +- dtypes that support missing values + +- Write a strategy on how to deal with overlap between numpy and scipy for `linalg` and `fft` (and implement it). + +- Deprecate `np.matrix` + +Continuous Integration +---------------------- + +We depend on CI to discover problems as we continue to develop NumPy before the +code reaches downstream users. + +- CI for more exotic platforms (e.g. ARM is now available from + http://www.shippable.com/, but it is not free). +- Multi-package testing +- Add an official channel for numpy dev builds for CI usage by other projects so + they may confirm new builds do not break their package. + +Typing +------ + +Python type annotation syntax should support ndarrays and dtypes. + +- Type annotations for NumPy: github.com/numpy/numpy-stubs +- Support for typing shape and dtype in multi-dimensional arrays in Python more generally + +NumPy scalars +------------- + +Numpy has both scalars and zero-dimensional arrays. + +- The current implementation adds a large maintenance burden -- can we remove + scalars and/or simplify it internally? +- Zero dimensional arrays get converted into scalars by most NumPy + functions (i.e., output of `np.sin(x)` depends on whether `x` is + zero-dimensional or not). This inconsistency should be addressed, + so that one could, e.g., write sane type annotations. + +.. _`NEP 19`: https://www.numpy.org/neps/nep-0019-rng-policy.html +.. _`NEP 22`: http://www.numpy.org/neps/nep-0022-ndarray-duck-typing-overview.html +.. _`NEP 18`: https://www.numpy.org/neps/nep-0018-array-function-protocol.html +.. _implementation: https://gist.github.com/shoyer/1f0a308a06cd96df20879a1ddb8f0006 +.. _`reference implementation`: https://github.com/bashtage/randomgen +.. _`NEP 21`: https://www.numpy.org/neps/nep-0021-advanced-indexing.html diff --git a/doc/neps/scope.rst b/doc/neps/scope.rst new file mode 100644 index 000000000..a675b8c96 --- /dev/null +++ b/doc/neps/scope.rst @@ -0,0 +1,46 @@ +============== +Scope of NumPy +============== + +Here, we describe aspects of N-d array computation that are within scope for NumPy development. This is *not* an aspirational definition of where NumPy should aim, but instead captures the status quo—areas which we have decided to continue supporting, at least for the time being. + +- **In-memory, N-dimensional, homogeneously typed (single pointer + strided) arrays on CPUs** + + - Support for a wide range of data types + - Not specialized hardware such as GPUs + - But, do support wide range of CPUs (e.g. ARM, PowerX) + +- **Higher level APIs for N-dimensional arrays** + + - NumPy is a *de facto* standard for array APIs in Python + - Indexing and fast iteration over elements (ufunc) + - Interoperability protocols with other data container implementations (like `__array_ufunc__`). + +- **Python API and a C API** to the ndarray's methods and attributes. + +- Other **specialized types or uses of N-dimensional arrays**: + + - Masked arrays + - Structured arrays (informally known as record arrays) + - Memory mapped arrays + +- Historically, NumPy has included the following **basic functionality + in support of scientific computation**. We intend to keep supporting + (but not to expand) what is currently included: + + - Linear algebra + - Fast Fourier transforms and windowing + - Pseudo-random number generators + - Polynomial fitting + +- NumPy provides some **infrastructure for other packages in the scientific Python ecosystem**: + + - numpy.distutils (build support for C++, Fortran, BLAS/LAPACK, and other relevant libraries for scientific computing + - f2py (generating bindings for Fortran code) + - testing utilities + +- **Speed**: we take performance concerns seriously and aim to execute + operations on large arrays with similar performance as native C + code. That said, where conflict arises, maintenance and portability take + precedence over performance. We aim to prevent regressions where + possible (e.g., through asv). diff --git a/doc/release/1.13.0-notes.rst b/doc/release/1.13.0-notes.rst index 4554e53ea..3b719db09 100644 --- a/doc/release/1.13.0-notes.rst +++ b/doc/release/1.13.0-notes.rst @@ -183,11 +183,11 @@ override the behavior of NumPy's ufuncs. This works quite similarly to Python's ``__mul__`` and other binary operation routines. See the documentation for a more detailed description of the implementation and behavior of this new option. The API is provisional, we do not yet guarantee backward compatibility -as modifications may be made pending feedback. See the NEP_ and +as modifications may be made pending feedback. See `NEP 13`_ and documentation_ for more details. -.. _NEP: https://github.com/numpy/numpy/blob/master/doc/neps/ufunc-overrides.rst -.. _documentation: https://github.com/charris/numpy/blob/master/doc/source/reference/arrays.classes.rst +.. _`NEP 13`: http://www.numpy.org/neps/nep-0013-ufunc-overrides.html +.. _documentation: https://github.com/numpy/numpy/blob/master/doc/source/reference/arrays.classes.rst New ``positive`` ufunc ---------------------- diff --git a/doc/release/1.13.1-notes.rst b/doc/release/1.13.1-notes.rst index 807296a85..88a4bc3dd 100644 --- a/doc/release/1.13.1-notes.rst +++ b/doc/release/1.13.1-notes.rst @@ -13,7 +13,7 @@ used with 3.6.0 due to Python bug 29943_. NumPy 1.13.2 will be released shortly after Python 3.6.2 is out to fix that problem. If you are using 3.6.0 the workaround is to upgrade to 3.6.1 or use an earlier Python version. -.. _#29943: https://bugs.python.org/issue29943 +.. _29943: https://bugs.python.org/issue29943 Pull requests merged @@ -21,7 +21,7 @@ Pull requests merged A total of 19 pull requests were merged for this release. * #9240 DOC: BLD: fix lots of Sphinx warnings/errors. -* #9255 Revert "DEP: Raise TypeError for subtract(bool_, bool_)." +* #9255 Revert "DEP: Raise TypeError for subtract(bool, bool)." * #9261 BUG: don't elide into readonly and updateifcopy temporaries for... * #9262 BUG: fix missing keyword rename for common block in numpy.f2py * #9263 BUG: handle resize of 0d array diff --git a/doc/release/1.14.0-notes.rst b/doc/release/1.14.0-notes.rst index 0f14f7703..462631de6 100644 --- a/doc/release/1.14.0-notes.rst +++ b/doc/release/1.14.0-notes.rst @@ -14,11 +14,11 @@ dropping Python 2.7 support in the runup to 2020. The decision has been made to support 2.7 for all releases made in 2018, with the last release being designated a long term release with support for bug fixes extending through 2019. In 2019 support for 2.7 will be dropped in all new releases. More details -can be found in the relevant NEP_. +can be found in `NEP 12`_. This release supports Python 2.7 and 3.4 - 3.6. -.. _NEP: https://github.com/numpy/numpy/blob/master/doc/neps/dropping-python2.7-proposal.rst +.. _`NEP 12`: http://www.numpy.org/neps/nep-0014-dropping-python2.7-proposal.html Highlights @@ -134,8 +134,8 @@ are marked readonly. In the past, it was possible to get away with:: var_arr = np.asarray(val) val_arr += 1 # now errors, previously changed np.ma.masked.data -``np.ma`` functions producing ``fill_value``s have changed ----------------------------------------------------------- +``np.ma`` functions producing ``fill_value`` s have changed +----------------------------------------------------------- Previously, ``np.ma.default_fill_value`` would return a 0d array, but ``np.ma.minimum_fill_value`` and ``np.ma.maximum_fill_value`` would return a tuple of the fields. Instead, all three methods return a structured ``np.void`` diff --git a/doc/release/1.14.1-notes.rst b/doc/release/1.14.1-notes.rst index 2ed4c3e14..7b95c2e28 100644 --- a/doc/release/1.14.1-notes.rst +++ b/doc/release/1.14.1-notes.rst @@ -67,7 +67,7 @@ A total of 36 pull requests were merged for this release. * `#10431 <https://github.com/numpy/numpy/pull/10431>`__: REL: Add 1.14.1 release notes template * `#10435 <https://github.com/numpy/numpy/pull/10435>`__: MAINT: Use ValueError for duplicate field names in lookup (backport) * `#10534 <https://github.com/numpy/numpy/pull/10534>`__: BUG: Provide a better error message for out-of-order fields -* `#10536 <https://github.com/numpy/numpy/pull/10536>`__: BUG: Resize bytes_ columns in genfromtxt (backport of #10401) +* `#10536 <https://github.com/numpy/numpy/pull/10536>`__: BUG: Resize bytes columns in genfromtxt (backport of #10401) * `#10537 <https://github.com/numpy/numpy/pull/10537>`__: BUG: multifield-indexing adds padding bytes: revert for 1.14.1 * `#10539 <https://github.com/numpy/numpy/pull/10539>`__: BUG: fix np.save issue with python 2.7.5 * `#10540 <https://github.com/numpy/numpy/pull/10540>`__: BUG: Add missing DECREF in Py2 int() cast diff --git a/doc/release/1.15.0-notes.rst b/doc/release/1.15.0-notes.rst index 728465f1e..7235ca915 100644 --- a/doc/release/1.15.0-notes.rst +++ b/doc/release/1.15.0-notes.rst @@ -2,36 +2,59 @@ NumPy 1.15.0 Release Notes ========================== +NumPy 1.15.0 is a release with an unusual number of cleanups, many deprecations +of old functions, and improvements to many existing functions. Please read the +detailed descriptions below to see if you are affected. + +For testing, we have switched to pytest as a replacement for the no longer +maintained nose framework. The old nose based interface remains for downstream +projects who may still be using it. + +The Python versions supported by this release are 2.7, 3.4-3.7. The wheels are +linked with OpenBLAS v0.3.0, which should fix some of the linalg problems +reported for NumPy 1.14. + Highlights ========== * NumPy has switched to pytest for testing. +* A new `numpy.printoptions` context manager. +* Many improvements to the histogram functions. +* Support for unicode field names in python 2.7. +* Improved support for PyPy. +* Fixes and improvements to `numpy.einsum`. New functions ============= -* `np.gcd` and `np.lcm`, to compute the greatest common divisor and least +* `numpy.gcd` and `numpy.lcm`, to compute the greatest common divisor and least common multiple. -* `np.ma.stack`, the `np.stack` array-joining function generalized to masked - arrays. -* ``quantile`` function, an interface to ``percentile`` without factors of 100 -* ``nanquantile`` function, an interface to ``nanpercentile`` without factors - of 100 -* `np.printoptions`, a context manager that sets print options temporarily +* `numpy.ma.stack`, the `numpy.stack` array-joining function generalized to + masked arrays. + +* `numpy.quantile` function, an interface to ``percentile`` without factors of + 100 + +* `numpy.nanquantile` function, an interface to ``nanpercentile`` without + factors of 100 + +* `numpy.printoptions`, a context manager that sets print options temporarily for the scope of the ``with`` block:: >>> with np.printoptions(precision=2): ... print(np.array([2.0]) / 3) [0.67] -* `np.histogram_bin_edges`, a function to get the edges of the bins used by a histogram - without needing to calculate the histogram. +* `numpy.histogram_bin_edges`, a function to get the edges of the bins used by a + histogram without needing to calculate the histogram. + +* C functions `npy_get_floatstatus_barrier` and `npy_clear_floatstatus_barrier` + have been added to deal with compiler optimization changing the order of + operations. See below for details. -* `npy_get_floatstatus_barrier`` and ``npy_clear_floatstatus_barrier`` have been added to - deal with compiler optimization changing the order of operations. See below for details. Deprecations ============ @@ -39,42 +62,44 @@ Deprecations * Aliases of builtin `pickle` functions are deprecated, in favor of their unaliased ``pickle.<func>`` names: - * `np.loads` - * `np.core.numeric.load` - * `np.core.numeric.loads` - * `np.ma.loads`, `np.ma.dumps` - * `np.ma.load`, `np.ma.dump` - these functions already failed on python 3, - when called with a string. - -* Multidimensional indexing with anything but a tuple is - deprecated. This means that code such as ``ind = [slice(None), 0]``, - ``arr[[slice(None), 0]]`` should be changed to ``arr[tuple(ind)]``. This is - necessary to avoid ambiguity in expressions such as ``arr[[[0, 1], [0, 1]]]`` - which currently is interpreted as ``arr[array([0, 1]), array([0, 1])]``. - In future, this will be interpreted as ``arr[array([[0, 1], [0, 1]])]``. - -* Direct imports from the following modules is deprecated. All testing related - imports should come from `numpy.testing`. - * `np.testing.utils` - * `np.testing.decorators` - * `np.testing.nosetester` - * `np.testing.noseclasses` - * `np.core.umath_tests` - -* Giving a generator to `np.sum` is now deprecated. This was undocumented, but - worked. Previously, it would calculate the sum of the generator expression. - In the future, it might return a different result. Use `np.sum(np.from_iter(generator))` - or the built-in Python `sum` instead. + * `numpy.loads` + * `numpy.core.numeric.load` + * `numpy.core.numeric.loads` + * `numpy.ma.loads`, `numpy.ma.dumps` + * `numpy.ma.load`, `numpy.ma.dump` - these functions already failed on + python 3 when called with a string. + +* Multidimensional indexing with anything but a tuple is deprecated. This means + that the index list in ``ind = [slice(None), 0]; arr[ind]`` should be changed + to a tuple, e.g., ``ind = [slice(None), 0]; arr[tuple(ind)]`` or + ``arr[(slice(None), 0)]``. That change is necessary to avoid ambiguity in + expressions such as ``arr[[[0, 1], [0, 1]]]``, currently interpreted as + ``arr[array([0, 1]), array([0, 1])]``, that will be interpreted + as ``arr[array([[0, 1], [0, 1]])]`` in the future. + +* Imports from the following sub-modules are deprecated, they will be removed + at some future date. + + * `numpy.testing.utils` + * `numpy.testing.decorators` + * `numpy.testing.nosetester` + * `numpy.testing.noseclasses` + * `numpy.core.umath_tests` + +* Giving a generator to `numpy.sum` is now deprecated. This was undocumented + behavior, but worked. Previously, it would calculate the sum of the generator + expression. In the future, it might return a different result. Use + ``np.sum(np.from_iter(generator))`` or the built-in Python ``sum`` instead. * Users of the C-API should call ``PyArrayResolveWriteBackIfCopy`` or ``PyArray_DiscardWritbackIfCopy`` on any array with the ``WRITEBACKIFCOPY`` - flag set, before the array is deallocated. A deprecation warning will be + flag set, before deallocating the array. A deprecation warning will be emitted if those calls are not used when needed. * Users of ``nditer`` should use the nditer object as a context manager anytime one of the iterator operands is writeable, so that numpy can manage writeback semantics, or should call ``it.close()``. A - `RuntimeWarning` may be emitted otherwise in these cases. + `RuntimeWarning` may be emitted otherwise in these cases. * The ``normed`` argument of ``np.histogram``, deprecated long ago in 1.6.0, now emits a ``DeprecationWarning``. @@ -83,30 +108,46 @@ Deprecations Future Changes ============== +* NumPy 1.16 will drop support for Python 3.4. +* NumPy 1.17 will drop support for Python 2.7. + Compatibility notes =================== -The ``NpzFile`` returned by ``np.savez`` is now a `collections.abc.Mapping` ---------------------------------------------------------------------------- +Compiled testing modules renamed and made private +------------------------------------------------- +The following compiled modules have been renamed and made private: + +* ``umath_tests`` -> ``_umath_tests`` +* ``test_rational`` -> ``_rational_tests`` +* ``multiarray_tests`` -> ``_multiarray_tests`` +* ``struct_ufunc_test`` -> ``_struct_ufunc_tests`` +* ``operand_flag_tests`` -> ``_operand_flag_tests`` + +The ``umath_tests`` module is still available for backwards compatibility, but +will be removed in the future. + +The ``NpzFile`` returned by ``np.savez`` is now a ``collections.abc.Mapping`` +----------------------------------------------------------------------------- This means it behaves like a readonly dictionary, and has a new ``.values()`` method and ``len()`` implementation. -On python 3, this means that ``.iteritems()``, ``.iterkeys()`` have been +For python 3, this means that ``.iteritems()``, ``.iterkeys()`` have been deprecated, and ``.keys()`` and ``.items()`` now return views and not lists. This is consistent with how the builtin ``dict`` type changed between python 2 and python 3. -Under certain conditions, nditer must be used in a context manager ------------------------------------------------------------------- -When using an nditer with the ``"writeonly"`` or ``"readwrite"`` flags, there -are some circumstances where nditer doesn't actually give you a view onto the +Under certain conditions, ``nditer`` must be used in a context manager +---------------------------------------------------------------------- +When using an `numpy.nditer` with the ``"writeonly"`` or ``"readwrite"`` flags, there +are some circumstances where nditer doesn't actually give you a view of the writable array. Instead, it gives you a copy, and if you make changes to the copy, nditer later writes those changes back into your actual array. Currently, this writeback occurs when the array objects are garbage collected, which makes this API error-prone on CPython and entirely broken on PyPy. Therefore, -``nditer`` should now be used as a context manager whenever using ``nditer`` -with writeable arrays (``with np.nditer(...) as it: ...``). You may also +``nditer`` should now be used as a context manager whenever it is used +with writeable arrays, e.g., ``with np.nditer(...) as it: ...``. You may also explicitly call ``it.close()`` for cases where a context manager is unusable, for instance in generator expressions. @@ -116,8 +157,8 @@ The last nose release was 1.3.7 in June, 2015, and development of that tool has ended, consequently NumPy has now switched to using pytest. The old decorators and nose tools that were previously used by some downstream projects remain available, but will not be maintained. The standard testing utilities, -`assert_almost_equal` and such, are not be affected by this change except for -the nose specific functions `import_nose` and `raises`. Those functions are +``assert_almost_equal`` and such, are not be affected by this change except for +the nose specific functions ``import_nose`` and ``raises``. Those functions are not used in numpy, but are kept for downstream compatibility. Numpy no longer monkey-patches ``ctypes`` with ``__array_interface__`` @@ -127,22 +168,22 @@ types from ``ctypes``. ``np.ma.notmasked_contiguous`` and ``np.ma.flatnotmasked_contiguous`` always return lists ----------------------------------------------------------------------------------------- -This was always the documented behavior, but in reality the result used to be -any of slice, None, or list. - -All downstream users seem to use detect the `None` result from -``flatnotmasked_contiguous`` and replace it with ``[]``. -These callers will continue to work as before. - -``np.squeeze`` now respects the API expectation of objects that do not handle an ``axis`` argument --------------------------------------------------------------------------------------------------- -Prior to version ``1.7.0`` ``np.squeeze`` did not have an ``axis`` argument and all empty axes were removed -by default. After incorporation of an ``axis`` argument, it was possible to selectively squeeze single -or multiple empty axes, but the old API expectation was not respected because the axes could still be -selectively removed (silent success) in an object depending on the old API. The silent success is no -longer possible, and objects expecting the old API are respected. The silent success was prevented -by removing the interception of an otherwise-normal Exception when ``axis`` was provided to an object -using the old API. +This is the documented behavior, but previously the result could be any of +slice, None, or list. + +All downstream users seem to check for the ``None`` result from +``flatnotmasked_contiguous`` and replace it with ``[]``. Those callers will +continue to work as before. + +``np.squeeze`` restores old behavior of objects that cannot handle an ``axis`` argument +--------------------------------------------------------------------------------------- +Prior to version ``1.7.0``, `numpy.squeeze` did not have an ``axis`` argument and +all empty axes were removed by default. The incorporation of an ``axis`` +argument made it possible to selectively squeeze single or multiple empty axes, +but the old API expectation was not respected because axes could still be +selectively removed (silent success) from an object expecting all empty axes to +be removed. That silent, selective removal of empty axes for objects expecting +the old behavior has been fixed and the old behavior restored. unstructured void array's ``.item`` method now returns a bytes object --------------------------------------------------------------------- @@ -151,11 +192,10 @@ This may affect code which assumed the return value was mutable, which is no longer the case. ``copy.copy`` and ``copy.deepcopy`` no longer turn ``masked`` into an array ----------------------------------------------------------------------------- +--------------------------------------------------------------------------- Since ``np.ma.masked`` is a readonly scalar, copying should be a no-op. These functions now behave consistently with ``np.copy()``. - Multifield Indexing of Structured Arrays will still return a copy ----------------------------------------------------------------- The change that multi-field indexing of structured arrays returns a view @@ -163,25 +203,31 @@ instead of a copy is pushed back to 1.16. A new method ``numpy.lib.recfunctions.repack_fields`` has been introduced to help mitigate the effects of this change, which can be used to write code compatible with both numpy 1.15 and 1.16. For more information on how to update code to account -for this future change see "basics/structured arrays/accessing multiple fields" -in the user guide. +for this future change see the "accessing multiple fields" section of the +`user guide <https://docs.scipy.org/doc/numpy/user/basics.rec.html>`__. + C API changes ============= -* Functions ``npy_get_floatstatus_barrier`` and ``npy_clear_floatstatus_barrier`` - have been added and should be used in place of the ``npy_get_floatstatus``and - ``npy_clear_status`` functions. Optimizing compilers like GCC 8.1 and Clang - were rearranging the order of operations when the previous functions were - used in the ufunc SIMD functions, resulting in the floatstatus flags being ' - checked before the operation whose status we wanted to check was run. - See `#10339 <https://github.com/numpy/numpy/issues/10370>`__. +New functions ``npy_get_floatstatus_barrier`` and ``npy_clear_floatstatus_barrier`` +----------------------------------------------------------------------------------- +Functions ``npy_get_floatstatus_barrier`` and ``npy_clear_floatstatus_barrier`` +have been added and should be used in place of the ``npy_get_floatstatus``and +``npy_clear_status`` functions. Optimizing compilers like GCC 8.1 and Clang +were rearranging the order of operations when the previous functions were used +in the ufunc SIMD functions, resulting in the floatstatus flags being checked +before the operation whose status we wanted to check was run. See `#10339 +<https://github.com/numpy/numpy/issues/10370>`__. + +Changes to ``PyArray_GetDTypeTransferFunction`` +----------------------------------------------- +``PyArray_GetDTypeTransferFunction`` now defaults to using user-defined +``copyswapn`` / ``copyswap`` for user-defined dtypes. If this causes a +significant performance hit, consider implementing ``copyswapn`` to reflect the +implementation of ``PyArray_GetStridedCopyFn``. See `#10898 +<https://github.com/numpy/numpy/pull/10898>`__. -* ``PyArray_GetDTypeTransferFunction`` now defaults to using user-defined - ``copyswapn`` / ``copyswap`` for user-defined dtypes. If this causes a - significant performance hit, consider implementing ``copyswapn`` to reflect - the implementation of ``PyArray_GetStridedCopyFn``. - See `#10898 <https://github.com/numpy/numpy/pull/10898>`__. New Features ============ @@ -190,7 +236,7 @@ New Features -------------------------------------------------------------------- These compute the greatest common divisor, and lowest common multiple, respectively. These work on all the numpy integer types, as well as the -builtin arbitrary-precision `Decimal` and `long` types. +builtin arbitrary-precision ``Decimal`` and ``long`` types. Support for cross-platform builds for iOS ----------------------------------------- @@ -224,6 +270,22 @@ Added experimental support for the 64-bit RISC-V architecture. Improvements ============ +``np.einsum`` updates +--------------------- +Syncs einsum path optimization tech between `numpy` and `opt_einsum`. In +particular, the `greedy` path has received many enhancements by @jcmgray. A +full list of issues fixed are: + +* Arbitrary memory can be passed into the `greedy` path. Fixes gh-11210. +* The greedy path has been updated to contain more dynamic programming ideas + preventing a large number of duplicate (and expensive) calls that figure out + the actual pair contraction that takes place. Now takes a few seconds on + several hundred input tensors. Useful for matrix product state theories. +* Reworks the broadcasting dot error catching found in gh-11218 gh-10352 to be + a bit earlier in the process. +* Enhances the `can_dot` functionality that previous missed an edge case (part + of gh-11308). + ``np.ufunc.reduce`` and related functions now accept an initial value --------------------------------------------------------------------- ``np.ufunc.reduce``, ``np.sum``, ``np.prod``, ``np.min`` and ``np.max`` all @@ -236,7 +298,7 @@ the reduction with. axis is None, it will flip over all the axes. ``histogram`` and ``histogramdd`` functions have moved to ``np.lib.histograms`` ------------------------------------------------------------------------------- +------------------------------------------------------------------------------- These were originally found in ``np.lib.function_base``. They are still available under their un-scoped ``np.histogram(dd)`` names, and to maintain compatibility, aliased at ``np.lib.function_base.histogram(dd)``. @@ -250,9 +312,9 @@ Previously it would fail when trying to compute a finite range for the data. Since the range is ignored anyway when the bins are given explicitly, this error was needless. -Note that calling `histogram` on NaN values continues to raise the -`RuntimeWarning`s typical of working with nan values, which can be silenced -as usual with `errstate`. +Note that calling ``histogram`` on NaN values continues to raise the +``RuntimeWarning`` s typical of working with nan values, which can be silenced +as usual with ``errstate``. ``histogram`` works on datetime types, when explicit bin edges are given ------------------------------------------------------------------------ @@ -260,20 +322,20 @@ Dates, times, and timedeltas can now be histogrammed. The bin edges must be passed explicitly, and are not yet computed automatically. ``histogram`` "auto" estimator handles limited variance better ------------------------------------------------------------------------- -No longer does an IQR of 0 result in `n_bins=1`, rather the number of bins +-------------------------------------------------------------- +No longer does an IQR of 0 result in ``n_bins=1``, rather the number of bins chosen is related to the data size in this situation. -``histogram`` and ``histogramdd`` return edges matching the float type of the data ----------------------------------------------------------------------------------- -When passed ``float16``, ``np.float32``, or ``np.longdouble`` data, the +The edges retuned by `histogram`` and ``histogramdd`` now match the data float type +----------------------------------------------------------------------------------- +When passed ``np.float16``, ``np.float32``, or ``np.longdouble`` data, the returned edges are now of the same dtype. Previously, ``histogram`` would only return the same type if explicit bins were given, and ``histogram`` would produce ``float64`` bins no matter what the inputs. ``histogramdd`` allows explicit ranges to be given in a subset of axes ---------------------------------------------------------------------- -The ``range`` argument of `histogramdd` can now contain ``None`` values to +The ``range`` argument of `numpy.histogramdd` can now contain ``None`` values to indicate that the range for the corresponding axis should be computed from the data. Previously, this could not be specified on a per-axis basis. @@ -284,15 +346,15 @@ These arguments are now called ``density``, which is consistent with preferred. ``np.r_`` works with 0d arrays, and ``np.ma.mr_`` works with ``np.ma.masked`` ----------------------------------------------------------------------------- +----------------------------------------------------------------------------- 0d arrays passed to the `r_` and `mr_` concatenation helpers are now treated as though they are arrays of length 1. Previously, passing these was an error. -As a result, ``np.ma.mr_`` now works correctly on the ``masked`` constant. +As a result, `numpy.ma.mr_` now works correctly on the ``masked`` constant. ``np.ptp`` accepts a ``keepdims`` argument, and extended axis tuples -------------------------------------------------------------------- -``np.ptp`` (peak-to-peak) can now work over multiple axes, just like `max` and -`min`. +``np.ptp`` (peak-to-peak) can now work over multiple axes, just like ``np.max`` +and ``np.min``. ``MaskedArray.astype`` now is identical to ``ndarray.astype`` ------------------------------------------------------------- @@ -300,10 +362,10 @@ This means it takes all the same arguments, making more code written for ndarray work for masked array too. Enable AVX2/AVX512 at compile time -------------------------------------------------------------- -Change to simd.inc.src to use AVX2 or AVX512 at compile time. Solving the gap -that if compile numpy for avx2 (or 512) with -march=native, still get the SSE -code for the simd functions even though rest of the code gets AVX2. +---------------------------------- +Change to simd.inc.src to allow use of AVX2 or AVX512 at compile time. Previously +compilation for avx2 (or 512) with -march=native would still use the SSE +code for the simd functions even when the rest of the code got AVX2. ``nan_to_num`` always returns scalars when receiving scalar or 0d inputs ------------------------------------------------------------------------ @@ -329,7 +391,7 @@ As a result of this change, the ``period`` argument can now be used on 0d arrays. Allow dtype field names to be unicode in Python 2 ---------------------------------------------------------------- +------------------------------------------------- Previously ``np.dtype([(u'name', float)])`` would raise a ``TypeError`` in Python 2, as only bytestrings were allowed in field names. Now any unicode string field names will be encoded with the ``ascii`` codec, raising a @@ -438,9 +500,3 @@ is the same as:: ``np.put_along_axis`` acts as the dual operation for writing to these indices within an array. -.. note:: Implementations of ``__array_ufunc__`` should ensure that they can - handle either ``axis`` or ``axes``. In future, we may convert - ``axis`` to ``axes`` before passing it on. - -Changes -======= diff --git a/doc/release/1.15.1-notes.rst b/doc/release/1.15.1-notes.rst new file mode 100644 index 000000000..ddb83303c --- /dev/null +++ b/doc/release/1.15.1-notes.rst @@ -0,0 +1,74 @@ +========================== +NumPy 1.15.1 Release Notes +========================== + +This is a bugfix release for bugs and regressions reported following the 1.15.0 +release. + +* The annoying but harmless RuntimeWarning that "numpy.dtype size changed" has + been suppressed. The long standing suppression was lost in the transition to + pytest. +* The update to Cython 0.28.3 exposed a problematic use of a gcc attribute used + to prefer code size over speed in module initialization, possibly resulting in + incorrect compiled code. This has been fixed in latest Cython but has been + disabled here for safety. +* Support for big-endian and ARMv8 architectures has been improved. + +The Python versions supported by this release are 2.7, 3.4-3.7. The wheels are +linked with OpenBLAS v0.3.0, which should fix some of the linalg problems +reported for NumPy 1.14. + + +Compatibility Note +================== + +The NumPy 1.15.x OS X wheels released on PyPI no longer contain 32-bit +binaries. That will also be the case in future releases. See +`#11625 <https://github.com/numpy/numpy/issues/11625>`__ for the related +discussion. Those needing 32-bit support should look elsewhere or build +from source. + + +Contributors +============ + +A total of 7 people contributed to this release. People with a "+" by their +names contributed a patch for the first time. + +* Charles Harris +* Chris Billington +* Elliott Sales de Andrade + +* Eric Wieser +* Jeremy Manning + +* Matti Picus +* Ralf Gommers + +Pull requests merged +==================== + +A total of 24 pull requests were merged for this release. + +* `#11647 <https://github.com/numpy/numpy/pull/11647>`__: MAINT: Filter Cython warnings in ``__init__.py`` +* `#11648 <https://github.com/numpy/numpy/pull/11648>`__: BUG: Fix doc source links to unwrap decorators +* `#11657 <https://github.com/numpy/numpy/pull/11657>`__: BUG: Ensure singleton dimensions are not dropped when converting... +* `#11661 <https://github.com/numpy/numpy/pull/11661>`__: BUG: Warn on Nan in minimum,maximum for scalars +* `#11665 <https://github.com/numpy/numpy/pull/11665>`__: BUG: cython sometimes emits invalid gcc attribute +* `#11682 <https://github.com/numpy/numpy/pull/11682>`__: BUG: Fix regression in void_getitem +* `#11698 <https://github.com/numpy/numpy/pull/11698>`__: BUG: Make matrix_power again work for object arrays. +* `#11700 <https://github.com/numpy/numpy/pull/11700>`__: BUG: Add missing PyErr_NoMemory after failing malloc +* `#11719 <https://github.com/numpy/numpy/pull/11719>`__: BUG: Fix undefined functions on big-endian systems. +* `#11720 <https://github.com/numpy/numpy/pull/11720>`__: MAINT: Make einsum optimize default to False. +* `#11746 <https://github.com/numpy/numpy/pull/11746>`__: BUG: Fix regression in loadtxt for bz2 text files in Python 2. +* `#11757 <https://github.com/numpy/numpy/pull/11757>`__: BUG: Revert use of `console_scripts`. +* `#11758 <https://github.com/numpy/numpy/pull/11758>`__: BUG: Fix Fortran kind detection for aarch64 & s390x. +* `#11759 <https://github.com/numpy/numpy/pull/11759>`__: BUG: Fix printing of longdouble on ppc64le. +* `#11760 <https://github.com/numpy/numpy/pull/11760>`__: BUG: Fixes for unicode field names in Python 2 +* `#11761 <https://github.com/numpy/numpy/pull/11761>`__: BUG: Increase required cython version on python 3.7 +* `#11763 <https://github.com/numpy/numpy/pull/11763>`__: BUG: check return value of _buffer_format_string +* `#11775 <https://github.com/numpy/numpy/pull/11775>`__: MAINT: Make assert_array_compare more generic. +* `#11776 <https://github.com/numpy/numpy/pull/11776>`__: TST: Fix urlopen stubbing. +* `#11777 <https://github.com/numpy/numpy/pull/11777>`__: BUG: Fix regression in intersect1d. +* `#11779 <https://github.com/numpy/numpy/pull/11779>`__: BUG: Fix test sensitive to platform byte order. +* `#11781 <https://github.com/numpy/numpy/pull/11781>`__: BUG: Avoid signed overflow in histogram +* `#11785 <https://github.com/numpy/numpy/pull/11785>`__: BUG: Fix pickle and memoryview for datetime64, timedelta64 scalars +* `#11786 <https://github.com/numpy/numpy/pull/11786>`__: BUG: Deprecation triggers segfault diff --git a/doc/release/1.16.0-notes.rst b/doc/release/1.16.0-notes.rst index c264d4ad8..70e5f469b 100644 --- a/doc/release/1.16.0-notes.rst +++ b/doc/release/1.16.0-notes.rst @@ -2,6 +2,15 @@ NumPy 1.16.0 Release Notes ========================== +This NumPy release is the last one to support Python 2.7. It will be maintained +as a long term release with bug fixes only through 2020. To that end, the +planned code reorganization detailed in NEP-0015 has been made in order to +facilitate backporting fixes from future releases, which will now have the +same code organization. + +Support for Python 3.4 been dropped in this release, the supported Python +versions are 2.7 and 3.5-3.7. The wheels are linked with OpenBLAS v0.3.0 . + Highlights ========== @@ -15,19 +24,36 @@ Deprecations ============ `typeNA` and `sctypeNA` have been deprecated -------------------------------------------- +-------------------------------------------- The type dictionaries `numpy.core.typeNA` and `numpy.core.sctypeNA` were buggy -and not documented. They will be removed in the 1.18 release. Use +and not documented. They will be removed in the 1.18 release. Use `numpy.sctypeDict` instead. + +``np.PackageLoader`` and ``np.pkgload`` have been removed +--------------------------------------------------------- +These were deprecated in 1.10, had no tests, and seem to no longer work in +1.15 anyway. + + Future Changes ============== +* NumPy 1.17 will drop support for Python 2.7. + Compatibility notes =================== +f2py script on Windows +---------------------- +On Windows, the installed script for running f2py is now an ``.exe`` file +rather than a ``*.py`` file and should be run from the command line as ``f2py`` +whenever the ``Scripts`` directory is in the path. Folks needing compatibility +with earler versions of Numpy should run ``f2py`` as a module: ``python -m +numpy.f2py [...]``. + C API changes ============= @@ -40,13 +66,33 @@ New Features Improvements ============ +build shell independence +------------------------ +NumPy builds should no longer interact with the host machine +shell directly. ``exec_command`` has been replaced with +``subprocess.check_output`` where appropriate. + + +`np.polynomial.Polynomial` classes render in LaTeX in Jupyter notebooks +----------------------------------------------------------------------- + +When used in a front-end that supports it, `Polynomial` instances are now +rendered through LaTeX. The current format is experimental, and is subject to +change. + ``randint`` and ``choice`` now work on empty distributions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +---------------------------------------------------------- Even when no elements needed to be drawn, ``np.random.randint`` and ``np.random.choice`` raised an error when the arguments described an empty distribution. This has been fixed so that e.g. ``np.random.choice([], 0) == np.array([], dtype=float64)``. +``linalg.lstsq`` and ``linalg.qr`` now work with empty matrices +--------------------------------------------------------------- +Previously, a ``LinAlgError`` would be raised when an empty matrix/empty +matrices (with zero rows and/or columns) is/are passed in. Now outputs of +appropriate shapes are returned. + ARM support updated ------------------- Support for ARM CPUs has been updated to accommodate 32 and 64 bit targets, @@ -100,16 +146,45 @@ will have shape ``()``. In this way, the signature allows one to use a single elementary function for four related but different signatures, ``(m,n),(n,p)->(m,p)``, ``(n),(n,p)->(p)``, ``(m,n),(n)->(m)`` and ``(n),(n)->()``. +``np.clip`` and the ``clip`` method check for memory overlap +------------------------------------------------------------ +The ``out`` argument to these functions is now always tested for memory overlap +to avoid corrupted results when memory overlap occurs. + Changes ======= Comparison ufuncs will now error rather than return NotImplemented ------------------------------------------------------------------ - Previously, comparison ufuncs such as ``np.equal`` would return `NotImplemented` if their arguments had structured dtypes, to help comparison operators such as ``__eq__`` deal with those. This is no longer needed, as the relevant logic has moved to the comparison operators proper (which thus do continue to return `NotImplemented` as needed). Hence, like all other ufuncs, the comparison ufuncs will now error on structured dtypes. + +Positive will now raise a deprecation warning for non-numerical arrays +---------------------------------------------------------------------- +Previously, ``+array`` unconditionally returned a copy. Now, it will +raise a ``DeprecationWarning`` if the array is not numerical (i.e., +if ``np.positive(array)`` raises a ``TypeError``. For ``ndarray`` +subclasses that override the default ``__array_ufunc__`` implementation, +the ``TypeError`` is passed on. + +``maximum`` and ``minimum`` set invalid float status for more dtypes +-------------------------------------------------------------------- +Previously only ``float32`` and ``float64`` set invalid float status (by +default emitting a `RuntimeWarning`) when a Nan is encountered in +`numpy.maximum` and `numpy.minimum`. Now ``float16``, ``complex64``, +``complex128`` and ``complex256`` will do so as well. + +Umath and multiarray c-extension modules merged into a single module +-------------------------------------------------------------------- +The two modules were merged, according to the first step in `NEP 15`_. +Previously `np.core.umath` and `np.core.multiarray` were the c-extension +modules, they are now python wrappers to the single `np.core/_multiarray_math` +c-extension module. + +.. _`NEP 15` : http://www.numpy.org/neps/nep-0015-merge-multiarray-umath.html + diff --git a/doc/release/1.7.0-notes.rst b/doc/release/1.7.0-notes.rst index 09e6924e6..f111f80dc 100644 --- a/doc/release/1.7.0-notes.rst +++ b/doc/release/1.7.0-notes.rst @@ -280,9 +280,9 @@ The macros in old_defines.h are deprecated and will be removed in the next major release (>= 2.0). The sed script tools/replace_old_macros.sed can be used to replace these macros with the newer versions. -You can test your code against the deprecated C API by #defining -NPY_NO_DEPRECATED_API to the target version number, for example -NPY_1_7_API_VERSION, before including any NumPy headers. +You can test your code against the deprecated C API by adding a line +composed of ``#define NPY_NO_DEPRECATED_API`` and the target version number, +such as ``NPY_1_7_API_VERSION``, before including any NumPy headers. The ``NPY_CHAR`` member of the ``NPY_TYPES`` enum is deprecated and will be removed in NumPy 1.8. See the discussion at diff --git a/doc/source/conf.py b/doc/source/conf.py index 93a5ea01e..455e9748b 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -321,6 +321,15 @@ def linkcode_resolve(domain, info): except Exception: return None + # strip decorators, which would resolve to the source of the decorator + # possibly an upstream bug in getsourcefile, bpo-1764286 + try: + unwrap = inspect.unwrap + except AttributeError: + pass + else: + obj = unwrap(obj) + try: fn = inspect.getsourcefile(obj) except Exception: diff --git a/doc/source/dev/conduct/code_of_conduct.rst b/doc/source/dev/conduct/code_of_conduct.rst new file mode 100644 index 000000000..604f14662 --- /dev/null +++ b/doc/source/dev/conduct/code_of_conduct.rst @@ -0,0 +1,164 @@ +NumPy Code of Conduct +===================== + + +Introduction +------------ + +This code of conduct applies to all spaces managed by the NumPy project, +including all public and private mailing lists, issue trackers, wikis, blogs, +Twitter, and any other communication channel used by our community. The NumPy +project does not organise in-person events, however events related to our +community should have a code of conduct similar in spirit to this one. + +This code of conduct should be honored by everyone who participates in +the NumPy community formally or informally, or claims any affiliation with the +project, in any project-related activities and especially when representing the +project, in any role. + +This code is not exhaustive or complete. It serves to distill our common +understanding of a collaborative, shared environment and goals. Please try to +follow this code in spirit as much as in letter, to create a friendly and +productive environment that enriches the surrounding community. + + +Specific Guidelines +------------------- + +We strive to: + +1. Be open. We invite anyone to participate in our community. We prefer to use + public methods of communication for project-related messages, unless + discussing something sensitive. This applies to messages for help or + project-related support, too; not only is a public support request much more + likely to result in an answer to a question, it also ensures that any + inadvertent mistakes in answering are more easily detected and corrected. + +2. Be empathetic, welcoming, friendly, and patient. We work together to resolve + conflict, and assume good intentions. We may all experience some frustration + from time to time, but we do not allow frustration to turn into a personal + attack. A community where people feel uncomfortable or threatened is not a + productive one. + +3. Be collaborative. Our work will be used by other people, and in turn we will + depend on the work of others. When we make something for the benefit of the + project, we are willing to explain to others how it works, so that they can + build on the work to make it even better. Any decision we make will affect + users and colleagues, and we take those consequences seriously when making + decisions. + +4. Be inquisitive. Nobody knows everything! Asking questions early avoids many + problems later, so we encourage questions, although we may direct them to + the appropriate forum. We will try hard to be responsive and helpful. + +5. Be careful in the words that we choose. We are careful and respectful in + our communication and we take responsibility for our own speech. Be kind to + others. Do not insult or put down other participants. We will not accept + harassment or other exclusionary behaviour, such as: + + - Violent threats or language directed against another person. + - Sexist, racist, or otherwise discriminatory jokes and language. + - Posting sexually explicit or violent material. + - Posting (or threatening to post) other people's personally identifying information ("doxing"). + - Sharing private content, such as emails sent privately or non-publicly, + or unlogged forums such as IRC channel history, without the sender's consent. + - Personal insults, especially those using racist or sexist terms. + - Unwelcome sexual attention. + - Excessive profanity. Please avoid swearwords; people differ greatly in their sensitivity to swearing. + - Repeated harassment of others. In general, if someone asks you to stop, then stop. + - Advocating for, or encouraging, any of the above behaviour. + + +Diversity Statement +------------------- + +The NumPy project welcomes and encourages participation by everyone. We are +committed to being a community that everyone enjoys being part of. Although +we may not always be able to accommodate each individual's preferences, we try +our best to treat everyone kindly. + +No matter how you identify yourself or how others perceive you: we welcome you. +Though no list can hope to be comprehensive, we explicitly honour diversity in: +age, culture, ethnicity, genotype, gender identity or expression, language, +national origin, neurotype, phenotype, political beliefs, profession, race, +religion, sexual orientation, socioeconomic status, subculture and technical +ability, to the extent that these do not conflict with this code of conduct. + + +Though we welcome people fluent in all languages, NumPy development is +conducted in English. + +Standards for behaviour in the NumPy community are detailed in the Code of +Conduct above. Participants in our community should uphold these standards +in all their interactions and help others to do so as well (see next section). + + +Reporting Guidelines +-------------------- + +We know that it is painfully common for internet communication to start at or +devolve into obvious and flagrant abuse. We also recognize that sometimes +people may have a bad day, or be unaware of some of the guidelines in this Code +of Conduct. Please keep this in mind when deciding on how to respond to a +breach of this Code. + +For clearly intentional breaches, report those to the Code of Conduct committee +(see below). For possibly unintentional breaches, you may reply to the person +and point out this code of conduct (either in public or in private, whatever is +most appropriate). If you would prefer not to do that, please feel free to +report to the Code of Conduct Committee directly, or ask the Committee for +advice, in confidence. + +You can report issues to the NumPy Code of Conduct committee, at +numpy-conduct@googlegroups.com. Currently, the committee consists of: + +- Stefan van der Walt +- Nathaniel J. Smith +- Ralf Gommers + +If your report involves any members of the committee, or if they feel they have +a conflict of interest in handling it, then they will recuse themselves from +considering your report. Alternatively, if for any reason you feel +uncomfortable making a report to the committee, then you can also contact: + +- NumFOCUS Executive Director: Leah Silen +- NumFOCUS President: Andy Terrel + + +Incident reporting resolution & Code of Conduct enforcement +----------------------------------------------------------- + +*This section summarizes the most important points, more details can be found +in* :ref:`CoC_reporting_manual`. + +We will investigate and respond to all complaints. The NumPy Code of Conduct +Committee and the NumPy Steering Committee (if involved) will protect the +identity of the reporter, and treat the content of complaints as confidential +(unless the reporter agrees otherwise). + +In case of severe and obvious breaches, e.g. personal threat or violent, sexist +or racist language, we will immediately disconnect the originator from NumPy +communication channels; please see the manual for details. + +In cases not involving clear severe and obvious breaches of this code of +conduct, the process for acting on any received code of conduct violation +report will be: + +1. acknowledge report is received +2. reasonable discussion/feedback +3. mediation (if feedback didn't help, and only if both reporter and reportee agree to this) +4. enforcement via transparent decision (see :ref:`CoC_resolutions`) by the + Code of Conduct Committee + +The committee will respond to any report as soon as possible, and at most +within 72 hours. + + +Endnotes +-------- + +We are thankful to the groups behind the following documents, from which we +drew content and inspiration: + +- `The SciPy Code of Conduct <https://docs.scipy.org/doc/scipy/reference/dev/conduct/code_of_conduct.html>`_ + diff --git a/doc/source/dev/conduct/report_handling_manual.rst b/doc/source/dev/conduct/report_handling_manual.rst new file mode 100644 index 000000000..5f5e32f13 --- /dev/null +++ b/doc/source/dev/conduct/report_handling_manual.rst @@ -0,0 +1,218 @@ +.. _CoC_reporting_manual: + +NumPy Code of Conduct - How to follow up on a report +---------------------------------------------------- + +This is the manual followed by NumPy's Code of Conduct Committee. It's used +when we respond to an issue to make sure we're consistent and fair. + +Enforcing the Code of Conduct impacts our community today and for the future. +It's an action that we do not take lightly. When reviewing enforcement +measures, the Code of Conduct Committee will keep the following values and +guidelines in mind: + +* Act in a personal manner rather than impersonal. The Committee can engage + the parties to understand the situation, while respecting the privacy and any + necessary confidentiality of reporters. However, sometimes it is necessary + to communicate with one or more individuals directly: the Committee's goal is + to improve the health of our community rather than only produce a formal + decision. + +* Emphasize empathy for individuals rather than judging behavior, avoiding + binary labels of "good" and "bad/evil". Overt, clear-cut aggression and + harassment exists and we will be address that firmly. But many scenarios + that can prove challenging to resolve are those where normal disagreements + devolve into unhelpful or harmful behavior from multiple parties. + Understanding the full context and finding a path that re-engages all is + hard, but ultimately the most productive for our community. + +* We understand that email is a difficult medium and can be isolating. + Receiving criticism over email, without personal contact, can be + particularly painful. This makes it especially important to keep an + atmosphere of open-minded respect of the views of others. It also means + that we must be transparent in our actions, and that we will do everything + in our power to make sure that all our members are treated fairly and with + sympathy. + +* Discrimination can be subtle and it can be unconscious. It can show itself + as unfairness and hostility in otherwise ordinary interactions. We know + that this does occur, and we will take care to look out for it. We would + very much like to hear from you if you feel you have been treated unfairly, + and we will use these procedures to make sure that your complaint is heard + and addressed. + +* Help increase engagement in good discussion practice: try to identify where + discussion may have broken down and provide actionable information, pointers + and resources that can lead to positive change on these points. + +* Be mindful of the needs of new members: provide them with explicit support + and consideration, with the aim of increasing participation from + underrepresented groups in particular. + +* Individuals come from different cultural backgrounds and native languages. + Try to identify any honest misunderstandings caused by a non-native speaker + and help them understand the issue and what they can change to avoid causing + offence. Complex discussion in a foreign language can be very intimidating, + and we want to grow our diversity also across nationalities and cultures. + +*Mediation*: voluntary, informal mediation is a tool at our disposal. In +contexts such as when two or more parties have all escalated to the point of +inappropriate behavior (something sadly common in human conflict), it may be +useful to facilitate a mediation process. This is only an example: the +Committee can consider mediation in any case, mindful that the process is meant +to be strictly voluntary and no party can be pressured to participate. If the +Committee suggests mediation, it should: + +* Find a candidate who can serve as a mediator. +* Obtain the agreement of the reporter(s). The reporter(s) have complete + freedom to decline the mediation idea, or to propose an alternate mediator. +* Obtain the agreement of the reported person(s). +* Settle on the mediator: while parties can propose a different mediator than + the suggested candidate, only if common agreement is reached on all terms can + the process move forward. +* Establish a timeline for mediation to complete, ideally within two weeks. + +The mediator will engage with all the parties and seek a resolution that is +satisfactory to all. Upon completion, the mediator will provide a report +(vetted by all parties to the process) to the Committee, with recommendations +on further steps. The Committee will then evaluate these results (whether +satisfactory resolution was achieved or not) and decide on any additional +action deemed necessary. + + +How the committee will respond to reports +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +When the committee (or a committee member) receives a report, they will first +determine whether the report is about a clear and severe breach (as defined +below). If so, immediate action needs to be taken in addition to the regular +report handling process. + +Clear and severe breach actions ++++++++++++++++++++++++++++++++ + +We know that it is painfully common for internet communication to start at or +devolve into obvious and flagrant abuse. We will deal quickly with clear and +severe breaches like personal threats, violent, sexist or racist language. + +When a member of the Code of Conduct committee becomes aware of a clear and +severe breach, they will do the following: + +* Immediately disconnect the originator from all NumPy communication channels. +* Reply to the reporter that their report has been received and that the + originator has been disconnected. +* In every case, the moderator should make a reasonable effort to contact the + originator, and tell them specifically how their language or actions + qualify as a "clear and severe breach". The moderator should also say + that, if the originator believes this is unfair or they want to be + reconnected to NumPy, they have the right to ask for a review, as below, by + the Code of Conduct Committee. + The moderator should copy this explanation to the Code of Conduct Committee. +* The Code of Conduct Committee will formally review and sign off on all cases + where this mechanism has been applied to make sure it is not being used to + control ordinary heated disagreement. + +Report handling ++++++++++++++++ + +When a report is sent to the committee they will immediately reply to the +reporter to confirm receipt. This reply must be sent within 72 hours, and the +group should strive to respond much quicker than that. + +If a report doesn't contain enough information, the committee will obtain all +relevant data before acting. The committee is empowered to act on the Steering +Council’s behalf in contacting any individuals involved to get a more complete +account of events. + +The committee will then review the incident and determine, to the best of their +ability: + +* What happened. +* Whether this event constitutes a Code of Conduct violation. +* Who are the responsible party(ies). +* Whether this is an ongoing situation, and there is a threat to anyone's + physical safety. + +This information will be collected in writing, and whenever possible the +group's deliberations will be recorded and retained (i.e. chat transcripts, +email discussions, recorded conference calls, summaries of voice conversations, +etc). + +It is important to retain an archive of all activities of this committee to +ensure consistency in behavior and provide institutional memory for the +project. To assist in this, the default channel of discussion for this +committee will be a private mailing list accessible to current and future +members of the committee as well as members of the Steering Council upon +justified request. If the Committee finds the need to use off-list +communications (e.g. phone calls for early/rapid response), it should in all +cases summarize these back to the list so there's a good record of the process. + +The Code of Conduct Committee should aim to have a resolution agreed upon within +two weeks. In the event that a resolution can't be determined in that time, the +committee will respond to the reporter(s) with an update and projected timeline +for resolution. + + +.. _CoC_resolutions: + +Resolutions +~~~~~~~~~~~ + +The committee must agree on a resolution by consensus. If the group cannot reach +consensus and deadlocks for over a week, the group will turn the matter over to +the Steering Council for resolution. + + +Possible responses may include: + +* Taking no further action + + - if we determine no violations have occurred. + - if the matter has been resolved publicly while the committee was considering responses. + +* Coordinating voluntary mediation: if all involved parties agree, the + Committee may facilitate a mediation process as detailed above. +* Remind publicly, and point out that some behavior/actions/language have been + judged inappropriate and why in the current context, or can but hurtful to + some people, requesting the community to self-adjust. +* A private reprimand from the committee to the individual(s) involved. In this + case, the group chair will deliver that reprimand to the individual(s) over + email, cc'ing the group. +* A public reprimand. In this case, the committee chair will deliver that + reprimand in the same venue that the violation occurred, within the limits of + practicality. E.g., the original mailing list for an email violation, but + for a chat room discussion where the person/context may be gone, they can be + reached by other means. The group may choose to publish this message + elsewhere for documentation purposes. +* A request for a public or private apology, assuming the reporter agrees to + this idea: they may at their discretion refuse further contact with the + violator. The chair will deliver this request. The committee may, if it + chooses, attach "strings" to this request: for example, the group may ask a + violator to apologize in order to retain one’s membership on a mailing list. +* A "mutually agreed upon hiatus" where the committee asks the individual to + temporarily refrain from community participation. If the individual chooses + not to take a temporary break voluntarily, the committee may issue a + "mandatory cooling off period". +* A permanent or temporary ban from some or all NumPy spaces (mailing lists, + gitter.im, etc.). The group will maintain records of all such bans so that + they may be reviewed in the future or otherwise maintained. + +Once a resolution is agreed upon, but before it is enacted, the committee will +contact the original reporter and any other affected parties and explain the +proposed resolution. The committee will ask if this resolution is acceptable, +and must note feedback for the record. + +Finally, the committee will make a report to the NumPy Steering Council (as +well as the NumPy core team in the event of an ongoing resolution, such as a +ban). + +The committee will never publicly discuss the issue; all public statements will +be made by the chair of the Code of Conduct Committee or the NumPy Steering +Council. + + +Conflicts of Interest +~~~~~~~~~~~~~~~~~~~~~ + +In the event of any conflict of interest, a committee member must immediately +notify the other members, and recuse themselves if necessary. diff --git a/doc/source/dev/development_environment.rst b/doc/source/dev/development_environment.rst index 0c9f307f8..aa4326f63 100644 --- a/doc/source/dev/development_environment.rst +++ b/doc/source/dev/development_environment.rst @@ -59,7 +59,7 @@ For development, you can set up an in-place build so that changes made to This allows you to import the in-place built NumPy *from the repo base directory only*. If you want the in-place build to be visible outside that base dir, you need to point your ``PYTHONPATH`` environment variable to this -directory. Some IDEs (Spyder for example) have utilities to manage +directory. Some IDEs (`Spyder`_ for example) have utilities to manage ``PYTHONPATH``. On Linux and OSX, you can run the command:: $ export PYTHONPATH=$PWD @@ -78,6 +78,8 @@ installs a ``.egg-link`` file into your site-packages as well as adjusts the ``easy-install.pth`` there, so its a more permanent (and magical) operation. +.. _Spyder: https://www.spyder-ide.org/ + Other build options ------------------- @@ -214,13 +216,13 @@ Understanding the code & getting started ---------------------------------------- The best strategy to better understand the code base is to pick something you -want to change and start reading the code to figure out how it works. When in +want to change and start reading the code to figure out how it works. When in doubt, you can ask questions on the mailing list. It is perfectly okay if your -pull requests aren't perfect, the community is always happy to help. As a -volunteer project, things do sometimes get dropped and it's totally fine to +pull requests aren't perfect, the community is always happy to help. As a +volunteer project, things do sometimes get dropped and it's totally fine to ping us if something has sat without a response for about two to four weeks. -So go ahead and pick something that annoys or confuses you about numpy, -experiment with the code, hang around for discussions or go through the -reference documents to try to fix it. Things will fall in place and soon +So go ahead and pick something that annoys or confuses you about numpy, +experiment with the code, hang around for discussions or go through the +reference documents to try to fix it. Things will fall in place and soon you'll have a pretty good understanding of the project as a whole. Good Luck! diff --git a/doc/source/dev/governance/people.rst b/doc/source/dev/governance/people.rst index b22852a5a..7b8d3cab0 100644 --- a/doc/source/dev/governance/people.rst +++ b/doc/source/dev/governance/people.rst @@ -28,6 +28,8 @@ Steering council * Allan Haldane +* Stefan van der Walt + Emeritus members ---------------- @@ -54,7 +56,7 @@ NumFOCUS Subcommittee Institutional Partners ---------------------- -* UC Berkeley (Nathaniel Smith) +* UC Berkeley (Stefan van der Walt) Document history diff --git a/doc/source/dev/index.rst b/doc/source/dev/index.rst index 04c84eb61..9ce04cc1b 100644 --- a/doc/source/dev/index.rst +++ b/doc/source/dev/index.rst @@ -5,6 +5,7 @@ Contributing to NumPy .. toctree:: :maxdepth: 3 + conduct/code_of_conduct gitwash/index development_environment releasing diff --git a/doc/source/f2py/compile_session.dat b/doc/source/f2py/compile_session.dat index 0d8408198..5c42742be 100644 --- a/doc/source/f2py/compile_session.dat +++ b/doc/source/f2py/compile_session.dat @@ -1,10 +1,10 @@ ->>> import f2py2e +>>> import numpy.f2py >>> fsource = ''' ... subroutine foo ... print*, "Hello world!" ... end ... ''' ->>> f2py2e.compile(fsource,modulename='hello',verbose=0) +>>> numpy.f2py.compile(fsource, modulename='hello', verbose=0) 0 >>> import hello >>> hello.foo() diff --git a/doc/source/f2py/getting-started.rst b/doc/source/f2py/getting-started.rst index fffd61c45..3d8ea24e4 100644 --- a/doc/source/f2py/getting-started.rst +++ b/doc/source/f2py/getting-started.rst @@ -45,9 +45,9 @@ to run :: - f2py -c fib1.f -m fib1 + python -m numpy.f2py -c fib1.f -m fib1 -This command builds (see ``-c`` flag, execute ``f2py`` without +This command builds (see ``-c`` flag, execute ``python -m numpy.f2py`` without arguments to see the explanation of command line options) an extension module ``fib1.so`` (see ``-m`` flag) to the current directory. Now, in Python the Fortran subroutine ``FIB`` is accessible via ``fib1.fib``:: @@ -162,7 +162,7 @@ one. :: - f2py fib1.f -m fib2 -h fib1.pyf + python -m numpy.f2py fib1.f -m fib2 -h fib1.pyf The signature file is saved to ``fib1.pyf`` (see ``-h`` flag) and its contents is shown below. @@ -188,7 +188,7 @@ one. :: - f2py -c fib2.pyf fib1.f + python -m numpy.f2py -c fib2.pyf fib1.f In Python:: @@ -243,7 +243,7 @@ __ fib3.f Building the extension module can be now carried out in one command:: - f2py -c -m fib3 fib3.f + python -m numpy.f2py -c -m fib3 fib3.f Notice that the resulting wrapper to ``FIB`` is as "smart" as in previous case:: diff --git a/doc/source/f2py/run_main_session.dat b/doc/source/f2py/run_main_session.dat index 29ecc3dfe..b9a7e1b0d 100644 --- a/doc/source/f2py/run_main_session.dat +++ b/doc/source/f2py/run_main_session.dat @@ -1,14 +1,14 @@ ->>> import f2py2e ->>> r=f2py2e.run_main(['-m','scalar','docs/usersguide/scalar.f']) +>>> import numpy.f2py +>>> r = numpy.f2py.run_main(['-m','scalar','doc/source/f2py/scalar.f']) Reading fortran codes... - Reading file 'docs/usersguide/scalar.f' + Reading file 'doc/source/f2py/scalar.f' (format:fix,strict) Post-processing... Block: scalar Block: FOO Building modules... Building module "scalar"... Wrote C/API module "scalar" to file "./scalarmodule.c" ->>> print r -{'scalar': {'h': ['/home/users/pearu/src_cvs/f2py2e/src/fortranobject.h'], +>>> printr(r) +{'scalar': {'h': ['/home/users/pearu/src_cvs/f2py/src/fortranobject.h'], 'csrc': ['./scalarmodule.c', - '/home/users/pearu/src_cvs/f2py2e/src/fortranobject.c']}} + '/home/users/pearu/src_cvs/f2py/src/fortranobject.c']}} diff --git a/doc/source/f2py/usage.rst b/doc/source/f2py/usage.rst index a6f093154..0f5068e0e 100644 --- a/doc/source/f2py/usage.rst +++ b/doc/source/f2py/usage.rst @@ -3,7 +3,19 @@ Using F2PY =========== F2PY can be used either as a command line tool ``f2py`` or as a Python -module ``f2py2e``. +module ``numpy.f2py``. While we try to install the command line tool as part +of the numpy setup, some platforms like Windows make it difficult to +reliably put the executable on the ``PATH``. We will refer to ``f2py`` +in this document but you may have to run it as a module + +``` +python -m numpy.f2py +``` + +If you run ``f2py`` with no arguments, and the line ``numpy Version`` at the +end matches the NumPy version printed from ``python -m numpy.f2py``, then you +can use the shorter version. If not, or if you cannot run ``f2py``, you should +replace all calls to ``f2py`` here with the longer version. Command ``f2py`` ================= @@ -194,15 +206,15 @@ Other options: Execute ``f2py`` without any options to get an up-to-date list of available options. -Python module ``f2py2e`` -========================= +Python module ``numpy.f2py`` +============================ .. warning:: - The current Python interface to ``f2py2e`` module is not mature and - may change in future depending on users needs. + The current Python interface to the ``f2py`` module is not mature and + may change in the future. -The following functions are provided by the ``f2py2e`` module: +The following functions are provided by the ``numpy.f2py`` module: ``run_main(<list>)`` Equivalent to running:: diff --git a/doc/source/reference/arrays.dtypes.rst b/doc/source/reference/arrays.dtypes.rst index d771f2940..f2072263f 100644 --- a/doc/source/reference/arrays.dtypes.rst +++ b/doc/source/reference/arrays.dtypes.rst @@ -391,8 +391,8 @@ Type strings When the optional keys *offsets* and *titles* are provided, their values must each be lists of the same length as the *names* and *formats* lists. The *offsets* value is a list of byte offsets - (integers) for each field, while the *titles* value is a list of - titles for each field (:const:`None` can be used if no title is + (limited to `ctypes.c_int`) for each field, while the *titles* value is a + list of titles for each field (:const:`None` can be used if no title is desired for that field). The *titles* can be any :class:`string` or :class:`unicode` object and will add another entry to the fields dictionary keyed by the title and referencing the same @@ -402,7 +402,8 @@ Type strings The *itemsize* key allows the total size of the dtype to be set, and must be an integer large enough so all the fields are within the dtype. If the dtype being constructed is aligned, - the *itemsize* must also be divisible by the struct alignment. + the *itemsize* must also be divisible by the struct alignment. Total dtype + *itemsize* is limited to `ctypes.c_int`. .. admonition:: Example diff --git a/doc/source/reference/c-api.array.rst b/doc/source/reference/c-api.array.rst index 5ea7bfcfc..9265b1a97 100644 --- a/doc/source/reference/c-api.array.rst +++ b/doc/source/reference/c-api.array.rst @@ -122,9 +122,11 @@ sub-types). .. c:function:: PyObject *PyArray_GETITEM(PyArrayObject* arr, void* itemptr) - Get a Python object from the ndarray, *arr*, at the location - pointed to by itemptr. Return ``NULL`` on failure. - + Get a Python object of a builtin type from the ndarray, *arr*, + at the location pointed to by itemptr. Return ``NULL`` on failure. + + `numpy.ndarray.item` is identical to PyArray_GETITEM. + .. c:function:: int PyArray_SETITEM( \ PyArrayObject* arr, void* itemptr, PyObject* obj) diff --git a/doc/source/reference/c-api.ufunc.rst b/doc/source/reference/c-api.ufunc.rst index 8c2554a9e..07c7b0c80 100644 --- a/doc/source/reference/c-api.ufunc.rst +++ b/doc/source/reference/c-api.ufunc.rst @@ -85,12 +85,61 @@ Functions Must to an array of length *ntypes* containing :c:type:`PyUFuncGenericFunction` items. These items are pointers to functions that actually implement the underlying - (element-by-element) function :math:`N` times. + (element-by-element) function :math:`N` times with the following + signature: + + .. c:function:: void loopfunc( + char** args, npy_intp* dimensions, npy_intp* steps, void* data) + + *args* + + An array of pointers to the actual data for the input and output + arrays. The input arguments are given first followed by the output + arguments. + + *dimensions* + + A pointer to the size of the dimension over which this function is + looping. + + *steps* + + A pointer to the number of bytes to jump to get to the + next element in this dimension for each of the input and + output arguments. + + *data* + + Arbitrary data (extra arguments, function names, *etc.* ) + that can be stored with the ufunc and will be passed in + when it is called. + + This is an example of a func specialized for addition of doubles + returning doubles. + + .. code-block:: c + + static void + double_add(char **args, npy_intp *dimensions, npy_intp *steps, + void *extra) + { + npy_intp i; + npy_intp is1 = steps[0], is2 = steps[1]; + npy_intp os = steps[2], n = dimensions[0]; + char *i1 = args[0], *i2 = args[1], *op = args[2]; + for (i = 0; i < n; i++) { + *((double *)op) = *((double *)i1) + + *((double *)i2); + i1 += is1; + i2 += is2; + op += os; + } + } :param data: Should be ``NULL`` or a pointer to an array of size *ntypes* . This array may contain arbitrary extra-data to be passed to - the corresponding 1-d loop function in the func array. + the corresponding loop function in the func array. :param types: Length ``(nin + nout) * ntypes`` array of ``char`` encoding the @@ -102,6 +151,9 @@ Functions be ``(char[]) {5, 5, 0, 7, 7, 0}`` since ``NPY_INT32`` is 5, ``NPY_INT64`` is 7, and ``NPY_BOOL`` is 0. + The bit-width names can also be used (e.g. :c:data:`NPY_INT32`, + :c:data:`NPY_COMPLEX128` ) if desired. + :ref:`ufuncs.casting` will be used at runtime to find the first ``func`` callable by the input/output provided. @@ -114,14 +166,19 @@ Functions :param nout: The number of outputs + :param identity: + + Either :c:data:`PyUFunc_One`, :c:data:`PyUFunc_Zero`, + :c:data:`PyUFunc_None`. This specifies what should be returned when + an empty array is passed to the reduce method of the ufunc. + :param name: - The name for the ufunc. Specifying a name of 'add' or - 'multiply' enables a special behavior for integer-typed - reductions when no dtype is given. If the input type is an - integer (or boolean) data type smaller than the size of the - `numpy.int_` data type, it will be internally upcast to the - `numpy.int_` (or `numpy.uint`) - data type. + The name for the ufunc as a ``NULL`` terminated string. Specifying + a name of 'add' or 'multiply' enables a special behavior for + integer-typed reductions when no dtype is given. If the input type is an + integer (or boolean) data type smaller than the size of the `numpy.int_` + data type, it will be internally upcast to the `numpy.int_` (or + `numpy.uint`) data type. :param doc: Allows passing in a documentation string to be stored with the diff --git a/doc/source/reference/internals.code-explanations.rst b/doc/source/reference/internals.code-explanations.rst index ca81e1676..65553e07e 100644 --- a/doc/source/reference/internals.code-explanations.rst +++ b/doc/source/reference/internals.code-explanations.rst @@ -17,7 +17,7 @@ pieces of code. The purpose behind these explanations is to enable somebody to be able to understand the ideas behind the implementation somewhat more easily than just staring at the code. Perhaps in this way, the algorithms can be improved on, borrowed from, and/or -optimized. +optimized by more people. Memory model @@ -133,9 +133,9 @@ Broadcasting .. index:: single: broadcasting -In Numeric, broadcasting was implemented in several lines of code -buried deep in ufuncobject.c. In NumPy, the notion of broadcasting has -been abstracted so that it can be performed in multiple places. +In Numeric, the ancestor of Numpy, broadcasting was implemented in several +lines of code buried deep in ufuncobject.c. In NumPy, the notion of broadcasting +has been abstracted so that it can be performed in multiple places. Broadcasting is handled by the function :c:func:`PyArray_Broadcast`. This function requires a :c:type:`PyArrayMultiIterObject` (or something that is a binary equivalent) to be passed in. The :c:type:`PyArrayMultiIterObject` keeps diff --git a/doc/source/reference/routines.polynomials.classes.rst b/doc/source/reference/routines.polynomials.classes.rst index f44ddd46c..da0394305 100644 --- a/doc/source/reference/routines.polynomials.classes.rst +++ b/doc/source/reference/routines.polynomials.classes.rst @@ -35,11 +35,11 @@ degree :math:`n`, but could just as easily be the basis functions of any of the other classes. The convention for all the classes is that the coefficient :math:`c[i]` goes with the basis function of degree i. -All of the classes have the same methods, and especially they implement the -Python numeric operators +, -, \*, //, %, divmod, \*\*, ==, -and !=. The last two can be a bit problematic due to floating point -roundoff errors. We now give a quick demonstration of the various -operations using NumPy version 1.7.0. +All of the classes are immutable and have the same methods, and +especially they implement the Python numeric operators +, -, \*, //, %, +divmod, \*\*, ==, and !=. The last two can be a bit problematic due to +floating point roundoff errors. We now give a quick demonstration of the +various operations using NumPy version 1.7.0. Basics ------ @@ -187,6 +187,11 @@ Which gives the polynomial `p` in Chebyshev form. This works because the original polynomial. However, all the multiplications and divisions will be done using Chebyshev series, hence the type of the result. +It is intended that all polynomial instances are immutable, therefore +augmented operations (``+=``, ``-=``, etc.) and any other functionality that +would violate the immutablity of a polynomial instance are intentionally +unimplemented. + Calculus -------- diff --git a/doc/source/release.rst b/doc/source/release.rst index e7166a454..935d397e3 100644 --- a/doc/source/release.rst +++ b/doc/source/release.rst @@ -3,6 +3,7 @@ Release Notes ************* .. include:: ../release/1.16.0-notes.rst +.. include:: ../release/1.15.1-notes.rst .. include:: ../release/1.15.0-notes.rst .. include:: ../release/1.14.5-notes.rst .. include:: ../release/1.14.4-notes.rst diff --git a/doc/source/user/c-info.beyond-basics.rst b/doc/source/user/c-info.beyond-basics.rst index aee68f6e7..d4d941a5e 100644 --- a/doc/source/user/c-info.beyond-basics.rst +++ b/doc/source/user/c-info.beyond-basics.rst @@ -358,38 +358,6 @@ previously created. Then you call :c:func:`PyUFunc_RegisterLoopForType` this function is ``0`` if the process was successful and ``-1`` with an error condition set if it was not successful. -.. c:function:: int PyUFunc_RegisterLoopForType( \ - PyUFuncObject* ufunc, int usertype, PyUFuncGenericFunction function, \ - int* arg_types, void* data) - - *ufunc* - - The ufunc to attach this loop to. - - *usertype* - - The user-defined type this loop should be indexed under. This number - must be a user-defined type or an error occurs. - - *function* - - The ufunc inner 1-d loop. This function must have the signature as - explained in Section `3 <#sec-creating-a-new>`__ . - - *arg_types* - - (optional) If given, this should contain an array of integers of at - least size ufunc.nargs containing the data-types expected by the loop - function. The data will be copied into a NumPy-managed structure so - the memory for this argument should be deleted after calling this - function. If this is NULL, then it will be assumed that all data-types - are of type usertype. - - *data* - - (optional) Specify any optional data needed by the function which will - be passed when the function is called. - .. index:: pair: dtype; adding new diff --git a/doc/source/user/c-info.ufunc-tutorial.rst b/doc/source/user/c-info.ufunc-tutorial.rst index 788a3429f..96a73f9a6 100644 --- a/doc/source/user/c-info.ufunc-tutorial.rst +++ b/doc/source/user/c-info.ufunc-tutorial.rst @@ -893,9 +893,9 @@ Example NumPy ufunc with structured array dtype arguments This example shows how to create a ufunc for a structured array dtype. For the example we show a trivial ufunc for adding two arrays with dtype 'u8,u8,u8'. The process is a bit different from the other examples since -a call to PyUFunc_FromFuncAndData doesn't fully register ufuncs for +a call to :c:func:`PyUFunc_FromFuncAndData` doesn't fully register ufuncs for custom dtypes and structured array dtypes. We need to also call -PyUFunc_RegisterLoopForDescr to finish setting up the ufunc. +:c:func:`PyUFunc_RegisterLoopForDescr` to finish setting up the ufunc. We only give the C code as the setup.py file is exactly the same as the setup.py file in `Example NumPy ufunc for one dtype`_, except that @@ -1048,133 +1048,6 @@ The C file is given below. #endif } - -.. _`sec:PyUFunc-spec`: - -PyUFunc_FromFuncAndData Specification -===================================== - -What follows is the full specification of PyUFunc_FromFuncAndData, which -automatically generates a ufunc from a C function with the correct signature. - -.. seealso:: :c:func:`PyUFunc_FromFuncAndDataAndSignature` - -.. c:function:: PyObject *PyUFunc_FromFuncAndData( \ - PyUFuncGenericFunction* func, void** data, char* types, int ntypes, \ - int nin, int nout, int identity, char* name, char* doc, int unused) - - *func* - - A pointer to an array of 1-d functions to use. This array must be at - least ntypes long. Each entry in the array must be a - ``PyUFuncGenericFunction`` function. This function has the following - signature. An example of a valid 1d loop function is also given. - - .. c:function:: void loop1d( \ - char** args, npy_intp* dimensions, npy_intp* steps, void* data) - - *args* - - An array of pointers to the actual data for the input and output - arrays. The input arguments are given first followed by the output - arguments. - - *dimensions* - - A pointer to the size of the dimension over which this function is - looping. - - *steps* - - A pointer to the number of bytes to jump to get to the - next element in this dimension for each of the input and - output arguments. - - *data* - - Arbitrary data (extra arguments, function names, *etc.* ) - that can be stored with the ufunc and will be passed in - when it is called. - - .. code-block:: c - - static void - double_add(char **args, npy_intp *dimensions, npy_intp *steps, - void *extra) - { - npy_intp i; - npy_intp is1 = steps[0], is2 = steps[1]; - npy_intp os = steps[2], n = dimensions[0]; - char *i1 = args[0], *i2 = args[1], *op = args[2]; - for (i = 0; i < n; i++) { - *((double *)op) = *((double *)i1) + - *((double *)i2); - i1 += is1; - i2 += is2; - op += os; - } - } - - *data* - - An array of data. There should be ntypes entries (or NULL) --- one for - every loop function defined for this ufunc. This data will be passed - in to the 1-d loop. One common use of this data variable is to pass in - an actual function to call to compute the result when a generic 1-d - loop (e.g. :c:func:`PyUFunc_d_d`) is being used. - - *types* - - An array of type-number signatures (type ``char`` ). This - array should be of size (nin+nout)*ntypes and contain the - data-types for the corresponding 1-d loop. The inputs should - be first followed by the outputs. For example, suppose I have - a ufunc that supports 1 integer and 1 double 1-d loop - (length-2 func and data arrays) that takes 2 inputs and - returns 1 output that is always a complex double, then the - types array would be - - .. code-block:: c - - static char types[3] = {NPY_INT, NPY_DOUBLE, NPY_CDOUBLE} - - The bit-width names can also be used (e.g. :c:data:`NPY_INT32`, - :c:data:`NPY_COMPLEX128` ) if desired. - - *ntypes* - - The number of data-types supported. This is equal to the number of 1-d - loops provided. - - *nin* - - The number of input arguments. - - *nout* - - The number of output arguments. - - *identity* - - Either :c:data:`PyUFunc_One`, :c:data:`PyUFunc_Zero`, - :c:data:`PyUFunc_None`. This specifies what should be returned when - an empty array is passed to the reduce method of the ufunc. - - *name* - - A ``NULL`` -terminated string providing the name of this ufunc - (should be the Python name it will be called). - - *doc* - - A documentation string for this ufunc (will be used in generating the - response to ``{ufunc_name}.__doc__``). Do not include the function - signature or the name as this is generated automatically. - - *unused* - - Unused; kept for compatibility. Just set it to zero. - .. index:: pair: ufunc; adding new |