summaryrefslogtreecommitdiff
path: root/numpy/ma
Commit message (Collapse)AuthorAgeFilesLines
* BUG: MaskedArray._optinfo is discarded by__eq__/__ne__ (#9540)David Schaefer2017-08-132-0/+20
|
* TST, MAINT: Add `__init__.py` files to tests directories.Charles Harris2017-08-061-0/+0
| | | | | | | | This allows pytest to run with duplicate test file names. Note that `python <path-to-test-file>` no longer works with this change, nor will a simple `pytest numpy`, because numpy is imported from the numpy repository. However, `python runtests.py` and `>>> numpy.test()` are still available.
* MAINT: Remove `level=` keyword from test arguments.Charles Harris2017-08-051-7/+5
| | | | | | I don't know what that argument was used for, but it showis up in old tests and is not explicitly used within the tests. I assume it was part of an old testing framework and is now longer needed.
* MAINT/DOC: Use builtin when np.{x} is builtins.{x}.Eric Wieser2017-08-056-48/+48
| | | | | | | 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
* MAINT: Add a common subclass to all the masked ufunc wrappersEric Wieser2017-07-241-27/+21
|
* Merge pull request #9452 from eric-wieser/new-style-classesCharles Harris2017-07-242-12/+12
|\ | | | | MAINT: Use new-style classes on 2.7
| * MAINT: Use new-style classes on 2.7Eric Wieser2017-07-242-12/+12
| | | | | | | | Deliberately avoids tests, to prevent introducing a failure on old-style classes later.
* | TST: Remove unittest dependencies in numpy/ma/tests.Charles Harris2017-07-247-594/+583
|/
* Merge pull request #9362 from charris/rearrange-testing-moduleCharles Harris2017-07-064-11/+12
|\ | | | | ENH: Rearrange testing module to isolate nose dependency.
| * MAINT: Rearrange files in numpy/testing module.Charles Harris2017-07-044-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The aim here is to separate out the nose dependent files prior to adding pytest support. This could be done by adding new files to the general numpy/testing directory, but I felt that it was to have the relevant files separated out as it makes it easier to completely remove nose dependencies when needed. Many places were accessing submodules in numpy/testing directly, and in some cases incorrectly. That presented a backwards compatibility problem. The solution adapted here is to have "dummy" files whose contents will depend on whether of not pytest is active. That way the module looks the same as before from the outside. In the case of numpy itself, direct accesses have been fixed. Having proper `__all__` lists in the submodules helped in that.
* | BUG: void masked fillvalue cannot be cast to void in python 3Eric Wieser2017-07-012-1/+6
|/
* Merge pull request #9322 from eric-wieser/ma-astypeahaldane2017-06-272-7/+12
|\ | | | | BUG: np.ma.astype fails on structured types
| * BUG: MaskedArray.astype fails for non-trivial structured typesEric Wieser2017-06-272-7/+12
| |
* | BUG: Overhaul *_fill_value functionsEric Wieser2017-06-272-82/+75
| | | | | | | | | | | | | | | | | | | | These now: * Return void scalars instead of tuples for structured dtypes * Actually accept non-trivial dtype arguments * Work for nested structured and subarray dtypes * Uniformly convert scalar types into dtypes Also fixes #9315
* | MAINT: Remove cycle between _check_fill_value and default_fill_valueEric Wieser2017-06-271-21/+17
| |
* | TST: Verify that sorting subarrays is fixedEric Wieser2017-06-271-0/+14
| | | | | | | | Tests for gh-8069
* | MAINT: Better names in ma.sort testEric Wieser2017-06-271-12/+12
| |
* | BUG: Fix gh-8069Eric Wieser2017-06-272-1/+15
| | | | | | | | Fill values were not correctly calculated for subdtypes, instead returning `None`
* | MAINT: De-duplicate ma.m(ax|in)imum_fill_valueEric Wieser2017-06-271-26/+18
|/
* Merge pull request #5580 from jakirkham/fix_masked_array_viewsCharles Harris2017-06-093-93/+105
|\ | | | | BUG, DEP: Fix masked arrays to properly edit views. ( #5558 )
| * TST: Update and add tests masked array views.John Kirkham2017-01-172-69/+104
| |
| * BUG: Share masked array views for writing.John Kirkham2017-01-171-24/+1
| |
* | BUG: KeyboardInterrupt is swallowed all over the placeEric Wieser2017-06-034-6/+6
| | | | | | | | Bare except is very rarely the right thing
* | MAINT: Simplify if statementk_kapp@yahoo.com2017-05-241-1/+1
| | | | | | | | | | | | | | | | isinstance(obj, ndarray) will return False if (obj is None) in any case, so no need to check whether (obj is not None) before it. All tests pass on my build (the most recent one at the time making this PR). However, this might have been done for backward compatibility. Will see how the CI tests do.
* | ENH: Spelling fixesVille Skyttä2017-05-094-9/+9
| |
* | Merge pull request #8421 from seberg/isnatCharles Harris2017-05-072-7/+5
|\ \ | | | | | | ENH: Add isnat function and make comparison tests NAT specific
| * | BUG: Remove warning NaT filter from masked array test utilsSebastian Berg2017-05-072-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This may show warnings in downstream projects, which should likely not be there. We could also drop in the normal assert_equal there, which would support NaT, and NaN, but checks for scalarness, which this currently does not (which also could create problems). Works around the only test with this problem, by using the normal assert_equal there.
* | | MAINT: add __doc__ to minimumEric Wieser2017-05-061-32/+8
| | | | | | | | | | | | Also, remove unecessary subclasses
* | | STY: Tabs to spacesEric Wieser2017-05-061-20/+20
| | | | | | | | | | | | Introduced by me in #8918
* | | DEP: inconsistent axis default for np.ma.maximumEric Wieser2017-05-063-14/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | This does not match np.maximum, which is confusing because the masked version has no documentation at all. This uses a similar deprecation approach to gh-8918, noting that the warning is only needed for arrays of more than one dimension. The same remarks apply to `np.ma.minimum`
* | | DEP: Deprecate single-argument np.ma.m(in|ax)imumEric Wieser2017-05-064-13/+27
| | | | | | | | | | | | | | | | | | | | | | | | This shorthand is just inconsistent with `np.maximum`, and just makes the distinction between `np.ma.max` and `np.ma.maximum` even more confusing. Also adds names to these objects, since 1) they're there in core, and 2) they make the warning message more helpful.
* | | DEP: Deprecate np.ma.MaskedArray.miniEric Wieser2017-05-061-0/+22
|/ / | | | | | | | | | | This was untested, and the documentation did not mention how it differed from `min` anyway. Fixes #8764
* | Merge pull request #8918 from eric-wieser/deprecate-ma-argsort-no-axisCharles Harris2017-05-052-4/+87
|\ \ | | | | | | DEP: deprecate calling ma.argsort without an axis
| * | DEP: deprecate calling ma.argsort without an axisEric Wieser2017-05-052-4/+87
| | | | | | | | | | | | | | | | | | Only deprecated when this would be ambiguous. Approaches #8701
* | | BUG: np.ma.mr_['r',...] does not return masked arraysEric Wieser2017-05-052-0/+14
| | |
* | | MAINT: Remove code duplicated from np.r_ in np.ma.mr_Eric Wieser2017-05-052-51/+9
|/ / | | | | | | | | 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-052-2/+50
| | | | | | | | | | | | 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: allow __array_ufunc__ = None to force binops to defer.Marten van Kerkwijk2017-04-271-6/+7
| | | | | | | | | | | | | | | | | | | | | | In previous versions, one could force ndarray binops to defer by setting a high __array_priority__. With __array_ufunc__ this gets ignored, and this commit ensures it is still possible to avoid using the standard python language feature that setting something to None means it is not implemented. In consequence, inside a ufunc, if __array_ufunc__ is None, it will be treated as if it had returned NotImplemented (leading to a TypeError if no other object had a functioning __array_ufunc__ override).
* | BUG/ENH: Switch to simplified __array_ufunc__/binop interactionNathaniel J. Smith2017-04-271-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | As per the discussion at gh-5844, and in particular https://github.com/numpy/numpy/issues/5844#issuecomment-112014014 this commit switches binop dispatch to mostly defer to ufuncs, except in some specific cases elaborated in a long comment in number.c. The basic strategy is to define a single piece of C code that knows how to handle forward binop overrides, and we put it into private/binop_override.h so that it can be accessed by both the array code in multiarray.so and the scalar code in umath.so.
* | ENH: Rename __numpy_ufunc__ to __array_ufunc__.Charles Harris2017-04-271-1/+1
| | | | | | | | | | | | | | | | The first commit in changing __numpy_ufunc__ by removing the index argument and making the out argument value always a tuple. These changes were proposed in gh-5986 and have been accepted. Renaming before further changes avoids triggering tests in scipy and astropy while keeping the numpy tests working.
* | DOC: Improve comments in ma.array.__new__Eric Wieser2017-04-191-2/+3
| |
* | TST: Add previously-missing test of __setitem__Eric Wieser2017-04-191-21/+13
| |
* | BUG: Fix __getitem__ on masked arrays containing np.ma.maskedEric Wieser2017-04-192-1/+19
| |
* | BUG: np.ma.array(masked) should not return a new MaskedConstantEric Wieser2017-04-192-3/+13
| | | | | | | | The correct behavior here is to return a new MaskedArray, because `MaskedConstant` is pretending to be a scalar
* | BUG: Correctly distinguish between 0d arrays and scalarsEric Wieser2017-04-193-19/+126
| | | | | | | | This fixes #8684
* | DOC: Fix for issues #7622 and #7914Stefan Peterson2017-04-051-2/+2
| |
* | Merge pull request #8647 from eric-wieser/np.ma.where-fixesMarten van Kerkwijk2017-04-042-33/+63
|\ \ | | | | | | Fix various bugs in np.ma.where
| * | BUG: Make np.ma.where delegate to np.whereEric Wieser2017-03-082-33/+63
| | | | | | | | | | | | | | | Fixes #8600 and #8599 Also makes np.ma.masked work with structured dtypes.
* | | MAINT: Rename _validate_axis, and document itEric Wieser2017-03-282-4/+4
| | |
* | | MAINT: Use _validate_axis inside _ureduceEric Wieser2017-03-281-1/+1
| | | | | | | | | | | | This fixes an omission where duplicate axes would only be detected when positive