| Commit message (Collapse) | Author | Age | Files | Lines |
| |\
| |
| | |
ENH: improve printing of arrays with multi-line reprs
|
| | |
| |
| | |
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
|
| | | |
|
| | | |
|
| |\ \
| | |
| | | |
DEP: Deprecate `numpy.dual`.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- Delete release note fragments from 1.19.0 (towncrier)
- Update 1.19.x release note (towncrier)
- Create 1.20.0-notes.rst for master development
- Update C-API versions for 1.20.x
- Update setup.py for 1.20.0
|
| |\ \ \
| | | |
| | | | |
DOC: Fix typos and cosmetic issues
|
| | | | | |
|
| |/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* Using PyArray_PyIntAsIntp helper function instead
* TST: add tests for einsum numpy int and bool list subscripts
Added tests to check that einsum accepts numpy int64 types and
rejects bool. Rejecting bools is new behaviour in subscript lists.
I changed ValueError to TypeError on line 2496 in multiarraymodule.c
as it is more appropriate. I also modified einsumfunc.py to have the
same behaviour as in the C file when checking subscript list.
(Reject bools but accept anything else from operator.index())
Closes gh-15961
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The lack of identity for `logaddexp2` was first identitifed in #4599.
The implementation in #8955 added -inf as identity for `logaddexp`,
but missed adding it for `logaddexp2`.
Co-Authored-By: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
|
| | | |
| | |
| | |
| | | |
Add note detailing the changes to MT19937 jumped
|
| |\ \ \
| | | |
| | | | |
BUG: Fix string to bool cast regression
|
| | | | | |
|
| | |/ /
|/| |
| | |
| | |
| | |
| | | |
Match the corresponding kwarg and behavior from related functions
like allclose.
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
|
| |\ \ \
| | | |
| | | | |
ENH: Allow toggling madvise hugepage and fix default
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
By default this disables madvise hugepage on kernels before 4.6, since
we expect that these typically see large performance regressions when
using hugepages due to slow defragementation code presumably fixed by:
https://github.com/torvalds/linux/commit/7cf91a98e607c2f935dbcc177d70011e95b8faff
This adds support to set the behaviour at startup time through the
``NUMPY_MADVISE_HUGEPAGE`` environment variable.
Fixes gh-15545
|
| |\ \ \ \
| | | | |
| | | | | |
DOC: Move misplaced news fragment for gh-13421
|
| | | |/ /
| |/| | |
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* ENH: update numpy.linalg.multi_dot to accept an `out` argument
* TST ensure value returned by numpy.linalg.multi_dot matches out
* DOC add note about initial call to numpy.linalg.multi_dot
* DOC add release note for #15715
Co-authored-by: Matti Picus <matti.picus@gmail.com>
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
|
| |/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
(#14924)
* Add stick-breaking
* Add tests demonstrating slowness for beta and dirichlet generators for small alpha (and beta) values
* Remove the test for beta with small `a` and `b`
* Switch from standard to stick-breaking method whenever alpha.max() < 0.1
Co-authored-by: Warren Weckesser <warren.weckesser@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
|
| |\ \ \
| |_|/
|/| | |
MAINT: AVX512 implementation with intrinsic for float64 input np.exp()
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
See issue gh-15297 and related mailing list discussion.
This PR bring scalar.__round__() in line with python, so that `round(scalar)` always returns a python integer, while `round(scalar, ndigits=0)` returns the same type. Since complex numbers are not supported in Python, and cannot be reasonably cast to integers they are deprecated.
Closes gh-15297
|
| |\ \ \
| | | |
| | | | |
BUG: Fix eigh and cholesky methods of numpy.random.multivariate_normal
|
| | | | |
| | | |
| | | |
| | | | |
Fixes #15871
|
| |\ \ \ \
| | | | |
| | | | | |
DEP: Deprecate ndarray.tostring()
|
| | | | | | |
|
| | | | | |
| | | | |
| | | | |
| | | | | |
The corresponding `array.array.tostring()` in the standard library has been deprecated in favor of `tobytes` since Python 3.1 (python/cpython@1ce3eb5c5b4830e69b21865e2d723e22749544e0).
|
| | | | | |
| | | | |
| | | | |
| | | | | |
Enables the keepdims argument (kwarg only) for count nonzero, since it is a
reduce like operation.
|
| |\ \ \ \ \
| |_|/ / /
|/| | | |
| | | | |
| | | | | |
eric-wieser/reject-illegal-strides-in-ndarray.__new__
BUG: Do not ignore empty tuple of strides in ndarray.__new__
|
| | |/ / /
| | | |
| | | |
| | | |
| | | |
| | | | |
Previously this was treated as though an empty set of strides were passed.
Now this is treated as a request for `.strides == ()`.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This expires a deprecation from 1.8.
The corresponding deprecation in `np.insert` has less clear semantics, so has been left to a future patch.
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
Co-authored-by: Warren Weckesser <warren.weckesser@gmail.com>
|
| |\ \ \ \
| |/ / /
|/| | | |
DEP: Make `np.insert` and `np.delete` on 0d arrays with an axis an error
|
| | | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Before this change, the following code worked:
```
>>> some_0d = np.array(1)
>>> np.insert(some_0d, "some nonsense", 10, axis=0)
array(10)
>>> np.insert(some_0d, "some nonsense", 42, axis="some nonsense")
array(42)
```
Now these raise AxisError and TypeError, respectively.
`delete` is exactly the same.
|
| |\ \ \
| | | |
| | | | |
DEP: Make np.delete on out-of-bounds indices an error
|
| | |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Note that this only affects lists of indices.
```python
>>> a = np.arange(3)
````
Before:
```python
>>> np.delete(a, 100)
IndexError
>>> np.delete(a, [100])
DeprecationWarning
array([0, 1, 2])
>>> np.delete(a, -1)
array([0, 1])
>>> np.delete(a, [-1])
FutureWarning
array([0, 1, 2])
```
After:
```python
>>> np.delete(a, 100)
IndexError
>>> np.delete(a, [100])
IndexError
>>> np.delete(a, -1)
array([0, 1])
>>> np.delete(a, [-1])
array([0, 1])
```
|
| |\ \ \
| | | |
| | | | |
DEP: Forbid passing non-integral index arrays to `insert` and `delete`
|
| | |/ /
| | |
| | |
| | | |
This expires a deprecation warning from back in 1.9.
|
| |/ /
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This finishes the deprecation started in gh-9505 removing
behaviour that allowed strings/types representing specific dtypes
to behave like their more generic supertypes (e.g. the python
float would map to floating instead of float64 which it typically
maps to).
Co-Authored-By: Eric Wieser <wieser.eric@gmail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(gh-15463)
xref gh-14778
As pointed out in the comment by @jamesthomasgriffin, we did not include a pxd file to expose the distribution functions documented in the random c-api. This PR adds a c_distributions.pxd file that exposes them.
Squashed commits:
* BUG: add missing c_distributions.pxd to enable cython use of random C-API
* ENH, TST: add npyrandom library like npymath, test cython use of it
* BUG: actually prefix f-string with f
* MAINT: fixes from review, add _bit_generato_bit_generator.pxd
* STY: fixes from review
* BLD: don't use nprandom library for mtrand legacy build
* TST: WindowsPath cannot be used in subprocess's list2cmdline
* MAINT, API: move _bit_generator to bit_generator
* DOC: add release note about moving bit_generator
* DOC, MAINT: fixes from review
* MAINT: redo dtype determination from review
|
| | |
| |
| |
| |
| | |
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
|
| |\ \
| | |
| | | |
DEP: Do not allow "abstract" dtype conversion/creation
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| |\ \ \
| |_|/
|/| | |
BUG: Use ``__array__`` during dimension discovery
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
``__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
|
| | |/
|/|
| |
| | |
This eliminates the need for special casing in `np.generic.__reduce__`
|
| |\ \
| |/
|/| |
ENH: improve runtime detection of CPU features
|
| | | |
|