summaryrefslogtreecommitdiff
path: root/numpy/lib/src
Commit message (Collapse)AuthorAgeFilesLines
* MAINT: merge _compiled_base module into multiarrayJulian Taylor2015-01-221-1711/+0
| | | | Allows access to internal functions for the file.
* BUG: digitize segfaults on TypeErrorjaimefrio2014-12-071-2/+2
| | | | | The new searchsorted-based digitize introduced in #5101 segfaults when it should raise a TypeError.
* ENH ensure np.packbits works on np.bool dtypeLars Buitinck2014-11-301-2/+2
|
* MAINT/TST: refactor and test packbits/unpackbitsLars Buitinck2014-11-301-136/+169
| | | | | | Pushes the GIL release one loop outward. First test for these functions (!). Incorporates suggestions by @jaimefrio and @charris.
* ENH: Release GIL in `digitize`jaimefrio2014-09-251-0/+6
|
* ENH: implement `digitize` with `PyArray_SearchSorted`jaimefrio2014-09-251-160/+71
|
* BUG: fix incorrect minlength handling in np.bincountimmerrr2014-03-261-15/+14
|
* ENH: release gil for np.packbits and np.unpackbitsJulian Taylor2014-03-111-0/+10
|
* BUG: Make interp return NaN at NaN interpolation points.Charles Harris2014-02-161-5/+19
| | | | | | | | | | | | | A NaN interpolation point was interpreted as out of bounds on the left side, hence the value of the left parameter in the function call was returned. >>> np.interp(np.nan, [-10, 10], [-2, 2]) -2.0 NaN is a better choice. Closes #605.
* MANT: separated initial assignment for `min` and `max`jaimefrio2014-02-111-2/+2
|
* ENH: single pass over array in `bincount` to determine output sizejaimefrio2014-02-111-30/+18
| | | | | | | | | | | | `bincount` checks its input array to make sure there are no negative entries, and to determine the size of the output array. This is done by calling two different functions, each having to loop over the whole array. This PR adds a new function, `minmax`, that computes the minimum and maximum of the array in a single pass over it. This leads to speed-ups peaking at 1.5x, with typical values for large arrays around 1.15x - 1.25x. A full benchmark summary of the new implementation, including a supposedly more efficient algorithm that turned out to run slower, can be found [here](https://gist.github.com/jaimefrio/8743836).
* MAINT: rewrote `check_array_monotonic` following @charris suggestion tojaimefrio2014-02-111-20/+23
| | | | minimize indexing.
* STY: adapted code to `C_STYLE_GUIDE.rst.txt`.jaimefrio2014-02-091-17/+25
| | | | | | MAINT: rewrote `check_array_monotonic` to use array indices, not pointers. TST: tests for proper handling of bins with all items almost equal now check the return value for correctness, not just that an error is not raised.
* BUG: check for monotonic bin arrays in digitizejaimefrio2014-01-301-14/+16
| | | | | | | | | | | | | | | | | | | | The check for monotonic bin arrays of digitize doesn't properly handle inputs with repeated entries at the beginning of the array: ``` >>> np.__version__ '1.8.0' >>> np.digitize([1], [0, 0 , 2]) array([2], dtype=int64) >>> np.digitize([1], [2, 2, 0]) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: The bins must be monotonically increasing or decreasing ``` Modified `check_array_monotonic` in `_compiled_base.c` to skip over repeating entries before deciding to check for increasing or decreasing monotonicity and added relevant tests to `test_function_base.py`.
* MAINT: accept NULL in NpyIter_Deallocate and remove redundant NULL checksJulian Taylor2013-10-031-12/+4
| | | | | | | | Deallocation should just do nothing if provided a NULL pointer nditer deletion broke this convention. Removed many redundant NULL checks for various deallocation functions used in numpy, they all end up in standard C free or PyMem_Free which are both NULL safe.
* MAINT: Remove outdated version checks.Charles Harris2013-07-111-3/+0
| | | | | | | | | | Because Numpy 1.8.0 will no longer supports Python versions < 2.6 we no longer need to check for that and can also remove the code that is specific to those earlier versions. To make this a bit safer, the toplevel setup.py file now contains a check of the Python version number and raises an error when run by an unsupported version.
* Use PyMODINIT_FUNC and update docs accordingly.cgohlke2012-09-021-1/+1
| | | | See https://github.com/scipy/scipy/pull/279
* STY: core: move non-Py3 specific stuff out from npy_3kcompat.h to private ↵Pauli Virtanen2012-07-131-0/+4
| | | | | | npy_pycompat.h npy_3kcompat.h is semi-private, so this can be done.
* ENH: expose PyDataMem_NEW/FREE/RENEW as numpy API functions with an event hook.Thouis (Ray) Jones2012-06-151-2/+5
| | | | | | | | | | | | | | | Moves PyDataMem_NEW/FREE/RENEW to the external API. Fixes PyDataMem_NEW/RENEW to return void* instead of char*. Replaces PyDataMem_NEW/FREE with NpySortArray_malloc/free in sort.c.src (should be reverted if npysort is moved to be part of multiarraymodule). Adds PyDataMem_SetEventHook which takes a (PyDataMem_EventHookFunc *) as an argument, with signature: void hook(void *old, void *new, size_t size). When not NULL, hook will be called at the end of each PyDataMem_NEW/FREE/RENEW: result = PyDataMem_NEW(size) -> (*hook(NULL, result, size) PyDataMem_FREE(ptr) -> (*hook(ptr, NULL, 0) result = PyDataMem_RENEW(ptr, size) -> (*hook)(ptr, result, size) Adds tests in multiarray_tests.c.src, driven by tests/test_multiarray.py.
* DEP: Update all the '#define NPY_NO_DEPRECATED_API' instances to beMark Wiebe2012-04-061-1/+1
| | | | versioned
* ENH: Give digitize left or right open interval optionSkipper Seabold2012-04-031-16/+80
|
* WRN: Fix compiler warnings in _compiled_base.c.Charles Harris2012-04-011-5/+5
|
* ENH: improve interp() speed in some cases.Timo Kluck2012-04-011-19/+44
| | | | | | The interp function was computing slopes for all intervals, even when there were only a few points to be interpolated. Now it only does so when the number of interpolation points exceeds the number of sample points.
* ENH: Allow bincount to accept empty arrays.Skipper Seabold2012-03-041-4/+16
|
* UPD: Various fixes, Remove #define NPY_NO_PREFIX from files in core.Charles Harris2012-02-051-1/+1
|
* UPD: Remove includes of noprefix.h in ufunc_object.c and _compiled_base.c.Charles Harris2012-02-041-1/+1
|
* UPD: Use prefixed macros in *.c files except numarray and linalg.Charles Harris2012-02-041-1/+1
|
* STY: lib/src - replace macros in old_defines.h with new.Charles Harris2012-02-041-2/+2
|
* STY: Add comment and rename monotonic_ functino to be more descriptiveMark Wiebe2012-01-271-2/+7
|
* DOC: add a high-level comment for arr_insert_loopDavid Warde-Farley2012-01-251-0/+8
|
* REF: simplify multi-loop breaking with a goto.David Warde-Farley2011-09-201-4/+4
|
* ENH: release the GIL for arr_insert inner loop.David Warde-Farley2011-09-201-3/+14
| | | | | Releases it only conditionally, as object arrays require refcounting to be performed within the inner loop, making GIL release impractical.
* REF: factor out inner loop of arr_insert.David Warde-Farley2011-09-201-32/+44
| | | | This makes subsequent thread-friendly modification easier.
* ENH: release GIL for C loops in ravel/unravel.David Warde-Farley2011-09-191-14/+36
|
* ENH: Use char instead of int for error flag.David Warde-Farley2011-09-191-1/+1
|
* ENH: less fine-grained GIL management in digitize.David Warde-Farley2011-09-181-13/+10
|
* ENH: release the GIL in some C library functions.David Warde-Farley2011-09-181-0/+14
| | | | | | Sandwich certain potentially long running for loops that don't touch any Python objects between NPY_BEGIN_ALLOW_THREADS and NPY_END_ALLOW_THREADS so that the interpreter can potentially schedule another Python thread.
* STY: Some style cleanups.Charles Harris2011-08-291-17/+17
|
* ENH: Add function for adding docstrings to ufuncs.Chris Jordan-Squire2011-08-291-0/+47
|
* BUG: lib: use Py_TYPE to access ob_type, so it works also on Py3Pauli Virtanen2011-07-311-7/+8
|
* ENH: core: Rename PyArray_SetBase to PyArray_SetBaseObject to be more clearMark Wiebe2011-07-221-1/+1
|
* ENH: core: More cleanups removing direct PyArrayObject field accessMark Wiebe2011-07-191-73/+90
|
* API: Rename 'coords' to 'multi-index' in ravel_coords and iterator APIMark Wiebe2011-03-141-15/+16
|
* STY: Rename NPY_ITER_NO_INNER_ITERATION to NPY_ITER_EXTERNAL_LOOPMark Wiebe2011-03-141-2/+2
| | | | | It's a little bit shorter, and more intuitively expresses what the flag does.
* API: Simplify basic iterator constructors, add 'itershape' to advanced ↵Mark Wiebe2011-03-131-5/+5
| | | | iterator constructor
* API: Rename the iterator function pointer types to be more consistent with ↵Mark Wiebe2011-03-101-3/+3
| | | | | | | NumPy convention 'NpyIter_IterNext_Fn' -> 'NpyIter_IterNextFunc *' 'NpyIter_GetCoords_Fn' -> 'NpyIter_GetCoordsFunc *'
* STY: index_tricks: Improve comments and documentation stringsMark Wiebe2011-02-101-0/+13
|
* ENH: index_tricks: Implement unravel_index and ravel_coords functions in CMark Wiebe2011-02-101-0/+488
|
* ENH: Add minlength keyword to bincount. Patch from ticket #1595.David Warde-Farley2011-01-101-8/+24
|
* BUG: Make interp handle 'right' keyword correctly. Add check for emptyCharles Harris2010-05-241-35/+36
| | | | arrays of sample points. Closes ticket #1064.