summaryrefslogtreecommitdiff
path: root/numpy/ma/tests/test_subclassing.py
Commit message (Collapse)AuthorAgeFilesLines
* STY,MAINT: Run pyflakes and pep8 on numpy/ma/tests/*.Charles Harris2015-07-251-8/+7
| | | | | | | | Also fix "*" imports. The formatting of test arrays is not fixed for multiple spaces following "," and other violations that are common in tests. To be precise, E241 and E201 are added to the errors that are excluded.
* BUG Allow subclasses in MaskedArray ufuncs -- for non-ndarray _dataMarten van Kerkwijk2015-06-161-10/+30
|
* ENH: Let MaskedArray getter, setter respect baseclass overridesMarten van Kerkwijk2015-04-221-5/+88
|
* ENH: Ensure that repr and str work for MaskedArray non-ndarray basesMarten van Kerkwijk2014-04-041-0/+43
| | | | | | | | For repr, use the name of the base class in output as "masked_<name>" (with name=array for ndarray to match the previous implementation). For str, insert masked_print_option in an ndarray view of the object array that is created for string output, to avoid calling __setitem__ in the base class. Add tests to ensure this works.
* Convert docstrings to comments for nose; PEP8 cleanup (some tests activated)Marten van Kerkwijk2013-10-121-11/+23
|
* STY: Giant comma spacing fixup.Charles Harris2013-08-181-24/+24
| | | | | | | Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long and will need to be broken at some point. OTOH, some lines were already too long and need to be broken at some point. Now seems as good a time as any to do this with open PRs at a minimum.
* MAINT: Use np.errstate context manager.Charles Harris2013-07-111-4/+1
| | | | | | | | | | | | | Now that Python < 2.6 is no longer supported we can use the errstate context manager in places where constructs like ``` old = seterr(invalid='ignore') try: blah finally: seterr(**old) ``` were used.
* TST: fix some function name conflictsJulian Taylor2013-06-051-1/+1
| | | | enables a few extra tests
* 2to3: Apply `print` fixer.Charles Harris2013-04-061-1/+1
| | | | | | | Add `print_function` to all `from __future__ import ...` statements and use the python3 print function syntax everywhere. Closes #3078.
* 2to3: Use absolute imports.Charles Harris2013-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new import `absolute_import` is added the `from __future__ import` statement and The 2to3 `import` fixer is run to make the imports compatible. There are several things that need to be dealt with to make this work. 1) Files meant to be run as scripts run in a different environment than files imported as part of a package, and so changes to those files need to be skipped. The affected script files are: * all setup.py files * numpy/core/code_generators/generate_umath.py * numpy/core/code_generators/generate_numpy_api.py * numpy/core/code_generators/generate_ufunc_api.py 2) Some imported modules are not available as they are created during the build process and consequently 2to3 is unable to handle them correctly. Files that import those modules need a bit of extra work. The affected files are: * core/__init__.py, * core/numeric.py, * core/_internal.py, * core/arrayprint.py, * core/fromnumeric.py, * numpy/__init__.py, * lib/npyio.py, * lib/function_base.py, * fft/fftpack.py, * random/__init__.py Closes #3172
* 2to3: Put `from __future__ import division in every python file.Charles Harris2013-03-011-0/+3
| | | | | | | | This should be harmless, as we already are division clean. However, placement of this import takes some care. In the future a script can be used to append new features without worry, at least until such time as it exceeds a single line. Having that ability will make it easier to deal with absolute imports and printing updates.
* TST: fix two divide-by-zero test warnings.rgommers2011-03-111-2/+6
|
* DEP: Fix deprecation warnings in Python 3.1. The warnings come from the unittestCharles Harris2010-02-201-26/+26
| | | | | | | | | module. The fix should be good for Python >= 2.4 and used the following sed script: s/\<failUnless\>/assertTrue/g s/\<failIf\>/assertFalse/g s/\<failUnlessEqual\>/assertEqual/g s/\<failUnlessRaises\>/assertRaises/g
* * getdata : prevent unnecessary copies (thx to Eric Firing)pierregm2009-05-131-3/+25
| | | | | * _Domained/MaskedUnary/BinaryOperations: optimization by preventing the use of np.where and the calculation of domain. Here's the catch: we're basically cheating. We force np.seterr(divide='ignore',invalid='ignore') before computing the results, then mask the invalid values (if any) and reset the corresponding entries in .data to the input. Finally, we reset the error status. This playing around with the error status may (or may not) fail in multi-thread. It's still faaar faster than computing the domain (especially _DomainSafeDivide) when the inputs are large...
* ran reindentJarrod Millman2008-12-311-2/+0
|
* core : * fixed make_mask_descr to recognize subdtypes pierregm2008-10-181-21/+1
| | | | | | | | | : * fixed some corner cases of view mrecords : * fixed view : * got rid of _fieldmask for _mask : * WARNING: setting ._mask no longer calls __setmask__ : BE CAREFUL. : * prevent setting ._mask directly, as it screws up things: use .mask instead test_subclassing : * clean up
* replaced assert with self.failUnlesspierregm2008-09-291-30/+30
|
* Removed unused imports.Alan McIntyre2008-09-091-2/+0
|
* Standardize NumPy import as "import numpy as np".Alan McIntyre2008-07-221-13/+13
|
* Restore old test framework classes.Alan McIntyre2008-06-211-1/+1
| | | | | | | | | | | Added numpy.testing.run_module_suite to simplify "if __name__ == '__main__'" boilerplate code in test modules. Removed numpy/testing/pkgtester.py since it just consisted of an import statement after porting SciPy r4424. Allow numpy.*.test() to accept the old keyword arguments (but issue a deprecation warning when old arguments are seen). numpy.*.test() returns a test result object as before. Fixed typo in distutils doc.
* Switched to use nose to run tests. Added test and bench functions to all ↵Alan McIntyre2008-06-171-15/+11
| | | | modules.
* core : clean up update_frompierregm2008-05-011-1/+1
|
* Move ma to numpy root. Fix unit tests. Remove references to numpy.core.ma.Stefan van der Walt2007-12-151-0/+183