summaryrefslogtreecommitdiff
path: root/numpy
Commit message (Collapse)AuthorAgeFilesLines
* move below int64_t declarationjbrockmendel2020-05-211-39/+39
|
* Missing declarationsjbrockmendel2020-05-211-0/+23
|
* Re-order declarationsjbrockmendel2020-05-211-5/+5
|
* ENH: include dt64/td64 isinstance checks in __init__.pxdjbrockmendel2020-05-211-0/+71
|
* BUG: Don't segfault on bad __len__ when assigning. (gh-16327)Brandt Bucher2020-05-212-20/+25
| | | | | | | | | | | | | | | | | | | When __getitem__ fails, assignment falls back on __iter__, which may not have the same length as __len__, resulting in a segfault. See gh-7264. * BUG: Don't rely on __len__ for safe iteration. Skip __len__ checking entirely, since this has no guarantees of being correct. Instead, first convert to PySequence_Fast and use that length. Also fixes a refleak when creating a tmp array fails. See gh-7264. * TST: Update test for related edge-case. The previous fix more gracefully handles this edge case by skipping the __len__ check. Rather than raising with an unhelpful error message, just create the array with whatever elements C() actually yields. See gh-7264.
* MAINT: Stop Using PyEval_Call* and simplify some usesSebastian Berg2020-05-202-17/+6
| | | | | Python 3.9 started to deprecate these calls and the PyObject_Call* variants are equivalent or nicer in any case.
* Merge pull request #15997 from panpiort8/array_pretty_printMatti Picus2020-05-202-4/+106
|\ | | | | ENH: improve printing of arrays with multi-line reprs
| * Make requested changesPan Jan2020-04-271-5/+4
| |
| * Improve way of breaking linesPan Jan2020-04-172-9/+43
| |
| * Improve testingPan Jan2020-04-162-3/+18
| |
| * ENH: improve printing of arrays with multi-line reprsPan Jan2020-04-162-4/+58
| |
* | Merge pull request #16239 from seberg/reimport-do-not-set-docsMatti Picus2020-05-205-666/+214
|\ \ | | | | | | BUG,DOC: Allow attach docs twice but error if wrong
| * | MAINT: Simplify logic in add_docstringSebastian Berg2020-05-201-52/+17
| | | | | | | | | | | | | | | | | | The old pointers are now provided by the C-API and the macros seemed a bit confusing since ``new`` appears from nowhere being defined in the macro.
| * | TST: Add a test for np.add_docstringSebastian Berg2020-05-201-1/+39
| | | | | | | | | | | | | | | Its not quite the right file, but close to newdoc seemed sensible and we do not have a "right" file right now...
| * | DOC: Fix generic scalar docstrings to point to ndarraySebastian Berg2020-05-192-610/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously some of these were not set, because they were already set on the C-level. Remove the duplicate message and replace it instead with a forward to the ``ndarray`` attribute/method. These docstrings are inherited by the actual scalars and thus the "virtual class" note was misleading.
| * | BUG: Allow attaching documentation twice in add_docstringSebastian Berg2020-05-192-3/+34
| | | | | | | | | | | | | | | | | | | | | This is technically not a bug, but some IDEs and IPython have autoreload magic which can mean that NumPy gets reloaded a second time. This is not safe, but when it happens ignoring that an identical docstring is already attached fixes the issue.
* | | BLD: Avoid "visibility attribute not supported" warning (gh-16288)E. M. Bray2020-05-201-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I found that when building the latest master branch on Cygwin, while testing #16246, that thousands of warnings were generated at build time like: numpy/core/src/npysort/binsearch.c.src: In function ‘binsearch_left_bool’: numpy/core/src/npysort/binsearch.c.src:82:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes] Granted this is just a warning, so I don't think it's a serious issue. It seems the test that was supposed to check for __attribute__ support was not working as expected. The #pragmas only take effect if I provide a function body--they are ignored for bare declarations. I don't know if that's by intent, or if it's a GCC issue. For reference: $ gcc --version gcc (GCC) 7.4.0
* | | BUG: relpath fails for different drives on windows (#16308)Matti Picus2020-05-201-1/+1
| | | | | | | | | | | | | | | * BUG: relpath fails for different drives on windows * ENH: always use abspath
* | | Merge pull request #16284 from eric-wieser/extract-lerpSebastian Berg2020-05-191-62/+58
|\ \ \ | | | | | | | | MAINT: Clean up the implementation of quantile
| * | | MAINT: remove workaround for fixed issue Eric Wieser2020-05-191-2/+0
| | | | | | | | | | | | take now correctly returns `out`, even on 0d arrays
| * | | MAINT: Remove special cases for 0d arrays in quantileEric Wieser2020-05-181-62/+55
| | | | | | | | | | | | | | | | This also simplifies the axis handling logic, taking advantage of the fact we know `axis` is 0 for the rest of the function body
| * | | MAINT: Extract a lerp helper function to make the algorithm of quantile clearerEric Wieser2020-05-181-4/+9
| | | | | | | | | | | | | | | | This does not affect the behavior in any way
* | | | DOC: Fix documentation rendering,Matthias Bussonnier2020-05-191-1/+1
| |/ / |/| | | | | | | | | | | | | | | | | | | | the => seem to be extra and rst seem to not interprete backtick with leading space as closing a directive, the the full line on text was put in a html pre-tag when building the docs. see current https://numpy.org/doc/stable/reference/generated/numpy.packbits.html
* | | MAINT: precompute log(2.0 * M_PI) in `random_loggam' (gh-16237)Elia Franzella2020-05-191-10/+12
| | | | | | | | | | | | Most compilers should optimize it, but it doesn't hurt to inline and has a better name now.
* | | Merge pull request #16156 from WarrenWeckesser/deprecate-dualSebastian Berg2020-05-197-13/+28
|\ \ \ | | | | | | | | DEP: Deprecate `numpy.dual`.
| * | | DOC: dual: Note the deprecation of numpy.dual in the dual module docstring.Warren Weckesser2020-05-051-4/+10
| | | | | | | | | | | | | | | | Also make the correction "Scipy" -> "SciPy" in a few places.
| * | | DEP: Deprecate `numpy.dual`.Warren Weckesser2020-05-047-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | Add a deprecation warning in the `numpy.dual` module, and remove the use of `numpy.dual` from the few places where it is used in the numpy code.
* | | | Merge pull request #16242 from seberg/genfromtxt-default-regressionMatti Picus2020-05-193-5/+15
|\ \ \ \ | | | | | | | | | | BUG: Fix default fallback in genfromtxt
| * | | | Update numpy/lib/_iotools.pySebastian Berg2020-05-181-1/+2
| | | | | | | | | | | | | | | Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
| * | | | BUG: Fix default fallback in genfromtxtSebastian Berg2020-05-183-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This affected (for example?) if the `dtype=object` was used without a converter, meaning that the default one is used. And this is currently the last one, which is `string_` (and thus bytes). Closes gh-16189
* | | | | DOC: Add math.isclose to See Also (#16283)Ben Elliston2020-05-191-0/+1
| | | | | | | | | | | | | | | * DOC: Move math.isclose note to See Also.
* | | | | Merge pull request #16276 from eric-wieser/take-outSebastian Berg2020-05-182-10/+99
|\ \ \ \ \ | | | | | | | | | | | | BUG: Ensure out argument is returned by identity for 0d arrays
| * | | | | BUG: Ensure out argument is returned by identity for 0d arraysEric Wieser2020-05-182-10/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the following functions consistent with the behavior of ufuncs: * `np.argmax` * `np.argmin` * `np.choose` * `np.trace` * `np.round` * `np.take` Previously they would unpack these into scalars.
* | | | | | MAINT: Chain exceptions in generate_umath.py (gh-16254)lkdmttg72020-05-181-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* | | | | | DOC: Calrify tiny/xmin in finfo and machar (gh-16253)Raphael Kruse2020-05-182-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a note to the documentation of finfo clarifying that the attribute `tiny` does not represent the smallest positive usable number. Instead it refers to the smallest positive number with there being no leading 0's in the mantisse (normalized floating point number). Alternatively, `tiny` represents the smallest positive floating point number with full precision. The smallest positive subnormal floating point number is typically orders of magnitudes smaller, but has reduced precision since leading 0's in the mantisse are used to allow smaller exponents than indicated by `minexp`. The commit also adds a brief clarification to the docstring of machar. Closes #16252 Co-authored-by: Anirudh Subramanian <anirudh2290@apache.org> Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* | | | | | Merge pull request #16278 from SacredArrow/var-doc-editSebastian Berg2020-05-181-2/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | DOC: Clarifications for ``np.var``.
| * | | | | | DOC: Clarifications for np.varDmitry Kutlenkov2020-05-171-2/+2
| | | | | | |
* | | | | | | Merge pull request #16238 from seberg/maint-cached-importsMatti Picus2020-05-185-50/+13
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | MAINT: Unify cached (C-level static) imports
| * | | | | | | MAINT: Unify cached (C-level static) importsSebastian Berg2020-05-145-50/+13
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main idea is that once we unify them, we can think about actually being able to also clean them up. This is far away from having no global state, but at this time I do not see that as a seriousl goal personally. But it could be possible to reload the module safely in a single interpreter maybe. The commit adds the cache import for the complex casts, since it doubles performance for small casts when the warning is not suppressed and it unifies the handling.
* | | | | | | Merge pull request #16274 from eric-wieser/extract-lerpEric Wieser2020-05-171-19/+6
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | / / | | |_|_|/ / | |/| | | | MAINT: cleanups to quantile
| * | | | | MAINT: Avoid moving axes around multiple timesEric Wieser2020-05-171-15/+5
| | | | | | | | | | | | | | | | | | | | | | | | It's easier to move the relevant axis to position 0 in `ap` first than it is to move it for every relevant object simultaneously.
| * | | | | MAINT: Remove a pointless ifEric Wieser2020-05-171-4/+1
| | |/ / / | |/| | | | | | | | | | | | | The `add` ufunc is happy to handle `out=None` by itself
* | | | | DOC: Clarifications for np.std (#16267)Dmitry Kutlenkov2020-05-171-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * DOC: Clarifications for np.std * Line lengths fixes in np.std * Swapped variable names in np.std
* | | | | REL: Update master after 1.19.x branch.Charles Harris2020-05-172-0/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Delete release note fragments from 1.19.0 (towncrier) - Update 1.19.x release note (towncrier) - Create 1.20.0-notes.rst for master development - Update C-API versions for 1.20.x - Update setup.py for 1.20.0
* | | | Merge pull request #16269 from tbm/typoMatti Picus2020-05-177-7/+7
|\ \ \ \ | | | | | | | | | | DOC: Fix typos and cosmetic issues
| * | | | DOC: Fix typos and cosmetic issuesMartin Michlmayr2020-05-177-7/+7
| | | | |
* | | | | Merge pull request #16263 from seberg/decref-fromarray-error-path-fixupCharles Harris2020-05-161-0/+1
|\ \ \ \ \ | | | | | | | | | | | | BUG: Add missing decref in fromarray error path
| * | | | | BUG: Add missing decref in fromarray error pathSebastian Berg2020-05-161-0/+1
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | This function steals the dtype, so it must decref it also on error. This is fixup of ffe76ac8df65c8e7831df9924a782276e060f3e6 which accidentally deleted the decref.
* | | | | BUG: numpy.einsum indexing arrays now accept numpy int type (gh-16080)Ryan2020-05-163-21/+33
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Using PyArray_PyIntAsIntp helper function instead * TST: add tests for einsum numpy int and bool list subscripts Added tests to check that einsum accepts numpy int64 types and rejects bool. Rejecting bools is new behaviour in subscript lists. I changed ValueError to TypeError on line 2496 in multiarraymodule.c as it is more appropriate. I also modified einsumfunc.py to have the same behaviour as in the C file when checking subscript list. (Reject bools but accept anything else from operator.index()) Closes gh-15961
* | | | Merge pull request #16197 from timhoffm/doc-stackSebastian Berg2020-05-153-21/+27
|\ \ \ \ | | | | | | | | | | DOC: Unify cross-references between array joining methods