summaryrefslogtreecommitdiff
path: root/numpy/core
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #3992 from ewmoore/winhypotJulian Taylor2013-10-302-7/+11
|\ | | | | BUG: hypot(inf, 0) shouldn't raise a warning
| * BUG: fix handling of infs in hypot on windowsEric Moore2013-10-292-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | On any platform where we used our own implementation of hypot, (e.g. windows) there were several issues with infs. hypot(inf, y) == inf, for all y including nan. We now check for inf and handle this case explicitly for all y instead of just y = nan. Although hypot(inf, 0) was correctly returning inf, it was incorrectly raising the invalid floating point exception. Fixes gh-2385
* | Merge pull request #3969 from juliantaylor/memchr-bug2Charles Harris2013-10-253-30/+25
|\ \ | | | | | | BUG: fix handling of negative strides in npy_memchr
| * | MAINT: remove trailing zero count path in npy_memchrJulian Taylor2013-10-252-10/+8
| | | | | | | | | | | | | | | its only actually faster than just running through the trailing bytewise loop if the needle is in the last byte.
| * | BUG: fix handling of negative strides in npy_memchrJulian Taylor2013-10-232-22/+19
| | | | | | | | | | | | | | | the new code did not account for them at all, add the old loops back but keep the stride 1 optimization for sparse masks.
* | | Merge pull request #3965 from seberg/valgrindCharles Harris2013-10-249-34/+60
|\ \ \ | | | | | | | | MAINT: Initialize strides in NpyIter and silence valgrind
| * | | TST: Initialize some arrays to to avoid valgrind warningsSebastian Berg2013-10-241-1/+1
| | | |
| * | | BUG: Further reference count issues in __int__ and friendsSebastian Berg2013-10-241-0/+15
| | | |
| * | | BUG: Fix clongdouble type in scalar type selectionSebastian Berg2013-10-241-1/+1
| | | |
| * | | MAINT|BUG: Some small refcounting fixesSebastian Berg2013-10-244-23/+32
| | | |
| * | | BUG|MAINT: Fix reference count bugs, init NpyIter stridesSebastian Berg2013-10-244-9/+11
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | Also changes some tests to not use np.empty as to avoid valgrind spam. The NpyIter strides are arbitrary, but 0 makes sense, and the strides are used to decide which transfer function to use, etc. causing lots of warnings in valgrind.
* | | ENH: keep order in np.sort and np.partition copyJulian Taylor2013-10-231-2/+2
| |/ |/| | | | | avoids unnecessary strided to contig copy for fortran arrays.
* | ENH: merge UFUNC_ERR_DEFAULT2 variable into UFUNC_ERR_DEFAULTJulian Taylor2013-10-224-6/+21
| | | | | | | | | | | | | | | | | | It seems it was added as a precaution to avoid breaking the rather complicated ufunc code. It effectively disabled the skipping of the dictionary lookup for the default values for the common case and leading to hardly tested code in third party libraries like pandas which set the error state to numpys old default (ignore all). The skipping improves scalar performance by 2.5-5%.
* | BUG: fix crash on default errobjJulian Taylor2013-10-221-3/+10
|/ | | | | | Missing check for optional NULL argument, the case can only happen if the error mask is 0 (the old default). closes gh-3962
* Merge pull request #3952 from JStech/issue_2052seberg2013-10-212-0/+10
|\ | | | | BUG: #2052 del scalar subscript causes segfault
| * BUG: #2052 del scalar subscript causes segfaultJohn Stechschulte2013-10-202-0/+10
| | | | | | | | | | | | | | | | Fixes issue #2052, where attempting to delete a scalar field causes a segfault. Returns ValueError instead, like when attempting to delete an array element. Also added a test for this bug.
* | BUG: wrong boundary check in unrolled memchrJulian Taylor2013-10-201-1/+1
| |
* | Merge pull request #3856 from pv/op-before-ufuncCharles Harris2013-10-194-3/+294
|\ \ | | | | | | BUG: core: ensure __r*__ has precedence over __numpy_ufunc__
| * | BUG: core: ensure __r*__ has precedence over __numpy_ufunc__Pauli Virtanen2013-10-194-3/+294
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Add a special case to the implementation of ndarray.__mul__ et al. that refuses to work on other objects that are not ndarray subclasses and implement both __numpy_ufunc__ and __r*__. This way, execution passes first to the custom __r*__ method, which makes it possible to have e.g. __mul__ and np.multiply do different things. Additionally, disable one __array_priority__ special case handling when also __numpy_ufunc__ is defined.
* | ENH: Add scalar special cases to Priority getterSebastian Berg2013-10-191-0/+7
| | | | | | | | | | | | Exact Python scalars can never have a priority, but checking it is expensive. This adds checks for these to the Priority getter function.
* | Merge pull request #3946 from juliantaylor/pyufunc_refactorCharles Harris2013-10-192-105/+206
|\ \ | | | | | | delay error object creation to when errors occur
| * | MAINT: refactor ufunc error object handlingJulian Taylor2013-10-192-72/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _get_global_ext_obj: retrieves global ufunc object _get_bufsize_errmask: get only bufsize and errormask from ufunc object _extract_pyvals: handle NULL extobj PyUFunc_GetPyValues implemented as _get_global_ext_obj +_extract_pyvals drop unused first_error variable. fix errobj memory leak in previous commit. add some test for the extobj and warning path, the warning tests are disabled like the raising path as they fail on a bunch of platforms.
| * | ENH: High time consumption by PyUFunc_GetPyValues in ufunc_object.cArink Verma2013-10-191-56/+86
| | | | | | | | | | | | | | | | | | For every single operation calls, numpy has to extract value of buffersize, errormask and name to pack and build error object. These two functions, _extract_pyvals and PyUFunc_GetPyValues together use >12% of time.
* | | ENH: accept callable as message in assert_Julian Taylor2013-10-191-4/+3
| | | | | | | | | | | | | | | | | | | | | Allows deferring evaluation until failure. Used for blocked minmax test which evaluate array representations for the error message many thousand times accumulating to a full second useless runtime.
* | | ENH: unroll vector minmax loopJulian Taylor2013-10-191-26/+22
|/ / | | | | | | | | | | | | Improves speed by 10% on intel cpus. Simplify code by moving the fenv support check into the dispatcher. fenv works on all common platforms (including windows), the fallback is not worth it for the exotic platforms where it might not be available.
* | MAINT: fix item_selection.c so it compiles without warningsLars Buitinck2013-10-191-12/+12
| |
* | MAINT: typoLars Buitinck2013-10-191-1/+1
| |
* | MAINT: unused variable, formattingLars Buitinck2013-10-192-4/+5
| |
* | MAINT: C identifiers causing UB + useless char returnsLars Buitinck2013-10-191-22/+20
| | | | | | | | | | | | | | | | | | | | C identifiers aren't allowed to match "^_[A-Z]". Fixed that in numpyos.c and removed some more useless underscores. Changed NumPyOS_ascii_tolower and the code that calls it to handle ints, not chars. C promotes char to int in so many situations that char variables are just a pain. (The C standard library uses int in <ctype.h>, for example.)
* | ENH: Inline check_and_adjust_indexSebastian Berg2013-10-192-35/+35
|/ | | | | | The function takes a considerable amount of time of np.take and to also fancy indexing. Simple np.takes can speed up by more then 40%, fancy indexes around 10%.
* Merge pull request #3941 from charris/make-test-endian-independentCharles Harris2013-10-171-2/+2
|\ | | | | BUG: test_fortran_order_buffer fails on big endian architectures.
| * BUG: test_fortran_order_buffer fails on big endian architectures.Charles Harris2013-10-171-2/+2
| | | | | | | | | | | | | | | | The numpy unicode string comparison function does not work correctly for non-native byte orders. That is a problem needing fixing, but test_fortran_order_buffer is only needed to check that the buffer works correctly for fortran order buffers, so let the endianess of test data be the platform default.
* | BUG: multiarray/mapping -- address for former renaming of array_ass_big_itemYaroslav Halchenko2013-10-171-10/+1
|/ | | | | Lead to build failures on s390 (32bit user space). Patch by Charles Harris
* Merge pull request #3933 from charris/add-missing-no-deprecated-apiCharles Harris2013-10-171-1/+3
|\ | | | | MAINT: Define NPY_NO_DEPRECATED_API in struct_ufunc_test.c.src
| * MAINT: Define NPY_NO_DEPRECATED_API in struct_ufunc_test.c.srcCharles Harris2013-10-161-1/+3
| | | | | | | | | | Removes a compile warning and makes the function use proper macro replacements. Also fix a pointer type mismatch warning.
* | Merge pull request #3931 from juliantaylor/memchr-moveCharles Harris2013-10-1611-54/+136
|\ \ | | | | | | move memchr like code to a function
| * | ENH: improve npy_memchr(p, 0) by using __builtin_ctz (tzcnt on x86)Julian Taylor2013-10-172-0/+22
| | | | | | | | | | | | | | | Improves sparse mask performance by about a factor of three, the worst case of no consecutive mask elements slows down by about 10%-15%.
| * | MAINT: add npy_memchr for memchr like operationsJulian Taylor2013-10-176-50/+106
| | | | | | | | | | | | useful for small sizes where the function call is expensive.
| * | MAINT: silence warning by casting to right typeJulian Taylor2013-10-172-3/+3
| | |
| * | MAINT: add NPY_CPU_HAVE_UNALIGNED_ACCESS macroJulian Taylor2013-10-162-1/+5
| |/ | | | | | | | | | | currently only i386 and amd64, must be used carefully as the compiler may still be allowed to assume alignment and try to vectorize based on type size alignment.
* | Merge pull request #3913 from bspinnler/fix_correlate_docstringCharles Harris2013-10-161-1/+27
|\ \ | | | | | | DOC: fixed correlate docstring.
| * | DOC: replaced typeset formulas by pure ASCII equivalents.Bernhard Spinnler2013-10-151-13/+12
| | | | | | | | | | | | | | | Replaced typeset formulas by pure ASCII equivalents. Should now be easier to read in source files.
| * | DOC: fixed correlate docstring.Bernhard Spinnler2013-10-131-7/+34
| | | | | | | | | | | | | | | Replaced correlation formula with corrected version that matches the numpy implementation. Added comment on possible further different definitions of correlation. Added examples.
* | | Merge pull request #3929 from chrodan/strc++11Charles Harris2013-10-161-1/+1
|\ \ \ | | | | | | | | add spaces to literal string concatination for C++11 compatibility
| * | | added spaces to literal string concatsChristoph Dann2013-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | literal string concatination without spaces not allowed in C++11 anymore
* | | | Merge pull request #3932 from juliantaylor/windows-annoyanceCharles Harris2013-10-161-2/+6
|\ \ \ \ | |/ / / |/| | | BUG: fix declaration-after-statement
| * | | BUG: fix declaration-after-statementJulian Taylor2013-10-161-2/+6
| | |/ | |/| | | | | | | closes gh-3930
* | | Merge pull request #3914 from mhvk/numeric/isclose-mask-safeCharles Harris2013-10-162-1/+8
|\ \ \ | |/ / |/| | BUG Masked arrays treated incorrectly in isclose(..,..,equal_nan=True)
| * | Ensure masked arrays are treated correctly for isclose(..,..,equal_nan=True)Marten van Kerkwijk2013-10-132-1/+8
| |/
* | BUG: Check that npyiter is not too largeSebastian Berg2013-10-152-1/+15
| | | | | | | | | | Since NpyIter keeps track of the total size, this cannot be larger then npy_intp, so that an overflow check is necessary.