summaryrefslogtreecommitdiff
path: root/numpy/ma/tests/test_extras.py
Commit message (Collapse)AuthorAgeFilesLines
* ENH: fix formatyuki2023-03-221-12/+24
|
* add support for non-2d arraysyuki2023-03-031-0/+29
|
* DEP: deprecate `np.round_`Ralf Gommers2023-02-281-2/+2
| | | | Closes gh-22617
* BUG: `keepdims=True` is ignored if `out` is not `None` in `numpy.median()`, ↵Roy Smart2022-12-051-0/+29
| | | | | | `numpy.percentile()`, and `numpy.quantile()`. Closes #22714, #22544.
* TST,MAINT: Replace most `setup` with `setup_method` (also teardown)Sebastian Berg2022-10-271-2/+2
| | | | | | | | In some cases, the replacement is clearly not what is intended, in those (where setup was called explicitly), I mostly renamed `setup` to `_setup`. The `test_ccompile_opt` is a bit confusing, so left it right now (this will probably fail)
* Revert "BUG: Fix masked median multiple masked arrays (#21999)"mattip2022-07-201-19/+0
| | | | This reverts commit 6b8d55e66e532d66e1701ad039b4cda306839b3f.
* BUG: Fix masked median multiple masked arrays (#21999)Brigitta Sipőcz2022-07-171-0/+19
| | | | | | | Fixed issue that occurs when trying to take the median of a list of masked arrays. Added a check to see if the input is a list then converts to a masked array. See issue #10757 for more information. Co-authored-by: jsclose <jsclose@umich.edu>
* BUG: Use `keepdims` during normalization in `np.average` and `np.ma.average` ↵Srimukh Sripada2022-06-261-0/+9
| | | | | | | | | (#21851) The keepdims flag needs to be applied during the calculation of the sum of the weights in np.average and np.ma.average. Not passing it causes weights to broadcast incorrectly. Fixes #21850
* 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
|/
* 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.
* 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 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>
* MAINT: Remove implicit inheritance from object class (#15236)Jon Dufresne2020-01-051-14/+14
| | | | | | | 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-031-2/+0
| | | | | As numpy is Python 3 only, these import statements are now unnecessary and don't alter runtime behavior.
* DEP: Deprecate the axis argument to masked_rows and masked_colsEric Wieser2019-12-021-0/+13
| | | | | This argument isn't used, and is confusing. (Small test added by seberg)
* MAINT: Replace integers in places where booleans are expectedMSeifert042019-07-011-6/+6
|
* ENH: remove "Invalid value" warnings from median, percentilemattip2019-01-061-65/+42
|
* MAINT: Review F401,F841,F842 flake8 errors (unused variables and imports) ↵Roman Yurchak2018-12-061-3/+2
| | | | | | | | | | | | (#12448) * Review F401,F841,F842 flake8 errors (unused variables, imports) * Review comments * More tests in test_installed_npymath_ini * Review comments
* MAINT: move remaining MaskedArray matrix tests to matrixlib.Marten van Kerkwijk2018-05-221-15/+0
|
* MAINT: move all masked array matrix tests to matrixlib.Marten van Kerkwijk2018-04-271-0/+3
| | | | | | 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.
* MAINT: Remove all uses of run_module_suite.Charles Harris2018-04-061-5/+1
| | | | | That function is nose specific and has not worked since `__init__` files were added to the tests directories.
* BUG: Always return a list from np.ma.flatnotmasked_contiguousEric Wieser2018-03-251-4/+7
| | | | | | | | | | | | | Depending on the input, this would return: * A single slice, if mask=nomask * A list of slices, if mask is an array * None, if mask is fully masked The documented return value is a list, and all downstream callers of this function end up having to correct for it not being one. This affects the result of np.ma.notmasked_contiguous, which also did not document these unusual return values.
* TST: simplify test of notmasked_contiguousEric Wieser2018-03-251-13/+22
|
* STY: Break some long lines.Charles Harris2018-01-181-1/+2
| | | [ci skip]
* ref to issue in numpy.maAnas Khan2018-01-101-0/+1
|
* adding new tests for union1dAnas Khan2018-01-091-0/+6
|
* ENH: added masked version of 'numpy.stack' with tests.lzkelley2017-12-171-1/+83
| | | | | Uses '_fromnxfunction_seq' just like 'vstack', 'hstack', etc. Added release note to 1.15.0.
* ENH: Allow np.r_ to accept 0d arraysEric Wieser2017-12-111-0/+9
| | | | Fixes gh-9233
* MAINT/DOC: Use builtin when np.{x} is builtins.{x}.Eric Wieser2017-08-051-2/+2
| | | | | | | This is the case for x in {int, bool, str, float, complex, object}. Using the np.{x} version is deceptive as it suggests that there is a difference. This change doesn't affect any external behaviour. The `long` type is missing in python 3, so np.long is still useful
* TST: Remove unittest dependencies in numpy/ma/tests.Charles Harris2017-07-241-34/+33
|
* BUG: KeyboardInterrupt is swallowed all over the placeEric Wieser2017-06-031-1/+1
| | | | Bare except is very rarely the right thing
* BUG: np.ma.mr_['r',...] does not return masked arraysEric Wieser2017-05-051-0/+10
|
* MAINT: Remove code duplicated from np.r_ in np.ma.mr_Eric Wieser2017-05-051-1/+4
| | | | | Also adds a test for the disabled-by-design behaviour - this would return raw matrices, not masked arrays
* ENH: Add isin, genereralizing in1d to ND arrays (#8423)B R S Recht2017-05-051-1/+22
| | | | | | This fixes gh-8331 Also update the docs for arraysetops to remove the outdated "1D" from the description, which was already incorrect for np.unique.
* MAINT: Use _validate_axis inside _ureduceEric Wieser2017-03-281-1/+1
| | | | This fixes an omission where duplicate axes would only be detected when positive
* BUG: fix ma.median for empty ndarraysJulian Taylor2017-02-271-3/+3
| | | | | return nan as it did in 1.11 and same as normal median. closes gh-8703
* MAINT: Remove __setslice__ and __getslice__Eric Wieser2017-02-091-5/+0
| | | | | This code was only here for Python 2.5 compatibility, but numpy requires 2.7 at minimum
* BUG: fix wrong masked median for some special casesJulian Taylor2017-01-171-0/+22
| | | | | | | the masked nans which are equivalent to valid infs must be replaced with infs earlier otherwise the inf is lost in the masked sum of the low and high part. Closes gh-8487
* TST: extend ma.median testing and fix inconsistent out returnJulian Taylor2016-12-251-10/+59
|
* BUG: fixed failure of np.ma.median for 1-D even arrays.Marten van Kerkwijk2016-12-231-2/+6
| | | | | | For such arrays, the sum of the two entries closest to the middle was not divided by 2. Now fixed, with test cases adapted to ensure this stays OK.
* BUG: handle unmasked NaN in ma.median like normal medianJulian Taylor2016-12-121-0/+186
| | | | | | | | | | | This requires to base masked median on sort(endwith=False) as we need to distinguish Inf and NaN. Using Inf as filler element of the sort does not work as then the mask is not guaranteed to be at the end. Closes gh-8340 Also fixed 1d ma.median not handling np.inf correctly, the nd variant was ok.
* BUG: fix np.ma.median with only one non-masked valueLoïc Estève2016-09-071-0/+9
| | | | and an axis argument. Add test.
* TST: Add ma.median tests for valid axis.Charles Harris2016-09-051-0/+32
|
* MAINT: Spell out with and without in ma test functionsSebastian Berg2016-09-021-8/+8
| | | | they used to be called `..._w_...` and `..._wo_...`.
* TST: Use new warnings context manager in all testsSebastian Berg2016-09-021-21/+15
| | | | | | | | In some places, just remove aparently unnecessary filters. After this, all cases of ignore filters should be removed from the tests, making testing (even multiple runs) normally fully predictable.
* BUG: Fixed masked array behavior for scalar inputs to np.ma.atleast_*dJoseph Fox-Rabinovitz2016-08-241-5/+30
|