summaryrefslogtreecommitdiff
path: root/numpy/ma/tests
Commit message (Collapse)AuthorAgeFilesLines
...
| * BUG: change `ma.mean` dtype to be consistent with `np.mean`Kinshuk Dua2022-01-271-0/+6
| |
* | TST,MAINT: Simplify warning testing in masked arraysSebastian Berg2022-05-271-36/+18
| | | | | | | | | | There is no point in catching the warnigns when raising will do (because we want 0 warnings). That is more informative in any case.
* | TST: Fix uninitialized value in masked ndenumerate testSebastian Berg2022-05-121-1/+1
| | | | | | | | | | | | 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).
* | Merge pull request #20020 from joukewitteveen/ma-ndenumerateMatti Picus2022-05-111-1/+39
|\ \ | | | | | | ENH: add ndenumerate specialization for masked arrays
| * | ENH: Add compressed= argument to ma.ndenumerateJouke Witteveen2022-05-101-0/+9
| | |
| * | ENH: add ndenumerate specialization for masked arraysJouke Witteveen2022-04-221-1/+30
| | |
* | | ENH: Add 'keepdims' to 'average()' and 'ma.average()'.warren2022-05-091-2/+25
|/ /
* | ENH: Let ndarray.__array_finalize__ be callable.Marten van Kerkwijk2022-01-081-3/+2
| | | | | | | | | | This helps subclasses, who can now do super() in their own implementation.
* | Merge pull request #20505 from scratchmex/ma_averageMatti Picus2021-12-241-0/+25
|\ \ | | | | | | BUG: fix `ma.average` not working well with `nan` weights
| * | BUG: fix `ma.average` not working well with nan weightsIvan Gonzalez2021-12-021-0/+25
| | | | | | | | | | | | If a weight is nan it behaves erratically. See the tests added.
* | | Fix sorting of int8/int16serge-sans-paille2021-12-121-0/+4
|/ / | | | | | | | | | | 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 (#20386)Greg Lucas2021-11-161-0/+42
|/ | | | | | | | | | | | * 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>
* Merge pull request #19899 from arunppsg/issue16751_add_note_to_docsMelissa Weber Mendonça2021-10-011-3/+47
|\ | | | | DOC: replace return type in np.ma.* docstring
| * TST: added tests for np.ma.ones and np.ma.zerosArun2021-09-221-3/+47
| |
* | MAINT: Fix typo in public APIDimitri Papadopoulos2021-09-282-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | REV: 8396026Dimitri Papadopoulos2021-09-281-1/+1
| | | | | | | | | | Revert delimitor -> delimiter as the parameter name is part of the public API. We'll find a different solution to fix that.
* | DOC: Typos found by codespellDimitri Papadopoulos2021-09-212-7/+7
|/
* BUG: fix a regression where a masked_array's mask wouldn't updateClément Robert2021-08-241-0/+9
| | | | | properly when indx was itself a masked_array instance. Closes #19721. See #19244 for context.
* Merge pull request #19244 from iameskild/fix_18951Matti Picus2021-08-131-0/+7
|\ | | | | BUG: Fix an issue wherein assigment to `np.ma.masked_array` ignores mask in index
| * Fix lint E225 complaintiameskild2021-06-141-1/+1
| |
| * added tests for 18951 fixImenRajhi2021-06-141-0/+7
| |
| * added tests for 18951 fixImenRajhi2021-06-141-7/+0
| |
| * added a test for condition assignment for masked arraysImenRajhi2021-06-121-0/+7
| |
* | BUG: fix np.ma.MaskedArray.anom when input is masked (#19023)Constanza2021-06-271-0/+24
| |
* | BUG, TST: Determine complex types using typecodesGanesh Kathiresan2021-05-301-2/+2
| |
* | TST: Changed TC to check for `TypeError` in floor divideGanesh Kathiresan2021-05-291-15/+27
|/
* DEP: Ensure the string promotion FutureWarning is raisedSebastian Berg2021-05-121-1/+1
| | | | | | | | | | | | 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)
* BUG: fixed ma.average ignoring masked weights (#18960)Laura Martens2021-05-121-0/+17
| | | | | Closes #10438 Co-authored-by: mecopur <mecopur@outlook.com>
* BUG: fix np.ma.masked_where(copy=False) when input has no mask (#18967)Constanza2021-05-101-1/+10
| | | | | Fixes gh-18946
* MAINT: use super() as described by PEP 3135Mike Taves2021-03-191-10/+8
|
* Update numpy/ma/tests/test_core.pySebastian Berg2021-03-131-1/+1
|
* Apply suggestions from code reviewSebastian Berg2021-03-121-1/+2
|
* BUG: Fix ma coercion list-of-ma-arrays if they do not cast to boolSebastian Berg2021-03-121-0/+19
| | | | | | | | | | | 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
* BUG: Allow unmodified use of isclose, allclose, etc. with timedeltaSebastian Berg2021-02-041-0/+7
| | | | | | | | | | | | | | 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
* MAINT: ma: Remove unused `**options` from MaskedArray `__new__` method.Warren Weckesser2020-11-081-2/+6
| | | | | | | | | | | | | | | | | | | | | | 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.
* MAINT: Conversion of some strings to fstrings, part III (#17623)jakobjakobson132020-10-253-17/+17
| | | | | | | | | | | | | | | | | | | | * 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>
* MAINT: Remove old sys.version_info codeHugo2020-09-031-2/+0
|
* MAINT: Undo change of how 0-D array-likes are handled as scalarsSebastian Berg2020-07-081-0/+11
|
* DOC: Fix ``np.ma.core.doc_note`` (#16311)Takanori H2020-06-091-2/+32
| | | * fix np.ma.core.doc_note
* BUG: max/min of a masked array dtype fix (gh-15991)Rakesh Vasudevan2020-05-141-0/+42
| | | | | | | | | 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. (#15949)RenaRuirui2020-04-251-0/+22
| | | | | | * 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>
* Merge pull request #15867 from eric-wieser/deprecate-tostringMatti Picus2020-04-011-2/+2
|\ | | | | DEP: Deprecate ndarray.tostring()
| * DEP: Deprecate ndarray.tostring()Eric Wieser2020-03-301-2/+2
| | | | | | | | The corresponding `array.array.tostring()` in the standard library has been deprecated in favor of `tobytes` since Python 3.1 (python/cpython@1ce3eb5c5b4830e69b21865e2d723e22749544e0).
* | MAINT: Clean-up 'next = __next__' used for Python 2 compatibilityMike Taves2020-04-011-2/+0
| |
* | BUG: Add basic __format__ for masked element to fix incorrect print (#15794)Warren Weckesser2020-03-241-0/+15
|/ | | | | | | | | | | | 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>
* MAINT: Remove Python2 workaroundsSeth Troisi2020-01-231-4/+20
|
* NEP: issue deprecation warning when creating ragged array (NEP 34)Matti Picus2020-01-211-1/+1
| | | | This implements NEP 34.
* MAINT: Remove sys.version checks in testsSeth Troisi2020-01-151-5/+0
|
* MAINT: Remove implicit inheritance from object class (#15236)Jon Dufresne2020-01-057-43/+43
| | | | | | | 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.
* MAINT: Remove unnecessary 'from __future__ import ...' statementsJon Dufresne2020-01-037-14/+0
| | | | | As numpy is Python 3 only, these import statements are now unnecessary and don't alter runtime behavior.