summaryrefslogtreecommitdiff
path: root/numpy/f2py
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge pull request #17292 from charris/cleanup-remaining-pystring-macrosSebastian Berg2020-09-121-3/+3
|\ \ \ | | | | | | | | MAINT: Replace remaining PyString macros.
| * | | MAINT: Replace remaining PyString macros.Charles Harris2020-09-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace remaining npy_3kcompat PyString macros with their definition. - PyString_AS_STRING -> PyBytes_AS_STRING - PyString_GET_SIZE -> PyBytes_GET_SIZE
* | | | MAINT: Replace PyNumber_Int by PyNumber_LongCharles Harris2020-09-121-2/+2
| | | | | | | | | | | | | | | | Replace the npy_3kcompat macro PyNumber_Int by its definition.
* | | | MAINT: Replace PyInt_FromLong by PyLong_FromLong.Charles Harris2020-09-111-3/+3
|/ / / | | | | | | | | | Replace the npy_3kcompat macro PyInt_FromLong by its definition.
* | | MAINT: Replace PyStringObject by PyBytesObject.Charles Harris2020-09-101-1/+1
| | | | | | | | | | | | This replaces the npy_3kcompat macro PyStringObject with its definition.
* | | MAINT: Replace PyString_Check with PyBytes_Check.Charles Harris2020-09-101-7/+7
| | | | | | | | | | | | Replaces the npy_3kcompat PyString_Check macro with its definition.
* | | Merge pull request #17104 from BvB93/sub-modulesCharles Harris2020-09-071-0/+5
|\ \ \ | | | | | | | | ENH: Add placeholder stubs for all sub-modules
| * | | ENH: Added placeholder stubs for `distutils` and `f2py`Bas van Beek2020-08-201-0/+5
| | | |
* | | | Merge branch 'master' into cleanup-LongEric Wieser2020-08-244-17/+12
|\ \ \ \ | | |_|/ | |/| |
| * | | MAINT: Remove uses of PyString_FromString.Charles Harris2020-08-194-17/+12
| |/ / | | | | | | | | | | | | | | | | | | | | | We no longer need to use the compatibility function after dropping support for Python 2.7. In some cases unicode was the correct string type rather than the bytes of the compatibility version and bugs in the array `__complex__` and array `__array_interface__` methods have been fixed by changing that.
* | | MAINT: Replace PyInt macros with their PyLong replacementEric Wieser2020-08-241-4/+4
|/ / | | | | | | Unlike the others, PyInt_Check has a special meaning distinc from PyLong_Check, so only the places where the difference doesn't matter have been updated here.
* | add __f2py_numpy_version__ attributeSturla Molden2020-06-172-1/+27
| |
* | MAINT: f2py: move thread-local declaration definition to common macroPauli Virtanen2020-06-082-19/+18
| | | | | | | | | | Move compiler thread-local declaration detection to a common macro. Also support C11 thread_local declaration, if available.
* | TST: f2py: add test for callback threadsafetyPauli Virtanen2020-06-071-0/+50
| |
* | BUG: numpy/f2py: put callback globals to thread-local storagePauli Virtanen2020-06-074-47/+156
| |
* | STY: f2py/rules: replace \t with whitespace for readabilityPauli Virtanen2020-06-071-37/+37
| |
* | STY: f2py/cb_rules: replace \t by whitespace for readabilityPauli Virtanen2020-06-071-147/+147
| |
* | MNT: support python 3.10Thomas A Caswell2020-05-292-2/+2
|/ | | | | | | | | | | | In https://github.com/python/cpython/pull/20290 CPython changed `Py_TYPE` from a macro to an inline function. This requires a code change to us `Py_SET_TYPE` instead when using `Py_TYPE()` as a lvalue in c code. In https://github.com/python/cpython/pull/20429 CPython changed `Py_SIZE` from a macro to an inline function. This requires a code change to us `Py_SET_SIZE` instead of using `Py_SIZE` as a lvalue in c code.
* Mark tests as a subpackage rather than data.Hameer Abbasi2020-05-061-1/+2
|
* MAINT: simplify code that assumes str/unicode and int/long are different ↵Eric Wieser2020-03-264-8/+1
| | | | | types (#15816) Cleanup from the dropping of python 2
* Merge pull request #15781 from dcaliste/publicMatti Picus2020-03-262-4/+59
|\ | | | | BUG: don't add 'public' or 'private' if the other one exists
| * BUG: don't add 'public' or 'private' if the other one existsDamien Caliste2020-03-262-4/+59
| | | | | | | | | | | | Currently, setting 'public' or 'private' attribute is adding one even if the other one already exists because of the else: part that is always appending.
* | md5 module is deprecated since python 2.5Roman Yurchak2020-03-241-4/+1
|/
* 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.)