| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |\
| |
| | |
DEP: issue deprecation warning when creating ragged array (NEP 34)
|
| | | |
|
| |/
|
|
|
| |
This argument isn't used, and is confusing. (Small test added by
seberg)
|
| |\
| |
| | |
BUG: Remove the broken clip wrapper
|
| | |
| |
| |
| |
| |
| | |
ndarray.clip is already just a wrapper for the ufunc, so there is no need to do type-specific wrapping here any more
Fixes gh-14140
|
| |/ |
|
| |\
| |
| | |
API: Make MaskedArray.mask return a view, rather than the underlying mask
|
| | |
| |
| |
| |
| |
| |
| |
| | |
This prevents consumers from reshaping the mask in place, which breaks things
As a result, `x.mask is x.mask` returns `False`, but this was already true of `x.data is x.data`.
May also be related to gh-10270
|
| |/ |
|
| | |
|
| |
|
|
|
|
|
| |
The pickle module was being imported from numpy.core.numeric. It was
defined there in order to use pickle5 when available in Python3 and
cpickle in Python2. The numpy.compat module seems a better place for
that.
|
| | |
|
| |\
| |
| | |
BUG: Make `arr.ctypes.data` hold onto a reference to the underlying array
|
| | |
| |
| |
| |
| |
| |
| |
| | |
We do this by going through ctypes.from_buffer, which keeps the object the buffer came from alive.
A bunch of hacks are required to produce a sufficiently simple buffer for ctypes to accept.
Fixes #9647
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(#12448)
* Review F401,F841,F842 flake8 errors (unused variables, imports)
* Review comments
* More tests in test_installed_npymath_ini
* Review comments
|
| | |
| |
| |
| |
| | |
This should give an empty result, not an error. The problem
was that the empty list was interpreted as a list of strings.
|
| |/
|
|
| |
Fixes #10483
|
| |
|
|
|
| |
Cover the string and numeric types. Structured types were
already covered.
|
| |
|
|
|
|
|
| |
Fixes the regression introduced by #10211 where the masked array fill
value type was not properly converted by astype.
Closes #12070.
|
| |
|
|
|
|
|
|
| |
All imports of pickle from numpy modules are now done this way:
>>> from numpy.core.numeric import pickle
Also, some loops on protocol numbers are added over pickle tests that
were not caught from #12090
|
| |
|
|
|
|
|
|
| |
After the pytest migration, test classes no longer inherit
from unittest.TestCase and and the fail method does not
exist anymore.
In all these cases, we can use assert_raises and assert_raises_regex instead
|
| | |
|
| |
|
|
|
|
|
|
|
| |
The TestMaskedArrayMethods.test_sort_flexible test was failing for for
the subarray checks on big endian systems. That was probably due to
subarrays being sorted as bytestrings. This fixes the test by simply
checking that the sort does not error rather than checking the result.
Closes #11716.
|
| |\
| |
| | |
BUG: Prevent crashes on 0-length structured void scalars
|
| | | |
|
| |/
|
|
|
|
| |
This change was introduced as part of #10232
Fixes #11112
|
| |\
| |
| | |
BUG: Ensure __array_finalize__ cannot back-mangle shape
|
| | | |
|
| | |
| |
| | |
Fixes #11021
|
| |/ |
|
| |
|
|
|
|
| |
Further progress in isolating matrix in preparation of its
deprecation. There is one place left with an explicit reference
to matrix (in MaskedArray.count), which is to be solved later.
|
| |
|
|
|
| |
That function is nose specific and has not worked since `__init__` files
were added to the tests directories.
|