summaryrefslogtreecommitdiff
path: root/numpy
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #8602 from behrmann/fix-iscomplexobjStephan Hoyer2017-02-112-5/+12
|\ | | | | BUG: Make iscomplexobj compatible with custom dtypes again
| * BUG: Make iscomplexobj compatible with custom dtypes againJoerg Behrmann2017-02-102-5/+12
| | | | | | | | | | | | | | | | | | This change makes iscomplexobj compatible with custom array types using custom dtypes, that are not fully compatible to Numpys dtypes, which can nevertheless be coerced to a numpy array with asarray again, as has been the behaviour before PR #7936. Fixes #8601
* | BUG: make np.squeeze always return an array, never a scalarEric Wieser2017-02-102-2/+4
|/ | | | Fixes #8588
* Merge pull request #8592 from eric-wieser/remove-setsliceCharles Harris2017-02-107-129/+5
|\ | | | | MAINT: Remove __setslice__ and __getslice__
| * MAINT: Remove __setslice__ and __getslice__Eric Wieser2017-02-097-129/+5
| | | | | | | | | | This code was only here for Python 2.5 compatibility, but numpy requires 2.7 at minimum
* | Merge pull request #8575 from godaygo/doc-typos-1Charles Harris2017-02-091-2/+2
|\ \ | | | | | | DOC: fix several typos #8537.
| * | DOC: fix typo in 'Indexing Multi-dimensional arrays'Kirill Balunov2017-02-071-2/+2
| |/ | | | | | | [ci skip]
* | BUG: match hard-coded finfo to calculated MachArMatthew Brett2017-02-092-24/+34
| | | | | | | | | | | | | | Make sure that value shapes and dtypes are the same as the original calculated values from the MachAr class. Closes #8585
* | TST: Replace use of sys.getsizeof() with explicit computation of unicode ↵Ronan Lamy2017-02-081-1/+11
|/ | | | | | | | | representation size This is for PyPy3 compatibility: sys.getsizeof() is CPython-specific and there doesn't seem to be a pure-Python way of getting the size of the internal PEP393 Unicode representation, so recompute it using documented invariants.
* Merge pull request #8571 from juliantaylor/dbg-fixesCharles Harris2017-02-061-5/+25
|\ | | | | BUG: fix calling python api with error set and minor leaks
| * BUG: fix calling python api with error set and minor leaksJulian Taylor2017-02-061-5/+25
| |
* | MAINT: remove ma out= workaroundJulian Taylor2017-02-061-4/+0
| | | | | | | | unnecessary since gh-8416
* | Add missing __tracebackhide__ to testing functions.Antony Lee2017-02-041-0/+2
| |
* | TST: re-enable PPC longdouble spacing testsMatthew Brett2017-02-041-4/+4
| | | | | | | | Now we have eps on PPC longdouble, re-enable the tests of float spacing.
* | TST: core: use aligned memory for dot() out= arraysPauli Virtanen2017-02-041-1/+32
| | | | | | | | | | | | On SPARC, longdouble alignment is bigger than that provided by default allocation. So use a custom allocation method in the test using dot(out=).
* | ENH: hard-code finfo parameters for known types (#8504)Matthew Brett2017-02-032-26/+292
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ENH: hard-code finfo parameters for known types Hard-code the MachAr parameters for float64, float32, 80-bit extended precision, to save time, and provide skeleton for more difficult types such as the double double on PPC; see https://github.com/numpy/numpy/issues/2669 * ENH: add PPC long double finfo Add parameters for PPC long double, fixing long-standing bug for finfo on PPC. * BF: use Python floats for float64 finfo For some reason (garrgh) np.exp2 with float64 gives a different answer on Windows than it does on other platforms; use Python floating point calculations instead, which do appear to be consistent. * DOC: add release notes for finfo fixes Add release note describing fixes for PPC long double ``finfo``. * RF: try using byte string to identify floats From suggestion by Chuck, and https//perl5.git.perl.org/perl.git/blob/3118d7d684b56cbeb702af874f4326683c45f045:/Configure * TST: add tests for reasonable finfo parameters Check that finfo returns somewhat reasonable parameters for all floating point types. * RF: add warning for not-recognized float type Warn if we don't have a signature for the float type. * NF: add IEEE float128 type signature Still needs test on platform with IEEE float128, to check MachAr-like parameters are correct.
* | 8552 doc clip none (#8558)pezcore2017-02-031-5/+9
| | | | | | | | | | | | * documenting behaviour of passing `None` to upper or lower interval bounds in `clip()` * doc: specifying that not more than one of formal parameters `a_min` and `a_max` may be none
* | Merge pull request #8555 from pezcore/8554-polyvander2d-doc-bugCharles Harris2017-02-016-6/+6
|\ \ | | | | | | Fixing docstring error in polyvander2d
| * | Applied same fix as 1695458be to remaining 5 polynomial typesTom Boyd2017-02-015-5/+5
| | | | | | | | | | | | | | | | | | - Fixes documentation of polynomial types `*vander2d()` methods to give the correct last index of the pseudo-Vandermonde matrix returned expressed in terms of x and y.
| * | Fixing docstring error in polyvander2dTom Boyd2017-02-011-1/+1
| | |
* | | BUG Ensure that operations on MaskedArray return any output given.Marten van Kerkwijk2017-02-012-4/+16
|/ / | | | | | | | | | | | | | | | | | | Without this commit, after an operation like ``` a = np.ma.MaskedArray([1., 2., 3.]) b = np.add(a, 1., out=a) ``` one would have `b is not a`. With this PR, it is guaranteed that `b is a`.
* | Merge pull request #8551 from madphysicist/patch-1Charles Harris2017-01-311-2/+2
|\ \ | | | | | | DOC: Missing backticks
| * | Added searchsorted to see items.Joseph Fox-Rabinovitz2017-01-311-1/+1
| | |
| * | DOC: Missing backticksJoseph Fox-Rabinovitz2017-01-311-1/+1
| | | | | | | | | Came across this in the online docs
* | | Merge pull request #8508 from eric-wieser/fix-masked-ufunc-shapeahaldane2017-01-312-2/+27
|\ \ \ | |/ / |/| | BUG: Fix loss of dimensionality of np.ma.masked in ufunc
| * | BUG: Fix loss of dimensionality of np.ma.masked in ufuncEric Wieser2017-01-202-2/+27
| | | | | | | | | | | | Fixes #8505
* | | Merge pull request #8539 from pv/dot-out-overlapCharles Harris2017-01-303-74/+168
|\ \ \ | | | | | | | | BUG: core: in dot(), make copies if out has memory overlap with input
| * | | TST: core: test all dtypes in test_dot_out_mem_overlapPauli Virtanen2017-01-291-3/+5
| | | |
| * | | STY: core: rename variable ret to out_buf in matrix productPauli Virtanen2017-01-292-85/+92
| | | |
| * | | TST: core: make test_dot_out_mem_overlap minimalPauli Virtanen2017-01-291-8/+8
| | | |
| * | | BUG: core: in dot(), make copies if out has memory overlap with inputPauli Virtanen2017-01-283-11/+96
| | | | | | | | | | | | | | | | | | | | | | | | BLAS does not allow aliased inputs. If user-provided out= argument may overlap in memory with one of the inputs to dot(), put the output to a temporary work array and copy back after the operation.
* | | | Merge pull request #8494 from utke1/masterCharles Harris2017-01-284-1/+60
|\ \ \ \ | | | | | | | | | | BUG: guard against replacing constants without '_' spec
| * | | | STY: space around operatorjutke2017-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | per request from @charris
| * | | | TST: adding test for constants without compound kind specjutke2017-01-202-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This augments the test in constant_compound.f90 by using constants without a compound kind spec to illustrate the case that led to the reporting of issue #8493
| * | | | TST: adding tests for compound constant provided by @zerothijutke2017-01-202-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | This is a test code provided as a patch by @zerothi checking the compound constant parsing.
| * | | | BUG: guard against replacing constants without '_' specjutke2017-01-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fixes #8493 In the reported problem snippet the attempt to infer the type of parameter (wasize=maxiterates*2) leads to a lookup of maxiterates in the logic of get_parameters which finds and correctly assigns to 'v' the value string '50000' However, then in the logic proceds to attempt to split off any underscore-appended precision spec from v_ which yields ['50000'] because there is no underscore. Finally line v = ''.join(v_[:-1]).lower().replace(v_[-1].lower(), '') if not quarded by the newly introduced lengthtest sets v to empty because [:-1] of a list with one element yields an empty list. Subsequently the type inference by running eval on an empty string fails with the error message quoted. The introduced length check appears to correct this problem.
* | | | | MAINT: typo in histogram docstringdrlvk2017-01-281-1/+1
| |/ / / |/| | | | | | | "it's arguments" should be "its arguments"
* | | | Merge pull request #8524 from juliantaylor/f2-mean-fixCharles Harris2017-01-242-2/+8
|\ \ \ \ | | |_|/ | |/| | BUG: fix mean for float 16 non-array inputs
| * | | BUG: fix mean for float 16 non-array inputsJulian Taylor2017-01-242-2/+8
| | | |
* | | | BUG: bool(dtype) is TrueJim Crist2017-01-232-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously `bool(dtype(...))` would fallback to the default implementation of `__nonzero__`, which checks if `len(object) > 0`. Since `dtype` objects implement `__len__` as the number of record fields, `bool` of scalar dtypes like `bool(dtype('i8'))` would evaluate as `False`. This fixes that by implementing `__nonzero__` to always return True. Fixes #6294.
* | | | Fix building extensions with MinGW in WinPython 3.4 (#8454)Roland Kaufmann2017-01-221-41/+75
| | | | | | | | | | | | MAINT: Fix building extensions with MinGW in WinPython 3.4
* | | | Merge pull request #8326 from juliantaylor/vectorize-packbitsCharles Harris2017-01-203-10/+255
|\ \ \ \ | | | | | | | | | | ENH: Vectorize packbits with SSE2
| * | | | ENH: use a lookup table for unpack bitsJulian Taylor2017-01-121-7/+41
| | | | | | | | | | | | | | | | | | | | | | | | | Uses 2KiB of space, but makes unpack bits 8 times faster and comparable with the vectorized packbits.
| * | | | ENH: vectorize packbits with SSE2Julian Taylor2017-01-122-2/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SSE2 has a special instruction to pack bytes into bits, available as the intrinsic _mm_movemask_epi8. It is significantly faster than the per byte loop currently being used. Unfortunately packbits is bitwise "big endian", the most significant bit is the first in the input byte while _mm_movemask_epi is little endian so we need to byteswap the input first. But it is still about 8-10 times faster than the scalar code.
| * | | | TST: add extended packbits testsJulian Taylor2017-01-121-1/+178
| | | | | | | | | | | | | | | | | | | | | | | | | Larger data to account for future vectorization. Also add benchmarks for packbits and unpackbits
* | | | | Changing spurious Legendre reference to Chebyshev in chebfit docstring.Danny Hermes2017-01-191-1/+1
| |_|_|/ |/| | |
* | | | Merge pull request #8486 from eric-wieser/patch-8ahaldane2017-01-172-3/+27
|\ \ \ \ | | | | | | | | | | BUG: Prevent crash for length-0 input to fromrecords
| * | | | BUG: Fix IndexError in fromrecordsEric Wieser2017-01-172-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes: * The case when len(recList) == 0 and dtype is not None * The case when np.ndim(recList) > 1 In both cases, this would previously IndexError
* | | | | Merge pull request #8470 from MartinThoma/savez_compressed_docsCharles Harris2017-01-171-6/+44
|\ \ \ \ \ | |_|_|_|/ |/| | | | DOC: Add example to np.savez_compressed
| * | | | DOC: Add example to np.savez_compressedMartin Thoma2017-01-151-6/+44
| | | | |