summaryrefslogtreecommitdiff
path: root/numpy/ma
Commit message (Collapse)AuthorAgeFilesLines
* BUG: Allow unmodified use of isclose, allclose, etc. with timedeltaSebastian Berg2021-02-042-3/+15
| | | | | | | | | | | | | | 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: Add missing `__all__` annotationsBas van Beek2021-02-011-1/+3
|
* DOC: more mist fixes of syntax.Matthias Bussonnier2021-01-282-8/+7
| | | | | Space before colon, or missing colon in see-also, typo in parameter names, casing in See Also.
* DOC: Avoid using "set of" when talking about an ordered list.Antony Lee2020-12-292-3/+3
| | | | | | | | | | | | ... or when the input isn't/cannot be a set. I left a few usages, e.g. in random sampling, where "set" is reasonable as informal description of an array as the order doesn't matter; however, for e.g. np.gradient the order of the returned list is clearly important, so "set" is wrong. Also some other minor doc edits noticed during the grepping: using `shape` instead of `form` in `cov` is consistent with most other places; the wording in `Polynomial.trim` now matches other methods on the same class.
* Merge pull request #17955 from Carreau/fix-17944Charles Harris2020-12-111-7/+7
|\ | | | | DOC: Replace {var} in docstrings type annotation with `scalar or None`.
| * [DOC] Replace {var} in docstrings type annotation with `scalar or None`.Matthias Bussonnier2020-12-071-7/+7
| | | | | | | | Closes #17944
* | TST: Do not disable errors globally in ma/timer_comparison.pySebastian Berg2020-12-081-3/+10
|/ | | | | | | | | This script is meant to be run stand-alone (and should probably just not be at this place), but moving these down is cleaner in any case. The issue is that our "public API" tests import the module and then modify the global state.
* MAINT: ma: Remove unused `**options` from MaskedArray `__new__` method.Warren Weckesser2020-11-082-3/+7
| | | | | | | | | | | | | | | | | | | | | | 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.
* DOC: Fixuptakanori-pskq2020-11-051-2/+2
|
* DOC: Prepend `ma.`takanori-pskq2020-11-041-12/+14
|
* BUG: Fixed an issue where `.pyi` weren't picked up by numpy sub-packagesBas van Beek2020-11-031-0/+1
|
* MAINT: Conversion of some strings to fstrings, part III (#17623)jakobjakobson132020-10-257-38/+37
| | | | | | | | | | | | | | | | | | | | * 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>
* DOC: Fixing references in ma docstrings (#16300)Takanori H2020-10-072-5/+5
| | | Fix broken links in see also section of some ma functions.
* MAINT: Chaining exception in numpy\numpy\ma\mrecords.py (#17438)Ashutosh singh2020-10-071-2/+2
| | | * fix runF2c exception
* fix: chains nested try-except-raiseJovial Joe Jayarson2020-10-021-4/+4
|
* DOC: Fix syntax errors in docstrings for versionchanged, versionadded (#17338)Bradley Dice2020-09-171-1/+1
| | | * DOC: Fix typos in versionchanged.
* Merge pull request #17104 from BvB93/sub-modulesCharles Harris2020-09-071-0/+225
|\ | | | | ENH: Add placeholder stubs for all sub-modules
| * ENH: Replace module-level `__getattr__` with explicitly defined objectsBas van Beek2020-08-191-2/+223
| |
| * ENH: Add placeholder stubs for all sub-modulesBas van Beek2020-08-191-0/+4
| |
* | MAINT: Remove old sys.version_info codeHugo2020-09-031-2/+0
| |
* | MAINT: changed ValueError line 103 in file timer_comparisonkaran-dhir2020-08-211-2/+2
|/
* MAINT: Undo change of how 0-D array-likes are handled as scalarsSebastian Berg2020-07-081-0/+11
|
* DOC: Fix malformed docstrings in ma. (#16296)Takanori H2020-06-111-8/+3
| | | | | | * DOC: fixing malformed documents Co-authored-by: Ross Barnowski <rossbar@berkeley.edu> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* DOC: Fix ``np.ma.core.doc_note`` (#16311)Takanori H2020-06-092-11/+35
| | | * fix np.ma.core.doc_note
* Merge pull request #16240 from WarrenWeckesser/ptp-warningMatti Picus2020-05-151-0/+47
|\ | | | | DOC: Warn about behavior of ptp with signed integers.
| * DOC: Warn about behavior of ptp with signed integers.Warren Weckesser2020-05-151-0/+47
| | | | | | | | | | | | | | | | | | | | * Add a warning to the docstrings of numpy.ma.MaskedArray.ptp and numpy.ptp about a problem with signed integer arrays. * Add an example to the the docstring of numpy.ptp that demonstrates the issue and suggests a work-around. * Add an "Examples" section to the docstring of MaskedArray.ptp which includes the new example added to the docstring of numpy.ptp. * Make the numbers in the basic example more interesting.
* | BUG: max/min of a masked array dtype fix (gh-15991)Rakesh Vasudevan2020-05-142-5/+50
|/ | | | | | | | | 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>
* Mark tests as a subpackage rather than data.Hameer Abbasi2020-05-061-1/+1
|
* MAINT: Chain exceptions in memmap.py and core.py (#16067)Chris Holland2020-05-011-2/+4
| | | | | * Improve chained exception reporting Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* BUG: fix AttributeError on accessing object in nested MaskedArray. (#15949)RenaRuirui2020-04-252-2/+31
| | | | | | * 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>
* DOC: Add missing bracket (gh-16051)Chunlin2020-04-251-1/+1
| | | Add missing closing brackets, script to generate the list in the PR gh-16051.
* DOC:Fix method documentation of function sort()vrakesh2020-04-161-2/+12
|
* Merge pull request #15749 from panpiort8/masked_array_docsMatti Picus2020-04-041-0/+46
|\ | | | | DOC: document inconsistency between the shape of data and mask in numpy.ma
| * DOC: document inconsistent mask results in MaskedArrayPan Jan2020-03-261-0/+46
| | | | | | | | Co-Authored-By: Tianxiang “Ronnie” Gao <tienhsiangkao@tamu.edu>
* | Merge pull request #15867 from eric-wieser/deprecate-tostringMatti Picus2020-04-012-5/+12
|\ \ | | | | | | DEP: Deprecate ndarray.tostring()
| * | DEP: Deprecate ndarray.tostring()Eric Wieser2020-03-302-5/+12
| |/ | | | | | | 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-012-4/+0
| |
* | MAINT: simplify code that assumes str/unicode and int/long are different ↵Eric Wieser2020-03-261-11/+0
| | | | | | | | | | types (#15816) Cleanup from the dropping of python 2
* | BUG: Add basic __format__ for masked element to fix incorrect print (#15794)Warren Weckesser2020-03-242-0/+30
|/ | | | | | | | | | | | 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>
* convert shebang from python to python3 (#15687)Changqing Li2020-03-042-2/+2
| | | | Signed-off-by: Changqing Li <changqing.li@windriver.com>
* MAINT: cleanup unused imports; avoid redefinition of importsMike Taves2020-02-061-1/+0
| | | | | | | * Cleanup unused imports (F401) of mostly standard Python modules, or some internal but unlikely referenced modules * Where internal imports are potentially used, mark with noqa * Avoid redefinition of imports (F811)
* MAINT: Remove sys.version checks (gh-#15373)Seth Troisi2020-01-281-5/+0
| | | More sys.version cleanup.
* STY: use 'yield from <expr>' for simple cases (#15444)Mike Taves2020-01-271-6/+3
| | | | | | | | | This PR uses simple cases of PEP 380 to rewrite: for v in g: yield v into: yield from <expr>
* Update core.py with f-strings (issue #15420)Anthony2020-01-261-2/+5
| | | Corrected past shortcomings
* Update core.pyAnthony2020-01-261-27/+16
| | | Replace old strings format to fstrings
* MAINT: Remove Python2 workaroundsSeth Troisi2020-01-231-4/+20
|
* MAINT: Replace basestring with str.Charles Harris2020-01-232-8/+7
| | | | | | | This replaces basestring with str except in - tools/npy_tempita/ - numpy/compat/py3k.py
* MAINT: Python2 CleanupsSeth Troisi2020-01-211-1/+1
|
* NEP: issue deprecation warning when creating ragged array (NEP 34)Matti Picus2020-01-212-3/+3
| | | | This implements NEP 34.
* [MAINT] Cleanup python2 sys.version checksSeth Troisi2020-01-201-9/+1
|