| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
assert in non-testing files that should be checked for correctness.
|
| |
|
|
|
|
|
|
|
|
|
| |
Since CopyInto uses the dtype transfer mechanism to do the copying,
this also fully handles casting. This also exposed a byte order issue
in the dtype transfer code of converting to object arrays.
The switch from position-based structure copying to name-based copying
required a small change to a masked array test as well.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* assert_equal : use assert_equal_array on records
* assert_array_compare : prevent the common mask to be back-propagated to the initial input arrays.
* assert_equal_array : use operator.__eq__ instead of ma.equal
* assert_equal_less: use operator.__less__ instead of ma.less
core:
* Fixed _check_fill_value for nested flexible types
* Add a ndtype option to _make_mask_descr
* Fixed mask_or for nested flexible types
* Fixed the printing of masked arrays w/ flexible types.
|
|
|
|
|
|
| |
assert_array_compare : make sure that the comparison is performed on ndarrays, and make sure we use the np version of the comparison function.
core:
* Try not to touch the data in unary/binary ufuncs, (including inplace)
|
| |
|
|
|
|
| |
Standardize NumPy import as "import numpy as np".
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* improved check on object/record arrays
core
* fixed filled for flexible types
* fixed the definition of the mask for flexible types
mrecords:
* fixed a bug w/ titles/formats in __new__ and __array_finalize__
|
|
|
|
| |
._update_from instead
|
|
|
|
| |
modules.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* use the "import numpy as np" convention
* use np.function instead of (from)numeric.function
* CHANGE : when using named fields, the fill_value is now a void-ndarray (and no longer a tuple)
* _check_fill_value now checks that an existing fill_value is compatible with a new dtype (bug #806)
* fix_invalid now accepts the mask keyword
* MaskedArray.__new__ doesn't run _check_fill_value when the fill_value is None
* add the astype method, to support the conversion of fill_value when needed.
* arange/empty/empty_like/ones/zeros are now available through _convert2ma
test_core:
* modified test_filled_value to reflect that fill_value is a void-ndrecord when using named fields
* added test_check_fill_value/test_check_fill_value_with_records
testutils:
* use the "import numpy as np" convention
* assert_equal_records now uses getitem instead of getattr
* assert_array_compare now calls numpy.testing.utils.assert_array_compare on filled data
* the assert_xxx functions now accept the verbose keyword
mrecords:
* MaskedRecords inherit get_fill_value and set_fill_value from MaskedArray
* In filled, force the filling value to be a void-ndarray
|
| |
|
|
|
|
|
|
| |
testutils : introduced assert_almost_equal/assert_approx_equal:
use assert_almost_equal(a,b,decimal) to compare a and b up to decimal places
use assert_approx_equal(a,b,decimal) to compare a and b up to b*10.**-decimal
|
| |
|
| |
|
|
|