| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit c088383cb290ca064d456e89d79177a0e234cb8d and
uses the same kind casting rule for the additional keyword arguments
``to_end`` and ``to_begin``. This results in slightly more leniant
behaviour for integers (which can now have overflows that are
hidden), but fixes an issue with the handling of NaN.
Generally, this behaviour seems more conistent with what NumPy does
elsewhere. The Overflow issue exists similar in many other places
and should be solved by integer overflow warning machinery while
the actual cast takes place.
Closes gh-13103
|
| | |
|
| |
| |
| |
| | |
Fix wrong multiplier for /proc/meminfo, and do style cleanups.
|
|\ \
| | |
| | | |
MAINT: Only copy input array in _replace_nan() if there are nans to replace
|
| |/ |
|
|\ \
| | |
| | | |
DEP: issue deprecation warning when creating ragged array (NEP 34)
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This PR allows the axis keyword in expand_dims to be a tuple of ints. Previously, axis could only be an int.
This issue was previously discussed in gh-12290 and the changes are based on gh-12290 (comment).
This PR also removes the deprecation added in v1.13 (2017-05-17), where previously axis could be outside of the range (-a.ndim - 1) <= axis <= a.ndim. Such an axis value will now raise an AxisError. Please let me know if it's too soon to remove this deprecation (I could not find any dev docs stating the length of the numpy deprecation cycle).
Closes gh-12290.
|
| | |
| | |
| | | |
Address gh-14142 for the 1.18 release: warn when saving a dtype with metadata that cannot be loaded.
|
| |/
|/| |
|
| |
| |
| |
| | |
Relates to gh-6103
|
|/
|
|
|
|
| |
Fraction.__float__ gives a DeprecationWarning if the division results in a non-builtin float
This was never intended as part of the test anyway.
|
|
|
|
| |
As per NEP-32, the financial functions are deprecated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
An input such as
np.histogram(np.array([-2, 0, 127], dtype=np.int8), bins="auto")
would raise the exception
ValueError: Number of samples, -1, must be non-negative.
The problem was that the peak-to-peak value for the input array was
computed with the `ptp` method, which returned negative values for
signed integer arrays when the actual value was more than the
maximum signed value of the array's data type.
The fix is to use a peak-to-peak function that returns an
unsigned value for signed integer arrays.
Closes gh-14379.
|
|\
| |
| | |
MAINT: Avoid BytesWarning in PyArray_DescrConverter()
|
| |
| |
| |
| |
| |
| |
| |
| | |
A BytesWarning can be emitted when bytes are and strings are mismatched.
Catching BytesWarning ensures a better boundary between str and bytes
type. The test suite is now run with the -b flag to emit this warning.
Fixes #9308
|
|\ \
| |/
|/| |
DEP: remove deprecated select behaviour
|
| | |
|
|/
|
|
|
| |
In wrap and clip modes ravel_multi_index crashes or gave
invalid results if input arrays were empty but the shape not.
|
|\
| |
| | |
BUG: Fix flatten_dtype so that nested 0-field structs are flattened correctly
|
| |
| |
| |
| | |
This affects the behavior of merge_arrays.
|
|\ \
| | |
| | | |
API: Do not return None from recfunctions.drop_fields
|
| |/
| |
| |
| | |
This return value was not documented and did not make any sense. There's no reason to have a special case here.
|
|\ \
| |/
|/| |
DOC: Add warning to NPV function
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The internal rate of return (irr) is defined as the rate of return
required for the net present values of a series of cashflows to be
zero. i.e the lowest rate of return required for a project to break
even.
This is currently checked by refering to the example output from
the ``irr`` and ``npv`` function documentation. This commit adds a
test to confirm the identity holds.
|
|\ \
| | |
| | | |
BUG: fix inconsistent axes ordering for axis in function `unique`
|
| | | |
|
|\ \ \
| | | |
| | | | |
BUG: Fix uint-overflow if padding with linear_ramp and negative gain
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
linspace supports non-scalar values since version 1.16. This can replace
the former _linear_ramp method.
This removes a bug in the old implementation where certain edge and
end values resulted in an integer underflow for unsigned dtypes (see
gh-14191). Protect against this regression with a new test for all
numeric dtypes.
|
|\ \ \
| | | |
| | | | |
MAINT: Fix behavior of structured_to_unstructured on non-trivial dtypes
|
| | |/
| |/|
| | |
| | | |
Fixes #13333
|
|\ \ \
| |/ / |
|
| |\ \
| | | |
| | | | |
MAINT: Clearer error message while padding with stat_length=0
|
| | |/
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Provides a clearer error message if stat_length=0 is the cause of an
exception (mean and median return nan with warnings) as well as tests
covering this behavior.
Note: This shouldn't change the behavior/API except for the content of
the raised ValueError.
|
| |/ |
|
| |\
| | |
| | | |
BUG: Fix file-like object check when saving arrays
|
| | | |
|
| |\ \
| | |/
| |/| |
BUG, DOC: add new recfunctions to `__all__`
|
| | | |
|
| | | |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When a buffer interface does not request a writeable buffer,
simply pass a read-only one when the warn on write flag is set.
This is to give an easier way forward with avoiding the deprecation
warnings: Simply do not ask for a writeable buffer.
It will break code that expects writeable buffers but does not
ask for them specifically a bit harder than would be nice.
But since such code probably should ask for it specifically, this
is likely fine (an RC release has to find out).
The main reason for this is, that this way it plays very will with
cython, which requests writeable buffers explicitly and if declared
`const` is happy about read-only (so that using `const` is the best
way to avoid the warning and makes code cleaner).
Closes gh-13929, gh-13974
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For array likes supporting UFuncs, `np.abs` would return an array-like,
and this is currently not compatible with the use of `np.piecewise`.
The simplest fix seems to be to just call asanyarray (which piecewise
calls anyway on the array) beforehand. This way we ensure the conditions
are also an array.
Fixes gh-13894
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* BUG: Fix leaking of object descriptor on dtype discovery of `None`
* BUG: Fix reference count leak in string discovery code path
* BUG: Fix two more datetime related reference count bugs
One is leaking only the python integer 1, the other a descriptor.
* BUG: Fix bugs in vectorized string functions error paths
Fixes reference count issues (a leak) in
TestVecString::test_non_existent_method and
TestVecString::test_non_string_array
* BUG: Fix Reference count leak in in128 C-level tests
* BUG: Fix refcount leak in advanced indexing error path
* BUG,MAINT: Refactor indexing dtypes handling in mapiter constructor
Using borrowed references for the dtypes seems much easier to get
the reference counts right.
* BUG: Reference leaks in deprecated datetime with timezone coercion
* BUG: Refcount issue in nonzero 0-d path
* BUG: Fix ufunc.at dtype refcount handling in resolver
* BUG: Fix reference count in nditer python op_axes setup
* BUG: Reference leak in writebackifcopy non-array error path
* BUG: Add missing DECREF in ufunc with dtype type resolution
* BUG: Reference count bugs in io functions
* BUG: Reference count loss in as_c_array C-side tests
* BUG: Leaking of method in object method based ufunc loops
The function could possibly be optimized nicely by checking
that the method will be the same because the types are identical.
OTOH, that may not be correct in dynamically adapted types.
* TST: Clean up cyclic ctypes reference to simplify leak debugging
If we do not clean it up in this test, the collection can take
so long that it affects the following tests when running with
reference leak debugging tools (pytest-leaks).
* BUG: Reference count of raw data for 0-sized unpickling
* TST: Mark tests which must leak references
It really may be time to remove this, considering how annoying this
is, may want to think about getting rid of that behaviour.
Could probably write a multiearraytests C-side function instead.
* BUG: Fix refcount leaks in arr.getield and setfield error paths
* BUG: Fix refcount issue in wheremask
This fix is not the prettiest, since it relies on the wheremask
to be formatted to boolean beforehand correctly.
* TST: Reset StringConvert after mutating it in tests
Or maybe just mark the test?
* BUG: Fix missing static for npy_cache_import in umath funcs.inc.src
* BUG: Fix refcount in multiternew error path
* BUG: Fix npy_ObjectGCD and LCM reference counting
* BUG: Decrement already wrapped outputs on failure
This is not super pretty, but not sure how to do it much better
right now.
* FIXUP: iotools StringConverter._mapper
* FIXUP: as_c_array tests
* FIXUP: String/dtype discovery comment
* FIXUP: Nonzero comment
* FIXUP: mapiternew -- check error return of dtype creation
In principle, at least at this time, this is not possible
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When the base is not an array (or generally when the flag of the base
array was toggled), it is OK to allow setting the writeable flag to
True, as long as any ancestor (especially the last one) is writeable.
This commit also slightly change the behaviour of the base attribute.
---
* ENH: Deprecate writeable broadcast_array
* ENH: Make writeable flag enabling more reliable for non-array bases
When the base is not an array (or generally when the flag of the base
array was toggled), it is OK to allow setting the writeable flag to
True, as long as any ancestor (especially the last one) is writeable.
* Update doc/release/1.17.0-notes.rst
Co-Authored-By: Sebastian Berg <sebastian@sipsolutions.net>
* Update doc/release/1.17.0-notes.rst
Co-Authored-By: Sebastian Berg <sebastian@sipsolutions.net>
* Update numpy/lib/tests/test_stride_tricks.py
Co-Authored-By: Sebastian Berg <sebastian@sipsolutions.net>
* Update numpy/core/tests/test_multiarray.py
Co-Authored-By: Sebastian Berg <sebastian@sipsolutions.net>
* DOC: improve warning (from review)
|
| |\ |
|
| | |
| | |
| | |
| | | |
Now with tests....
|
| | | |
|
| | |\
| | | |
| | | | |
DOC: Document/ Deprecate functions exposed in "numpy" namespace
|