| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
|
| |
| |
| |
| |
| | |
There is no point in catching the warnigns when raising will do
(because we want 0 warnings). That is more informative in any case.
|
| |
| |
| |
| |
| |
| | |
The test used unintialized values, if NaN happened to be there
the test would fail (and generally, uninitialized values being used
in tests is bad, since it shows up in valgrind).
|
|\ \
| | |
| | | |
ENH: add ndenumerate specialization for masked arrays
|
| | | |
|
| | | |
|
|/ / |
|
| |
| |
| |
| |
| | |
This helps subclasses, who can now do super() in their own
implementation.
|
|\ \
| | |
| | | |
BUG: fix `ma.average` not working well with `nan` weights
|
| | |
| | |
| | |
| | | |
If a weight is nan it behaves erratically. See the tests added.
|
|/ /
| |
| |
| |
| |
| | |
radix sort operates on unsigned types, but the key extractor needs to know the
original type.
Fix #20567
|
|/
|
|
|
|
|
|
|
|
|
|
| |
* REV: Add MaskedArray creation from non nd-array back in
This code path was removed in beacb39. This adds back in the
MaskedArray portion of that commit. A test with a Quantity-like
(non inherited, but still acts like a MaskedArray) class for
this case.
* Update numpy/ma/core.py
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
|
|\
| |
| | |
DOC: replace return type in np.ma.* docstring
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
By keeping both variants of the keyowrd parameter, we achieve backwards
compatibility. The old mispelled variant has been removed from the
documentation, the new variant does appear in the documentation and
using noth variants raises a TypeError.
Additionally, the old variant can only be used as a keyword argument,
not as a positional argument.
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
|
| |
| |
| |
| |
| | |
Revert delimitor -> delimiter as the parameter name is part of the
public API. We'll find a different solution to fix that.
|
|/ |
|
|
|
|
|
| |
properly when indx was itself a masked_array instance.
Closes #19721. See #19244 for context.
|
|\
| |
| | |
BUG: Fix an issue wherein assigment to `np.ma.masked_array` ignores mask in index
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Promotion errors are currently ignored and instead we use `object`
as dtype. This means that the FutureWarning is ignored when raised.
It also means that there is no way to opt into "future" behaviour,
although arguably, we may want to force `dtype=object` in any case
if a promotion error occurred (or some signal at least).
Closes gh-18721
Addresses gh-18425 (Does not actually fix it, but chances are we won't)
|
|
|
|
|
| |
Closes #10438
Co-authored-by: mecopur <mecopur@outlook.com>
|
|
|
|
|
| |
Fixes gh-18946
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
There was a regression here due to force casting to bool, but if that
happens to fail (it does, but should not for strings). The mask
would just be dropped.
Of course masked arrays are held together by faith here, but its
a regression.
Closes gh-18551
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Disallowing timedelta64+float promotion (to timedelta64) in all cases
(previously it was assymetric and "half allowed") meant that isclose,
allclose, np.ma.allclose, and assert_arrays_almost_equal (which uses
isclose), would stop work for timedelta64. Hardcoding that timedelta64
is passed on unmodified retains the old behaviour.
It may make sense to deprecate or change this behaviour in the future,
but for the 1.20 release, the behaviour should be as much unmodified
as possible.
Closes gh-18286
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `__new__` method of `MaskedArray` has the parameter `**options`,
but it is not used. This means a mistyped parameter is silently ignored,
e.g. if I mistype the `mask` parameter like this, I don't get an error:
In [2]: m = np.ma.MaskedArray([1, 2, 3], maks=[0, 1, 0])
In [3]: m
Out[3]:
masked_array(data=[1, 2, 3],
mask=False,
fill_value=999999)
In this PR, I simply remove `**options` from the signature of
`MaskedArray.__new__`. This affected one test. That test was passing the
argument `shape=(0, 1, 2)` to the constructor of a subclass of `MaskedArray`,
but since any unknown keywords were silently ignored, that use of `shape` had
no effect. I replaced it with the positional argument `[[[]], [[]]]`, which
I believe has the effect that was originally intended with the use of the
`shape` argument.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Conversion of some strings to fstrings
* Remove spaces
* Update numpy/ma/mrecords.py
Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
* Update numpy/ma/tests/test_old_ma.py
Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
* Update numpy/ma/timer_comparison.py
Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
Co-authored-by: Jakob <jakobjakobson13@posteo.de>
Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
|
| |
|
| |
|
|
|
| |
* fix np.ma.core.doc_note
|
|
|
|
|
|
|
|
|
| |
Fix for issue gh-15077. ma.core now checks and sets max and min
values for all float and complex dtypes. This fixes the max of a
masked array with a float16 or complex dtype returning inf
Builds on top of gh-15086.
Co-authored-by: William Jones <william.jones@physics.ox.ac.uk>
|
|
|
|
|
|
| |
* BUG: fix AttributeError on accessing object in nested MaskedArray
Co-authored-by: Rena Xu <renaxu@Renas-MacBook-Pro.local>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: vagrant <vagrant@vagrant.vm>
|
|\
| |
| | |
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).
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
| |
Fix and test conversion of masked element to string in fstring / string interpolation. See PEP 498 for string interpolation (aka fstrings) in Python 3.6 and above.
Fixes #15409.
Original PR gh-15410 by: Stefan Codrescu <ssmmcc1@gmail.com>
Co-authored-by: Stefan Codrescu <ssmmcc1@gmail.com>
Co-authored-by: Stefan <5tefan@users.noreply.github.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
|
| |
|
|
|
|
| |
This implements NEP 34.
|
| |
|
|
|
|
|
|
|
| |
Inheriting from object was necessary for Python 2 compatibility to use
new-style classes. In Python 3, this is unnecessary as there are no
old-style classes.
Dropping the object is more idiomatic Python.
|
|
|
|
|
| |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|