| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TST: added test for issue #18684
ENH: f2py opens files with correct encoding, fixes #635
TST: added test for issue #6308
TST: added test for issue #4519
TST: added test for issue #3425
ENH: Implement user-defined hooks support for post-processing f2py data structure. Implement character BC hook.
ENH: Add support for detecting utf-16 and utf-32 encodings.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* DEP: remove NPY_ARRAY_UPDATEIFCOPY, deprecated in 1.14
* remove more UPDATEIFCOPY
* typo: add missing comma
* remove a few more UPDATEIFCOPY
* Add release note
* remove UPDATEIFCOPY from comment (from review)
|
|
|
|
| |
Co-authored-by: Melissa Weber Mendonça <melissawm@gmail.com>
|
|
|
|
| |
Co-authored-by: Pearu Peterson <pearu.peterson@gmail.com>
|
|
|
|
| |
Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
|
| |
|
|
|
|
| |
LONGDOUBLE is an alias for DOUBLE on this platform.
|
| |
|
|
|
|
|
|
| |
* DEP: Deprecate `data_type.dtype` if attribute is not already a dtype
After the deprecation, a recursive lookup for `.dtype` will not be
possible, since `.dtype` has to be a dtype instance.
|
|
|
|
|
|
|
| |
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.
|
| |
|
|\
| |
| | |
TST: Parametrize f2py tests.
|
| |
| |
| |
| |
| | |
This allows to parametrize the entire class without having to do any
trickery with eval.
|
| |
| |
| | |
`test_array_from_pyobj.py` needs to import pytest.
|
|/
|
|
|
|
|
|
|
|
|
|
| |
* replace most usage of SkipTest() with
pytest.skip()
* where possible, we avoid use of the standard
library SkipTest because unittest skipping
is routed through the pytest nose compatibility
layer in that scenario, which can prevent an easy
trace back to the test line where the skip
occurred
|
|
|
|
|
| |
That function is nose specific and has not worked since `__init__` files
were added to the tests directories.
|
| |
|
|
|
|
| |
This makes the contents of `typeinfo` look liked namedtuples
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
WRITEBACKIFCOPY (#9639)
* ENH: add API to resolve UPDATEONCOPY outside dealloc, test and use
* BUG: Fix usage of keyword "from" as argument name for "can_cast".
Also removed inconsistency between the second argument name
between documentation ("totype") and code ("to").
* UPDATEIFCOPY -> WRITEBACKIFCOPY, documentation
* fixes for review
* review2, fix new test
* fix new test for using self.assert_deprecated
* change deprecation logic as per review
* new logic exposed places where PyArray_ResolveWritebackIfCopy not called
* deprecate PyArray_XDECREF_ERR in favor of PyArray_DiscardWritebackIfCopy
* code review changes
* clean up merge cruft
* fix from review
* fixes from review
* extend the release note
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
* use SkipTest in numpy tests instead of importing it from nose
* add a KnownFailureException as an alias for KnownFailureTest
(the former is preferred, but the latter is kept for backcompat)
* rename the KnownFailure nose plugin into KnownFailurePlugin,
and keep the old name for backcompat
|
| |
|
| |
|
|
|
|
|
|
| |
turns out not only sparc is borked, skip the checks on all 32 bit arches
with too large clongdouble alignments until we have an aligned
allocator.
|
|
|
|
|
| |
mingw builds set the alignment requirement for complex doubles types to
16 byte so the tests checking the alignment flag must be disabled.
|
|
|
|
|
|
|
| |
(debian) sparc system malloc does not provide the alignment required by 16 byte
long double types this means the inout intent cannot be satisfied and several
tests fail as the alignment flag can be randomly true or fals when numpy gains
an aligned allocator the tests could be enabled again.
|
|
|
|
|
|
|
| |
tostring returns bytes which are not equal to string, so provide a
tobytes function alias.
tostring does not emit a deprecation warning yet so rdepends do not need
to check two names to support older versions of numpy without warnings.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Python 3 `map` is an iterator while in Python 2 it returns a list.
The simple fix applied by the fixer is to inclose all instances of map
with `list(...)`. This is not needed in all cases, and even where
appropriate list comprehensions may be preferred for their clarity.
Consequently, this patch attempts to use list comprehensions where it
makes sense.
When the mapped function has two arguments there is another problem that
can arise. In Python 3 map stops execution when the shortest argument
list is exhausted, while in Python 2 it stops when the longest argument
list is exhausted. Consequently the two argument case might need special
care. However, we have been running Python3 converted versions of numpy
since 1.5 without problems, so it is probably not something that affects
us.
Closes #3068
|
|
|
|
|
|
|
|
|
|
|
|
| |
This replaces python backtics with repr(...). The backtics were mostly
used to generate strings for printing with a string format and it is
tempting to replace `'%s' % repr(x)` with `'%r' % x`. That would work
except where `x` happened to be a tuple or a dictionary but, because it
would be significant work to guarantee that and because there are not
many places where backtics are used, the safe path is to let the repr
replacements stand.
Closes #3083.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This changes the `exec` command to the `exec` function.
|
|
|
|
| |
Example: except ValueError,msg: -> except ValueError as msg:
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
Rewrite F2Py's test suite, so that it is run as a part of Numpy's tests.
These tests require compiling extension modules on-the-fly, so I added
a small helper module for that.
|