summaryrefslogtreecommitdiff
path: root/numpy/f2py
Commit message (Collapse)AuthorAgeFilesLines
* BUG, TST: fix f2py for PyPy, skip one test for PyPy (#15750)Matti Picus2020-03-188-34/+34
| | | * BUG, TST: fix f2py for PyPy, skip one test for PyPy, xfail tests for s390x
* MAINT: remove useless `global` statementsEric Wieser2020-03-185-8/+2
| | | | | | | `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.
* Merge pull request #15706 from melissawm/f2py-typos-fixCharles Harris2020-03-083-8/+8
|\ | | | | MAINT: Fixing typos in f2py comments and code.
| * Fixing typos in f2py comments and code.Melissa Weber Mendonca2020-03-043-8/+8
| |
* | convert shebang from python to python3 (#15687)Changqing Li2020-03-0414-14/+14
|/ | | | Signed-off-by: Changqing Li <changqing.li@windriver.com>
* MAINT: cleanup unused imports; avoid redefinition of importsMike Taves2020-02-064-6/+0
| | | | | | | * 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)
* MAINT: Use `.identifier = val` to fill type structsSebastian Berg2020-02-011-15/+7
| | | | | | | | | | 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
* MAINT: Remove sys.version checks (gh-#15373)Seth Troisi2020-01-281-5/+1
| | | More sys.version cleanup.
* MAINT: Revert f2py Python 2.6 workaround (gh-15415)Seth Troisi2020-01-232-12/+2
| | | Revert ed916ff#diff-c9eccf467e5f6561061d6a5ac4730330 which was needed to workaround http://bugs.python.org/issue4720 which was fixed 12 years ago.
* MAINT: Replace basestring with str.Charles Harris2020-01-231-1/+1
| | | | | | | This replaces basestring with str except in - tools/npy_tempita/ - numpy/compat/py3k.py
* STY: use `with open` when possibleSeth Troisi2020-01-211-3/+2
|
* MAINT: Remove sys.version checks in testsSeth Troisi2020-01-151-2/+0
|
* BUG: Use PyDict_GetItemWithError() instead of PyDict_GetItem()Eric Wieser2020-01-141-2/+5
| | | | | | | | 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
* Update numpy/f2py/crackfortran.pyEric Wieser2020-01-121-1/+1
|
* MAINT: Eliminate some calls to `eval`Eric Wieser2020-01-112-6/+7
| | | | | | | | * 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.
* MAINT: C code simplificationSeth Troisi2020-01-081-7/+5
|
* MAINT: Cleaning up more PY_VERSION_HEXSeth Troisi2020-01-061-25/+0
|
* MAINT: Improve const-correctness of shapes and stridesEric Wieser2020-01-061-1/+1
| | | | | | 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.
* MAINT: Remove implicit inheritance from object class (#15236)Jon Dufresne2020-01-054-8/+8
| | | | | | | 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.
* Merge pull request #15232 from sethtroisi/remove_python3_part3Matti Picus2020-01-045-82/+0
|\ | | | | MAINT: Cleaning up PY_MAJOR_VERSION/PY_VERSION_HEX
| * Cleaning up PY_MAJOR_VERSION/PY_VERSION_HEXSeth Troisi2020-01-035-82/+0
| |
* | Merge pull request #14376 from jdufresne/futureSebastian Berg2020-01-0338-77/+0
|\ \ | |/ |/| MAINT: Remove unnecessary 'from __future__ import ...' statements
| * MAINT: Remove unnecessary 'from __future__ import ...' statementsJon Dufresne2020-01-0338-77/+0
| | | | | | | | | | As numpy is Python 3 only, these import statements are now unnecessary and don't alter runtime behavior.
* | MAINT: Remove Python2 specific C module setup (gh-15231)Seth Troisi2020-01-032-19/+3
|/ | | | | 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.
* Fix typos, via a Levenshtein-style correctorBrian Wignall2019-12-191-1/+1
|
* TST: f2py: fix race condition in f2py test _get_compiler_statusPauli Virtanen2019-12-141-3/+9
| | | | | | Distutils code needs to run in different temporary directories, probably because they create `_configtest.c` files for compiler detection in the current directory.
* ENH: f2py: add --f2cmap option for specifying the name of .f2py_f2cmapPauli Virtanen2019-12-144-16/+60
| | | | | | | | | | | | | 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.)
* Merge pull request #15035 from mattip/issue-14625Sebastian Berg2019-12-093-2/+43
|\ | | | | | | Test, fix for missing end words in fortran subroutines and functions. Fixes gh-14625
| * MAINT: fixes from reviewmattip2019-12-031-3/+4
| |
| * DOC: fix outstanding typo in NumPy versionmattip2019-12-031-1/+1
| |
| * BUG: add endfunction, endsubroutine to valid fortran end wordsmattip2019-12-032-1/+41
| |
* | ENH: Chain exceptions when converting python objects to fortranEric Wieser2019-12-022-28/+9
| | | | | | | | | | | | 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.
* | ENH: Show the incorrect type in the fortran error messageEric Wieser2019-12-011-3/+4
|/ | | | | | 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.
* Merge pull request #12633 from seberg/f2py-refcntMatti Picus2019-10-158-98/+179
|\ | | | | BUG: General fixes to f2py reference counts (dereferencing)
| * BUG: Further, followup f2py reference count fixesSebastian Berg2019-08-195-16/+53
| | | | | | | | | | | | | | | | 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.
| * BUG: General fixes to f2py reference counts (dereferencing)Sebastian Berg2019-08-195-82/+126
| |
* | MAINT: Avoid all BytesWarningJon Dufresne2019-09-251-0/+1
| | | | | | | | | | | | | | | | 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
* | MAINT: remove unused numpy/f2py/info.py fileRalf Gommers2019-09-221-6/+0
|/
* BUG: Fix leak in the f2py-generated module init and `PyMem_Del` usageSergei Lebedev2019-08-192-5/+11
| | | | | | 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)
* DOC: update or remove outdated sourceforge linksmattip2019-08-081-1/+1
|
* Doc: Use `pip install .` where possible instead of calling setup.pyMatthias Bussonnier2019-07-231-1/+1
| | | | pip will itself call setup.py install with the rights options.
* Merge pull request #13499 from Bharat123rox/file-closingEric Wieser2019-05-122-58/+53
|\ | | | | MAINT: Use with statement to open/close files to fix LGTM alerts
| * Add code review suggestions from @eric-wieserBharat123rox2019-05-081-2/+3
| |
| * Fixed possible regressionsBharat123rox2019-05-081-2/+2
| |
| * Use with statement to open/close files to fix LGTM alertsBharat123rox2019-05-072-60/+54
| |
* | BUG: blindly add TypeError to accepted exceptionsmattip2019-04-301-1/+1
|/
* TEST: update for PyPymattip2019-04-171-1/+2
|
* MAINT: Use textwrap.dedent in f2py testsEric Wieser2019-04-103-43/+42
| | | | Don't touch the fortran files, since indentation is signficant there and it makes things more error-prone
* MAINT: f2py: Add a cast to avoid a compiler warning.Warren Weckesser2019-04-051-1/+1
| | | | | | | | | | | | | 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.
* BUG: ppc and riscv don't use REAL(10)Andreas Schwab2019-03-051-1/+1
| | | | This fixes numpy.f2py.tests.test_kind.TestKind