| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
| |
This test makes sure that a MaskedArray defers properly to another
class if it doesn't know how to handle it. See #15200.
|
| |
|
|
|
|
|
| |
This test makes sure that a MaskedArray defers properly to another
class if it doesn't know how to handle it. See #15200.
|
|
|
|
|
| |
This helps subclasses, who can now do super() in their own
implementation.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
That function is nose specific and has not worked since `__init__` files
were added to the tests directories.
|
|
|
|
|
|
|
|
|
|
|
| |
Use standard pytest markers everywhere in the numpy tests. At this point
there should be no nose dependency. However, nose is required to test
the legacy decorators if so desired.
At this point, numpy test cannot be run in the way with runtests, rather
installed numpy can be tested with `pytest --pyargs numpy` as long as
that is not run from the repo. Run it from the tools directory or some
such.
|
|
|
|
|
|
|
| |
* Commas are now used within data and mask
* dtypes are shown for float32, int8 etc, where they previously weren't
* Wrapped fields are now correctly indented
* Spaces removed around = to match PEP8
|
| |
|
| |
|
|
|
|
| |
This fixes #8684
|
|
|
|
|
|
| |
When python is invoked with switch -3, it emits waring "classic int division"
for strict integer divisions. The same behavior is now implemented to numpy
with this fix
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
enables a few extra tests
|
|
|
|
|
|
|
| |
Add `print_function` to all `from __future__ import ...` statements
and use the python3 print function syntax everywhere.
Closes #3078.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
* _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...
|
| |
|
|
|
|
|
|
|
|
|
| |
: * 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
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
modules.
|
| |
|
|
|