| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
* BUG, TST: fix f2py for PyPy, skip one test for PyPy, xfail tests for s390x
|
|
|
|
|
|
|
| |
`global` is only needed if a variable appears on the left of an assignment.
These variables do not.
Most suffer from the misconception that `var[x] = y` requires `var` to be global, but it does not.
|
|\
| |
| | |
MAINT: Fixing typos in f2py comments and code.
|
| | |
|
|/
|
|
| |
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
|
|
|
|
|
|
| |
* 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)
|
|
|
|
|
|
|
|
|
|
| |
This was not used previously due to it requiring C99. Python
itself acknowledges that it can be used (they do almost not use it
as of now), except inside header files due to C++ compatibility.
See also (Found by Eric Wieser in PR):
https://mail.python.org/pipermail/python-dev/2017-January/147154.html
and PEP 7: https://www.python.org/dev/peps/pep-0007/#c-dialect
|
|
|
| |
More sys.version cleanup.
|
|
|
| |
Revert ed916ff#diff-c9eccf467e5f6561061d6a5ac4730330 which was needed to workaround http://bugs.python.org/issue4720 which was fixed 12 years ago.
|
|
|
|
|
|
|
| |
This replaces basestring with str except in
- tools/npy_tempita/
- numpy/compat/py3k.py
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This means we no longer interpret `MemoryError` or `KeyboardInterrupt` as `keyword arg not provided`, for instance.
This function is python 3 only, hence this was difficult to do in older versions of numpy.
Inspired by https://bugs.python.org/issue35459
|
| |
|
|
|
|
|
|
|
|
| |
* The instance in `_internal` is parsing tuples and integers, so `ast.literal_eval` is just fine
* The instance in `crack_fortran` is just trying to lookup a function name dynamically
* The instance in `f90mod_rules` is looking at the result of `capi_maps.getarrdims(...)['rank']`, which is always a string representation of an integer
The f2py code is still littered with `eval`, but the remaining cases were harder to reason about.
|
| |
|
| |
|
|
|
|
|
|
| |
Marking these arguments as const makes it easier to reason about these functions, and prevent accidental mutation.
The C99 standard (6.2.5/26 "Types") guarantees that ABI compatibility is preserved here.
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
MAINT: Cleaning up PY_MAJOR_VERSION/PY_VERSION_HEX
|
| | |
|
|\ \
| |/
|/| |
MAINT: Remove unnecessary 'from __future__ import ...' statements
|
| |
| |
| |
| |
| | |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|
|/
|
|
|
| |
Dropping the support for python 2, the difference in module setup do not have to be accounted
for anymore. This removes the macros and ifdef's related to module setup code and python 2
support.
|
| |
|
|
|
|
|
|
| |
Distutils code needs to run in different temporary directories, probably
because they create `_configtest.c` files for compiler detection in the
current directory.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, f2py loaded the type mappings from a file ``.f2py_f2cmap``
in current directory, at import time.
Make the file name customizable by adding a ``--f2cmap`` command line
option, and postpone loading the file to f2py.run_main().
Moreover, restore the default type mapping in f2py.run_main() before
loading the customizations, so that multiple calls to f2py.run_main() do
not interfere with each other. (For example, numpy.distutils calls f2py
multiple times in the same process.)
|
|\
| |
| |
| | |
Test, fix for missing end words in fortran subroutines and functions.
Fixes gh-14625
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
Note that since we now need `npy_3kcompat.h`, we can delete all duplicated lines in this file
We preserve the original exception type for compatibility with old code here.
|
|/
|
|
|
|
| |
I just got this error while hacking some scipy internals, and had nowhere near enough information to debug it.
This is a little closer to useful.
|
|\
| |
| | |
BUG: General fixes to f2py reference counts (dereferencing)
|
| |
| |
| |
| |
| |
| |
| |
| | |
Note that the extension module dict seems to be never dereferenced
(there is an additional reference to it kept around somewhere).
This reference seems to part of the C python module loading
(possibly intentionally), and I could not find how to remove it or
where it originates from.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
A BytesWarning can be emitted when bytes are and strings are mismatched.
Catching BytesWarning ensures a better boundary between str and bytes
type. The test suite is now run with the -b flag to emit this warning.
Fixes #9308
|
|/ |
|
|
|
|
|
|
| |
Using `PyMem_Del` is incorrect, it should be `PyObject_Del` here, while
this worked most of the time, it would lead to crashes at least on python
2.5 (after the reference counts were fixed)
|
| |
|
|
|
|
| |
pip will itself call setup.py install with the rights options.
|
|\
| |
| | |
MAINT: Use with statement to open/close files to fix LGTM alerts
|
| | |
|
| | |
|
| | |
|
|/ |
|
| |
|
|
|
|
| |
Don't touch the fortran files, since indentation is signficant there and it makes things more error-prone
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The warning
[...]/fortranobject.c:138:18: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and 'unsigned long' [-Wsign-compare]
if (size < sizeof(notalloc)) {
~~~~ ^ ~~~~~~~~~~~~~~~~
occurs 17 times when scipy is built. The change in this pull request casts
`size` to `size_t` before comparing it to `sizeof(...)`. A previous check
has already eliminated the possibility that `size` is negative, so this cast
is safe.
|
|
|
|
| |
This fixes numpy.f2py.tests.test_kind.TestKind
|