summaryrefslogtreecommitdiff
path: root/numpy/core
Commit message (Collapse)AuthorAgeFilesLines
* [DOC]: Include the versionadded to the isnat documentation [skip ci]MSeifert042018-07-271-0/+2
|
* Merge pull request #9022 from eric-wieser/reduce-hides-errorMarten van Kerkwijk2018-07-272-122/+177
|\ | | | | BUG: don't silence __array_wrap__ errors in ufunc.reduce
| * MAINT: Hoist helper functions to the top of the file so that prototypes are ↵Eric Wieser2018-06-121-137/+135
| | | | | | | | | | | | not needed The functions themselves have not changed, only moved
| * BUG/MAINT: Handle errors in __array_wrap__ the same way in ufunc.reduce as ↵Eric Wieser2018-06-122-17/+28
| | | | | | | | | | | | in ufunc.__call__ Previously they were silenced
| * MAINT: Extract a helper function to apply __array_wrap__Eric Wieser2018-06-101-33/+79
| |
* | MAINT,DEP: Properly implement ndarray.__pos__Marten van Kerkwijk2018-07-265-9/+93
| | | | | | | | | | | | For regular arrays, we now give a deprecation warning if np.positive cannot handle it; for ndarray subclasses that override __array_ufunc__, we pass on the type error.
* | Merge pull request #11601 from eric-wieser/list-ctorCharles Harris2018-07-222-32/+64
|\ \ | | | | | | BUG: Make np.array([[1], 2]) and np.array([1, [2]]) behave in the same way
| * | TST: Add a test of jagged array constructionEric Wieser2018-07-221-0/+18
| | |
| * | BUG: Make np.array([[1], 2]) and np.array([1, [2]]) behave in the same wayEric Wieser2018-07-222-19/+34
| | |
| * | MAINT: Eliminate intermediate variable for consistencyEric Wieser2018-07-221-15/+12
| | | | | | | | | | | | Also tidy line-wrapping
| * | MAINT: Improve variable names and scope in discover_dimensionsEric Wieser2018-07-221-6/+8
| | |
* | | BLD: Modify cpu detection and function to get build working on aarch64 (#11568)Kyle Sunden2018-07-152-19/+49
| | | | | | | | | BLD: Modify cpu detection and printing to get working aarch64 build
* | | DOC: Updated array2string description (#11571)logeaux2018-07-141-0/+2
| | | | | | | | | | | | | | | | | | * DOC: Updated array2string description * DOC: Updated array2string description
* | | Merge pull request #11382 from mattip/remove-typeNARalf Gommers2018-07-133-6/+27
|\ \ \ | | | | | | | | DEP: deprecate undocumented, unused dtype type dicts
| * | | DEP: deprecate undocumented, unused dtype type dictsmattip2018-07-133-6/+27
| | | |
* | | | DOC: Update examples with new MaskedArray.__repr__Eric Wieser2018-07-091-9/+9
| | | |
* | | | DOC: Add missing reference to blockEric Wieser2018-07-091-0/+1
| |/ / |/| |
* | | Merge pull request #11518 from mhvk/normalize-axis-tuple-speedupMarten van Kerkwijk2018-07-091-5/+8
|\ \ \ | | | | | | | | MAINT: Speed up normalize_axis_tuple by about 30%
| * | | MAINT: Restore previous behavior on subclassesEric Wieser2018-07-081-2/+2
| | | |
| * | | MAINT: Speed up normalize_axis_tuple by about 30%Marten van Kerkwijk2018-07-061-5/+8
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is used in `np.moveaxis`, which is relatively slow. Timings change as follows: ``` import numpy as np from numpy.core.numeric import normalize_axis_tuple %timeit normalize_axis_tuple([0, 1, 2], 4, 'parrot') a = np.zeros((10,20,30)) %timeit np.moveaxis(a, [0,1,2], [2,1,0]) 100000 loops, best of 3: 5.56 µs per loop -> 4.17 µs ```
* | | Merge pull request #11482 from Anner-deJong/patch-1Charles Harris2018-07-081-0/+10
|\ \ \ | | | | | | | | DOC: Include warning in np.resize() docs
| * | | removed spaces. improved right side outliningAnner2018-07-061-4/+4
| | | |
| * | | Update resize notes according to mattip's commentsAnner2018-07-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | removed 'simple' altered sentence describing which items are taken from `old` into `new` therefor -> therefore
| * | | include warning in np.resize() docsAnner2018-07-031-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I find it counterintuitive that resizing a numpy array does NOT consider dimensions independent, but simply takes the first N elements of the input array that fit into the output array. I was expecting something more like `cv2.resize()` where axes are treated separately, and some form of interpolation is applied to each dimension. numpy resizes an old 5x5x2 array into a new array with new = np.resize(old, (4, 4, 2)) by simply copying the first 4 * 4 * 2 entries from old into new. (e.g. old[0, 4, :] becomes new[1, 0, :]) This is a problem if we would like simple interpolation, or if different axes represent different entities. (If the above example is an image, the top right most pixel would get warped all the way to the left, which is most likely not the intention) In response to my issue #11478: 'resize() is unintuitive by not treating axes separately?' A warning in the docs might prevent some confusion. For a discussion on the issue and a possible solution, see <https://github.com/numpy/numpy/issues/11478>
* | | | Merge pull request #11464 from eric-wieser/monotonicityCharles Harris2018-07-084-185/+33
|\ \ \ \ | | | | | | | | | | BUG: Don't convert inputs to `np.float64` in digitize
| * | | | BUG: Don't convert inputs to `np.float64` in digitizeEric Wieser2018-07-064-185/+33
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | This converts digitize to a pure-python function that falls back on searchsorted. Performance doesn't really matter here anyway - if you care about performance, then you should just call searchsorted directly, rather than checking the order of the bins. Partially fixes gh-11022
* | | | fix from reviewmattip2018-07-061-1/+0
| | | |
* | | | BUG: decref of field title caused segfaultmattip2018-07-052-1/+12
|/ / /
* | | Merge pull request #11479 from wdirons/fix_define_for_ppc64_and_ppc64leCharles Harris2018-07-051-4/+6
|\ \ \ | | | | | | | | BUG: Fix #define for ppc64 and ppc64le
| * | | BUG: Fix #define for ppc64 and ppc64leWilliam D. Irons2018-07-021-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current logic for defining NPY_CPU_PPC64LE and NPY_CPU_PPC64 is incorrect for two reasons: 1) The elif defined for __powerpc__ is proceesed first so any ppc64le or ppc64 system is defined as NPY_CPU_PPC. 2) __ppc64le__ is not defined on a ppc64le system. __PPC64__ is defined and so is __powerpc64__ but the check for little or big endian needs to be done seperately. This pull request fixes the defines for ppc64le and ppc64. Note: This really isn't a issue in the numpy code base at this time because the only place this variable is referenced is in npy_endian.h as a fallback in case endian.h is not on the system. It would be good to fix in case future code does reference these defines.
* | | | Merge pull request #11016 from stuartarchibald/wip/armv7_aarch32Matti Picus2018-07-043-27/+46
|\ \ \ \ | | | | | | | | | | ENH: Add AARCH32 support.
| * | | | Adjust endianness header file to accommodate AARCHXX changes.Stuart Archibald2018-06-261-20/+23
| | | | | | | | | | | | | | | | | | | | As title.
| * | | | ENH: Add AARCH32 support.Stuart Archibald2018-06-262-7/+23
| | | | | | | | | | | | | | | | | | | | | | | | | This adds support for identifying AARCH32 and AARCH64 at compile time such that alignment etc is correctly determined.
* | | | | BUG/ENH: Einsum optimization path updates and bug fixes. (#11345)Daniel Smith2018-07-032-92/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Minor tweaks to the optimal path based on opt_einsum * Updates greedy path to current opt_einsum tech * Reworks einsum broadcasting vs dot tech and can_dot logic * MAINT: Fix typo in comment. * BUG: Fix bad merge fixup.
* | | | | Merge pull request #11468 from seberg/fancy-assignment-no-fastpathCharles Harris2018-07-033-20/+36
|\ \ \ \ \ | |_|_|/ / |/| | | | BUG: Advanced indexing assignment incorrectly took 1-D fastpath
| * | | | BUG: Advanced indexing assignment incorrectly took 1-D fastpathSebastian Berg2018-07-023-20/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the index array was non contiguous and not 1D the assignment 1D fastpath (indexed array being 1D) was incorrectly taken (also the assignment value had to be 0D for this to happen). This caused the iteration to use the itemsize as a stride, since it incorrectly assumed the array must be contiguous. The commit additionally adds an assert to the STRIDE fetching macro. Closes gh-11467.
* | | | | Merge pull request #11474 from eric-wieser/move-add-new-docsCharles Harris2018-07-023-0/+8184
|\ \ \ \ \ | | | | | | | | | | | | MAINT: Move add_newdocs into core, since it only adds docs to those pieces
| * | | | | MAINT: Move add_newdocs into core, since it only adds docs to those piecesEric Wieser2018-07-023-0/+8184
| | | | | |
* | | | | | Merge pull request #11473 from eric-wieser/move-pytesttesterMarten van Kerkwijk2018-07-021-1/+1
|\ \ \ \ \ \ | |/ / / / / | | | | | | MAINT: Move pytesttester outside of np.testing, to avoid creating unnecessary import dependencies
| * | | | | MAINT: Move pytesttester outside of np.testing, to avoid creating ↵Eric Wieser2018-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unnecessary import dependencies pytesttester is used by every single subpackage, so making it depend on np.testing just creates cyclic dependencies that can lead to circular imports Relates to #11457
* | | | | | Merge pull request #11351 from mhvk/ufunc-parsing-speedup-alternativeEric Wieser2018-07-023-251/+349
|\ \ \ \ \ \ | |_|_|_|/ / |/| | | | | MAINT: Improve speed of ufunc kwargs parsing
| * | | | | MAINT: Improve speed of ufunc kwargs parsing.Marten van Kerkwijk2018-06-293-251/+349
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the realization from inspecting similar CPython code that as we intern string names anyway, comparing keys with possible names by pointer will generally just work. Also rather drastically rewrote, to use a new parser with simple conversion functions to replace part of the enormous switch/case structure, process out separately, and check for duplication after the parsing. Reduces the overhead as follows: ``` import numpy as np a = np.array(1) b = np.empty_like(a) %timeit np.positive(a) # 352->348 ns %timeit np.positive(a, subok=True) # 606->501 ns %timeit np.positive(a, where=True) # 586->503 ns %timeit np.positive(a, where=True, subok=True) # 695->531 ns %timeit np.positive(a, b) # 354->352 ns %timeit np.positive(a, out=b) # 557->480 ns %timeit np.positive(a, out=b, subok=True) # 668->506 ns %timeit np.positive(a, out=b, where=True, subok=True) # 752->536 ns ```
* | | | | | Merge pull request #11444 from silenc3r/patch-1Matti Picus2018-07-011-1/+1
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | DOC: Fix documentation for fromfunction
| * | | | | Fix documentation for fromfunctionsilenc3r2018-06-281-1/+1
| | | | | | | | | | | | | | | | | | ```np.fromfunction(lambda i, j: 1, (3, 3), dtype=int)``` returns ```1```.
* | | | | | Merge pull request #11432 from mattip/refactor-new_array_for_sumMarten van Kerkwijk2018-06-304-196/+120
|\ \ \ \ \ \ | | | | | | | | | | | | | | MAINT: Refactor differences between cblas_matrixproduct and PyArray_MatrixProduct2
| * | | | | | MAINT: refactor duplicate code into 'common.c'mattip2018-06-294-196/+120
| | |_|/ / / | |/| | | |
* | | | | | Merge pull request #11440 from jackvreeken/fix-interp-for-nan-infEric Wieser2018-06-291-0/+8
|\ \ \ \ \ \ | |/ / / / / |/| | | | | BUG: fix interpolation with inf and NaN present
| * | | | | BUG: fix interpolation with inf and NaN presentJack Vreeken2018-06-291-0/+8
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Values like NaN and inf would result in wrong interpolated values on exactly matching sampling points. To produce the correct behavior, we add an additional check to avoid interpolation when handling such a point. Closes #11439
* | | | | Merge pull request #11406 from mattip/einsum-out-is-resCharles Harris2018-06-292-18/+15
|\ \ \ \ \ | | | | | | | | | | | | BUG: ensure ret is out in einsum
| * | | | | MAINT: cleanup ret assignmentmattip2018-06-271-20/+7
| | | | | |