summaryrefslogtreecommitdiff
path: root/numpy
Commit message (Collapse)AuthorAgeFilesLines
* ENH: Add `subok` parameter to np.copy function (cf. gfh6509) (gh-15685)Ross Barnowski2020-03-112-3/+19
| | | | | This is largely a re-submission of the original change proposed in #6509. Discussion was hosted in multiple forums including #3474, the numpy mailing list circa 10-2015, and the 02-26-2020 NumPy Triage meeting. This PR closes #3474 and #15570
* MAINT: Remove non-native byte order from _var check.Ross Barnowski2020-03-101-4/+0
| | | | | | | | Removes unnecessary code introduced in #15696. Non-native byte orders were explicitly added to the fast-path check in _var for complex numbers. However, the non-native path is unreachable due to coercion in upstream ufuncs.
* Merge pull request #15696 from rossbar/enh/var_complex_fastpathSebastian Berg2020-03-102-0/+56
|\ | | | | MAINT: Add a fast path to var for complex input
| * ENH: Adds a fast path to var for complex inputRoss Barnowski2020-03-092-0/+56
| | | | | | | | | | | | | | | | | | | | var currently has a conditional that results in conjugate being called for the variance calculation of complex inputs. This leg of the computation is slow. This PR avoids this computational leg for complex inputs via a type check. Closes #15684
* | Merge pull request #15706 from melissawm/f2py-typos-fixCharles Harris2020-03-083-8/+8
|\ \ | | | | | | MAINT: Fixing typos in f2py comments and code.
| * | Fixing typos in f2py comments and code.Melissa Weber Mendonca2020-03-043-8/+8
| |/
* | BUG: fix logic error when nm fails on 32-bitmattip2020-03-081-4/+7
| |
* | MAINT: use list-based APIs to call subprocesses (#15714)Sebastian Berg2020-03-074-34/+79
| | | | | | | | | | | | * MAINT: use list-based APIs to call subprocesses * TST, MAINT: add a test for mingw32ccompiler.build_import, clean up lib2def Co-authored-by: Matti Picus <matti.picus@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* | Merge pull request #15534 from seberg/deprecate-abstract-scalar-typesMatti Picus2020-03-068-21/+116
|\ \ | | | | | | DEP: Do not allow "abstract" dtype conversion/creation
| * | Update numpy/core/src/multiarray/descriptor.cSebastian Berg2020-03-041-1/+1
| | | | | | | | | Co-Authored-By: Matti Picus <matti.picus@gmail.com>
| * | Fixup: Do not deprecate generic python typesSebastian Berg2020-02-076-21/+18
| | | | | | | | | | | | | | | Add a comment that we can think about only allowing it for `dtype=...` though...
| * | DEP: Do not allow "abstract" dtype conversion/creationSebastian Berg2020-02-0612-26/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These dtypes do not really make sense as instances. We can (somewhat) reasonably define np.dtype(np.int64) as the default (machine endianess) int64. (Arguably, it is unclear that `np.array(arr_of_>f8, dtype="f")` should return arr_of_<f8, but that would be very noisy!) However, `np.integer` as equivalent to long, is not well defined. Similarly, `dtype=Decimal` may be neat to spell `dtype=object` when you intend to put Decimal objects into the array. But it is misleading, since there is no special meaning to it at this time. The biggest issue with it, is that `arr.astype(np.floating)` looks like it will let float32 or float128 pass, but it will force a float64 output! Arguably downcasting is a bug in this case. A related issue is `np.dtype("S")` and especially "S0". The dtype "S" does make sense for most or all places where `dtype=...` can be passed. However, it is conceptionally different from other dtypes, since it will not end up being attached to the array (unlike "S2" which would be). The dtype "S" really means the type number/DType class of String, and not a specific dtype instance.
* | | Merge pull request #15487 from ericmariasis/quantileSebastian Berg2020-03-042-1/+11
|\ \ \ | | | | | | | | BUG: Fixing result of np quantile edge case
| * | | BUG: Fixing result of np quantile edge caseEric Mariasis2020-02-282-1/+11
| | | |
* | | | convert shebang from python to python3 (#15687)Changqing Li2020-03-0429-29/+29
| |_|/ |/| | | | | | | | Signed-off-by: Changqing Li <changqing.li@windriver.com>
* | | DOC: Improve np.finfo docs (#15678)Ross Barnowski2020-03-011-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * DOC: Improve docs for np.finfo. Replace inaccurate statements about eps and epsneg attrs with correct statements and examples. Added np.spacing and np.nextafter to See Also. Closes #6940. * Removed LaTeX math from finfo docstring. * MAINT: Add periods at end of some sentences. Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
* | | FIXME -> NOTE: more precise language in comment.Ross Barnowski2020-03-011-2/+2
| | | | | | | | | | | | Reference multiple relevant discussions on GH
* | | MAINT: Added comment pointing FIXME to relevant PR.Ross Barnowski2020-03-011-0/+1
| | | | | | | | | | | | | | | | | | | | | Clarifies a FIXME comment in numpy/__init__.py by referencing relevant discussion in issue tracker. Closes #15668.
* | | DOC: Update to clarify actual behavior real_if_(all elements)_close (gh-15644)and-sang2020-02-281-5/+6
|/ / | | | | | | | | | | Updated the description to consider all array elements Updated the examples to use multiple elements array, to show that one element not close enough prevent for the whole array to be considered as real Closes #15626
* | BUG: fix doctest exception messagesmattip2020-02-283-7/+16
| |
* | Merge pull request #12646 from shoyer/refguide-check-exceptionsMatti Picus2020-02-281-2/+3
|\ \ | | | | | | TST: check exception details in refguide_check.py
| * | TST: check exception details in refguide_check.pyStephan Hoyer2019-01-011-2/+3
| | | | | | | | | | | | xref GH-12548
* | | Merge pull request #15504 from emmanuelle/patch-1Matti Picus2020-02-281-4/+1
|\ \ \ | | | | | | | | DOC: Remove duplicated code in true_divide docstring
| * | | DOC: reorder for a better flowmattip2020-02-281-3/+3
| | | |
| * | | Removed duplicated code in docstringEmmanuelle Gouillart2020-02-041-3/+0
| | | | | | | | | | | | I believe this line comes from an older version of the docstring which was importing `__future__`.
* | | | TST: Test division by zero both with scalar and with array (gh-15577)Christian Kastner2020-02-261-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The value for platform.machine() was reported from Debian in 2012, but current Debian systems no longer this value. Switch the test to the new arm_softfloat flag, which is the actual underlying cause of the test failure. closes gh-15562
* | | | Merge pull request #14995 from seberg/array-like-coercionMatti Picus2020-02-262-170/+177
|\ \ \ \ | | | | | | | | | | BUG: Use ``__array__`` during dimension discovery
| * | | | BUG: Use ``__array__`` during dimension discoverySebastian Berg2020-02-052-170/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``__array__`` was previously not used during dimension discovery, while bein gused during dtype discovery (if dtype is not given), as well as during filling of the resulting array. This would lead to inconsistencies with respect to array likes that have a shape including a 0 (typically as first dimension). Thus a shape of ``(0, 1, 1)`` would be found as ``(0,)`` because a nested list/sequence cannot represent empty shapes, except 1-D. This uses the `_array_from_array_like` function, which means that some coercions may be tiny bit slower, at the gain of removing a lot of complex code. (this also reverts commit d0d250a3c9d7d90e75701c32d7d435640e6b02eb or the related change). This is a continuation of work by Sergei Lebedev in gh-13663 which had to be reverted due to problems with Pandas, and the general inconsistency. This version may not resolve all issues with pandas, but does resolve the inconsistency. Closes gh-13958
* | | | | TST: mask DeprecationWarning in xfailed testsmattip2020-02-231-2/+3
| | | | |
* | | | | Merge pull request #15612 from r-devulap/maximum-bug-avxMatti Picus2020-02-232-9/+52
|\ \ \ \ \ | | | | | | | | | | | | BUG: Fix bug in AVX-512F np.maximum and np.minimum
| * | | | | MAINT: Improve formatting and update commentsRaghuveer Devulapalli2020-02-231-6/+9
| | | | | |
| * | | | | BUG: Update IS_OUTPUT_BLOCKABLE_UNARY to use the nomemoverlap checkRaghuveer Devulapalli2020-02-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | abs_ptrdiff(args[1], args[0]) >= (vsize) does not accomodate strides, specially when the strides are negative.
| * | | | | BUG: Check for memory overlap in AVX-512F implementation of np.maximim and ↵Raghuveer Devulapalli2020-02-231-4/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | np.minimum Fixes bug in np.maximum.accumulate and np.minimum.accumulate See https://github.com/numpy/numpy/issues/15597
| * | | | | TST: Adding test to validate np.maximum.accumulate and np.minimum.accumulateRaghuveer Devulapalli2020-02-231-0/+8
| | | | | |
* | | | | | Merge pull request #15579 from rsokl/clip_docs_fixCharles Harris2020-02-231-2/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | DOC: numpy.clip is equivalent to minimum(..., maximum(...))
| * | | | | | DOC: numpy.clip is equivalent to minimum(..., maximum(...))Ryan Soklaski2020-02-161-2/+2
| | | | | | |
* | | | | | | MAINT: Pull identical line out of conditional.Ross Barnowski2020-02-221-2/+1
| |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was an identical statement in both possible branches of a conditional. Moved statement out of conditional to eliminate one repititious LOC
* | | | | | Merge pull request #15615 from r-devulap/reciprocal-avx-CI-failMatti Picus2020-02-211-1/+0
|\ \ \ \ \ \ | | | | | | | | | | | | | | BUG: Remove check requiring natural alignment of float/double to run AVX code
| * | | | | | BUG: Remove check requiring float/double natural alignment for AVX codeRaghuveer Devulapalli2020-02-201-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a x86-32 bit system, doubles need not be naturally aligned to 8 Byte boundary (see: -malign-double section of https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html). Having this check meant it ran different code paths (AVX v/s scalar) depending on the alignment of data which leads to different results and test failing intermittently. AVX code uses un-aligned loads and this check is unnecessary to begin with.
* | | | | | | DOC: fix documentation for apply_along_axis (#15619)Heshy Roskes2020-02-201-2/+2
|/ / / / / /
* | | | | | DOC: Reword docstring for assert_equal (gh-15614)Harshal Prakash Patankar2020-02-191-1/+1
| | | | | |
* | | | | | TST: Add test to ensure assert_array_max_ulp ignores ULP differences betwen ↵Raghuveer Devulapalli2020-02-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | NAN's
* | | | | | TST: remove large numbers from sin/cos validation test suiteRaghuveer Devulapalli2020-02-182-89/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sine and cosine of large numbers are always computed via the standard C library and the results vary depending on the platform.
* | | | | | BUG: Ignore differences in NAN representation for computing ULP differencesRaghuveer Devulapalli2020-02-181-2/+17
|/ / / / /
* | | | | Merge pull request #15549 from r-devulap/transcendental-avxMatti Picus2020-02-161-22/+22
|\ \ \ \ \ | | | | | | | | | | | | TST: Accuracy test float32 sin/cos/exp/log for AVX platforms
| * | | | | TEST: Enable accuracy tests for float32 sin/cos/exp/log for AVX platformsRaghuveer Devulapalli2020-02-121-22/+22
| | | | | |
* | | | | | DOC: Document caveat in random.uniformmattip2020-02-151-2/+9
| | | | | |
* | | | | | Merge pull request #15385 from eric-wieser/fix-unicode-ucs2Sebastian Berg2020-02-1311-268/+175
|\ \ \ \ \ \ | | | | | | | | | | | | | | BUG, MAINT: Stop using the error-prone deprecated Py_UNICODE apis
| * | | | | | ENH: Implement the buffer protocol on numpy str_ scalarsEric Wieser2020-02-082-25/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This eliminates the need for special casing in `np.generic.__reduce__`
| * | | | | | MAINT,TST: Tidy test_datetime_memoryview a littleEric Wieser2020-02-081-9/+8
| | | | | | |