summaryrefslogtreecommitdiff
path: root/numpy/core/src/private
Commit message (Collapse)AuthorAgeFilesLines
* MAINT: move private -> commonmattip2018-08-2119-4178/+0
|
* MAINT,DEP: Properly implement ndarray.__pos__Marten van Kerkwijk2018-07-262-2/+30
| | | | | | 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 #11016 from stuartarchibald/wip/armv7_aarch32Matti Picus2018-07-041-1/+2
|\ | | | | ENH: Add AARCH32 support.
| * ENH: Add AARCH32 support.Stuart Archibald2018-06-261-1/+2
| | | | | | | | | | This adds support for identifying AARCH32 and AARCH64 at compile time such that alignment etc is correctly determined.
* | BUG: Advanced indexing assignment incorrectly took 1-D fastpathSebastian Berg2018-07-021-19/+20
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | MAINT: Split off getting overrides and checking for them.Marten van Kerkwijk2018-06-282-70/+135
| | | | | | | | | | Code was getting too convoluted and both can be optimized in different ways.
* | MAINT: Ensure __array_ufunc__ on given class is only called once.Marten van Kerkwijk2018-06-281-7/+23
|/ | | | | | | Overall, it likely doesn't matter much for performance, but it is more logical and more consistent with what python does: reverse operators are not called if the forward one of a given class already returned NotImplemented.
* BUG: decref in failure path; replace PyObject_Type by Py_TYPEMarten van Kerkwijk2018-06-141-1/+9
| | | | | PyObject_Type increases the reference count, which was not taken into account.
* MAINT: remove unused "npy_import"Allan Haldane2018-06-121-14/+0
|
* MAINT: push back multifield copy->view changes to 1.16Allan Haldane2018-06-111-0/+14
|
* BUG: Implement float128 dragon4 for IBM double-double (ppc64)Allan Haldane2018-06-061-2/+10
|
* MAINT: remove darwin hardcoded LDOUBLE detectionAllan Haldane2018-05-301-29/+0
|
* Merge pull request #10650 from eric-wieser/longdouble_intCharles Harris2018-02-242-2/+2
|\ | | | | BUG: Fix missing NPY_VISIBILITY_HIDDEN on npy_longdouble_to_PyLong
| * BUG: Fix missing NPY_VISIBILITY_HIDDEN on npy_longdouble_to_PyLongEric Wieser2018-02-222-2/+2
| | | | | | | | | | | | Fixes #10648 NPY_VISIBILITY_HIDDEN is used by memoverlap.{c,h}, so we should be using the same thing here
* | MAINT: Fix sign-compare warnings in npy_binsearch, npy_partition.Charles Harris2018-01-202-15/+26
| | | | | | | | | | | | | | The gcc compiler treats enums as unsigned unless one of the enumerated values is negative. The values are small, so we can fix that by casting to int. The same can be done with the results of the sizeof function if we know ahead of time that the result is small.
* | MAINT: Fix sign-compare warnings in mem_overlap.c.Charles Harris2017-12-291-10/+12
| |
* | MAINT: Fix loop and simd sign-compare warnings.Charles Harris2017-12-251-13/+22
| | | | | | | | | | The gcc sign-compare warning is enabled in Python 3.5+ and causes errors in the wheel builds.
* | MAINT: Fix test_int_from_huge_longdouble on Darwin.Charles Harris2017-11-101-3/+6
|/ | | | | | | | The test was failing on Darwin due to Apple's defective pow function. The fix here is to generate the huge longdouble that is tested in a way that avoids the problems of the pow function. The C++ comments in npy_longdouble.c are also fixed.
* BUG: Fix casting from longdouble to longEric Wieser2017-11-072-0/+116
| | | | | | Implements a custom PyLong_FromLongDouble (with a different name) derived from PyLong_FromDouble. Fixes gh-9964
* MAINT: fix std header include orderJulian Taylor2017-09-011-3/+4
| | | | | Removes _POSIX_C_SOURCE redefine warnings. Standard library headers should always be included last.
* BUG: core: blacklist MSVC cabs* on win32Pauli Virtanen2017-08-171-0/+4
| | | | | Similarly to hypot() also cabs* on MSVC/win32 mess with floating point mode.
* BUG: blacklist MSVC hypot() on win32Pauli Virtanen2017-08-161-0/+9
|
* BUG remove memory leak in array ufunc override.Marten van Kerkwijk2017-05-101-3/+4
|
* MAINT: Remove avoidable warningsEric Wieser2017-05-102-4/+3
|
* MAINT: use if instead of loopEric Wieser2017-05-101-31/+21
|
* BUG: Fix inconsistent lookup of __array_ufunc__.Eric Wieser2017-05-102-27/+30
| | | | | | Previously, we would check if the attribute existed on the class, yet use it from the instance. This also cuts 3 lookups of `__array_ufunc__` down to one.
* MAINT: Distinguish "correct" special method lookups from incorrect onesEric Wieser2017-05-103-36/+90
| | | | This also corrects a broken short-circuit when looking up __array_ufunc__
* ENH: Spelling fixesVille Skyttä2017-05-091-2/+2
|
* Merge pull request #9014 from shoyer/array_ufunc-NoneCharles Harris2017-04-301-5/+28
|\ | | | | BUG: `__array_ufunc__= None` -> TypeError
| * ENH: disable ufuncs if any operand sets __array_ufunc__=NoneStephan Hoyer2017-04-301-5/+28
| |
* | BUG: Make ndarray inplace operators forward calls when needed.Charles Harris2017-04-291-11/+28
|/ | | | | | | | | | | | | For backward compatibility, we need to let `__array_priority__` determine the override for inplace ops. If `__array_ufunc__ = None` on the right hand side it is still the case that TypeError will be raised. This fixes SciPy test failures of the type ndarray += sparse_array Closes #9019.
* MAINT: split out umath-specific part of ufunc_override.Marten van Kerkwijk2017-04-272-478/+16
| | | | | | | And put it in src/umath instead of src/private. This leaves only the PyUFunc_WithOverride function in ufunc_override.c, which is all that is needed outside of umath (it is called by array_ufunc in multiarray/methods.c).
* MAINT: simplify now that __array_ufunc__ overrides ufuncs only.Marten van Kerkwijk2017-04-272-12/+8
| | | | | In particular, use fact that we're guaranteed to have a PyUFuncObject in PyUFunc_CheckOverride.
* BUG,MAINT: ensure out=None is never passed on to __array_ufunc__.Marten van Kerkwijk2017-04-272-119/+182
| | | | | | | As part of this, it turns out the number of output arguments nout was needed, so that was passed in. Also, testing showed that arguments passed in both as positional and keyword arguments were not caught, so a duplication check was added.
* MAINT: let ndarray.__array_ufunc__ bail if any overrides are in place.Marten van Kerkwijk2017-04-272-32/+59
| | | | | | As part of this, split off the checking for overrides from the actual trying to execute them (in ufunc_override.c), so that just the check can be done in ndarray.__array_ufunc__.
* ENH: implement ndarray.__array_ufunc__Marten van Kerkwijk2017-04-271-9/+55
|
* MAINT: for __array_ufunc__ pass inputs as *args, ensure out is tuple.Marten van Kerkwijk2017-04-271-42/+99
|
* MAINT: Add NPY_NO_EXPORT modifier to PyUFunc_CheckOverride.Charles Harris2017-04-272-2/+2
|
* MAINT: Split out C code in ufunc_override.h to .c file.Marten van Kerkwijk2017-04-272-402/+410
|
* MAINT: allow __array_ufunc__ = None to force binops to defer.Marten van Kerkwijk2017-04-272-132/+42
| | | | | | | | | | | In previous versions, one could force ndarray binops to defer by setting a high __array_priority__. With __array_ufunc__ this gets ignored, and this commit ensures it is still possible to avoid using the standard python language feature that setting something to None means it is not implemented. In consequence, inside a ufunc, if __array_ufunc__ is None, it will be treated as if it had returned NotImplemented (leading to a TypeError if no other object had a functioning __array_ufunc__ override).
* BUG/ENH: Switch to simplified __array_ufunc__/binop interactionNathaniel J. Smith2017-04-271-0/+292
| | | | | | | | | | | | As per the discussion at gh-5844, and in particular https://github.com/numpy/numpy/issues/5844#issuecomment-112014014 this commit switches binop dispatch to mostly defer to ufuncs, except in some specific cases elaborated in a long comment in number.c. The basic strategy is to define a single piece of C code that knows how to handle forward binop overrides, and we put it into private/binop_override.h so that it can be accessed by both the array code in multiarray.so and the scalar code in umath.so.
* MAINT: Put PyArray_GetAttrString_SuppressException in get_attr_string.hNathaniel J. Smith2017-04-272-15/+97
| | | | | This is an ugly kluge, but until we merge multiarray.so and umath.so moving stuff into private/*.h serves as a reasonable workaround.
* ENH: Remove position arg from __array_ufunc__.Charles Harris2017-04-271-8/+1
| | | | | | Previously when __array_ufunc__ for one of the ufunc arguments was called, that arguments position was passed in the call. This PR removes that argument as proposed in gh-5986.
* ENH: Rename __numpy_ufunc__ to __array_ufunc__.Charles Harris2017-04-271-7/+7
| | | | | | | | The first commit in changing __numpy_ufunc__ by removing the index argument and making the out argument value always a tuple. These changes were proposed in gh-5986 and have been accepted. Renaming before further changes avoids triggering tests in scipy and astropy while keeping the numpy tests working.
* ENH: Revert "Temporarily disable __numpy_ufunc__"Charles Harris2017-04-271-6/+0
| | | | | This reverts commit bac094caf14e420a801cf952080aa443a3865d97 and enables __numpy_ufunc__ for development in the NumPy 1.13.0 development cycle.
* STY: core: fix up code style and add clearer commentsPauli Virtanen2017-02-101-8/+12
|
* BUG: core: fix bug with zero strides in PyArray_EQUIVALENTLY_ITERABLE_OVERLAP_OKPauli Virtanen2017-01-201-4/+7
| | | | | | | | Arrays with zero strides are never "ahead", as the same element is reused multiple times. The previous logic was incorrect eg. for stride1==0, stride2<0 and arr1->data==arr2->data.
* MAINT: core: fix compiler warningsPauli Virtanen2017-01-201-1/+1
|
* MAINT: drop NPY_INLINEPauli Virtanen2017-01-191-1/+1
|
* ENH: core: add overlap detection logic to EQUIVALENTLY/TRIVIALLY_ITERABLE loopsPauli Virtanen2017-01-191-26/+92
| | | | | These loops iterate over whole arrays in "trivial" order, so that it is possible to reason about the data dependency.