summaryrefslogtreecommitdiff
path: root/numpy/f2py/rules.py
Commit message (Collapse)AuthorAgeFilesLines
* [MAINT] Fix regression in using --capi-api flag and callbacksPearu Peterson2021-02-071-1/+1
|
* Apply reviewer comments.Pearu Peterson2021-01-191-4/+2
|
* Add test for gh17797.Pearu Peterson2021-01-181-3/+10
|
* BUG: subroutines using assumed shape arrays must be treated as F90 codes. ↵Pearu Peterson2021-01-181-2/+6
| | | | Don't split inline comments.
* MAINT: Use numpy version for f2py version.Charles Harris2020-08-221-9/+6
| | | | | | Because f2py is released as part of numpy, the old svn versioning no longer makes sense and it was decided to use the numpy version instead.
* MAINT: Remove uses of PyString_FromString.Charles Harris2020-08-191-1/+1
| | | | | | | | 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.
* add __f2py_numpy_version__ attributeSturla Molden2020-06-171-0/+6
|
* BUG: numpy/f2py: put callback globals to thread-local storagePauli Virtanen2020-06-071-26/+19
|
* STY: f2py/rules: replace \t with whitespace for readabilityPauli Virtanen2020-06-071-37/+37
|
* MNT: support python 3.10Thomas A Caswell2020-05-291-1/+1
| | | | | | | | | | | | 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.
* MAINT: remove useless `global` statementsEric Wieser2020-03-181-1/+0
| | | | | | | `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.
* convert shebang from python to python3 (#15687)Changqing Li2020-03-041-1/+1
| | | | Signed-off-by: Changqing Li <changqing.li@windriver.com>
* MAINT: Revert f2py Python 2.6 workaround (gh-15415)Seth Troisi2020-01-231-11/+1
| | | Revert ed916ff#diff-c9eccf467e5f6561061d6a5ac4730330 which was needed to workaround http://bugs.python.org/issue4720 which was fixed 12 years ago.
* Merge pull request #15232 from sethtroisi/remove_python3_part3Matti Picus2020-01-041-18/+0
|\ | | | | MAINT: Cleaning up PY_MAJOR_VERSION/PY_VERSION_HEX
| * Cleaning up PY_MAJOR_VERSION/PY_VERSION_HEXSeth Troisi2020-01-031-18/+0
| |
* | Merge pull request #14376 from jdufresne/futureSebastian Berg2020-01-031-2/+0
|\ \ | |/ |/| MAINT: Remove unnecessary 'from __future__ import ...' statements
| * MAINT: Remove unnecessary 'from __future__ import ...' statementsJon Dufresne2020-01-031-2/+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-031-8/+2
|/ | | | | 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.
* ENH: Chain exceptions when converting python objects to fortranEric Wieser2019-12-021-4/+8
| | | | | | 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.
* BUG: Further, followup f2py reference count fixesSebastian Berg2019-08-191-2/+7
| | | | | | | | 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-191-8/+20
|
* BUG: Fix leak in the f2py-generated module init and `PyMem_Del` usageSergei Lebedev2019-08-191-3/+6
| | | | | | 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)
* Fixed possible regressionsBharat123rox2019-05-081-2/+2
|
* Use with statement to open/close files to fix LGTM alertsBharat123rox2019-05-071-55/+50
|
* HTTP -> HTTPS, and other linkrot fixesMike Toews2018-06-161-1/+1
|
* MAINT: remove outdated entries in f2pyBernhard M. Wiedemann2017-09-271-3/+0
| | | | because svn is not used anymore
* ENH: Allow to override build dateBernhard M. Wiedemann2017-09-271-1/+2
| | | | | | | | and use gmtime in order to be independent of timezone in order to make builds reproducible. See https://reproducible-builds.org/ for why this is good and https://reproducible-builds.org/specs/source-date-epoch/ for the definition of this variable.
* MAINT: Change `call_fortran` into `callfortran` in comments.Dongjoon Hyun2016-01-291-1/+1
| | | | It was committed mistakenly in #7134. `callfortran` is used a lot really.
* MAINT: Fix some typos in a code string and commentsDongjoon Hyun2016-01-271-4/+4
|
* STY: Break some long lines in numpy/f2py/*.py.Charles Harris2015-07-291-39/+14
| | | | | | | The fixes are generated by autopep8, which uses line continuation. There are 441 cases that it is unable to handle, involving strings, and that is more, and more delicate, work than I want to do at this time. The line continuation characters at least mark some of the long lines.
* STY: Make PEP8 fixes in numpy/f2pyCharles Harris2015-07-251-779/+820
| | | | | Decided to bite the bullet on this one. The code is certainly more readable, so should be easier to fix if we need to.
* STY: Make pyflakes fixes in numpy/f2pyCharles Harris2015-07-251-12/+22
|
* MAINT: remove NPY_NO_DEPRECATED_API define from f2py.Ralf Gommers2014-11-231-2/+0
| | | | | See gh-5281 for discussion. With the defines in, compiling scipy 0.14.0 and below isn't possible.
* MAINT: change place where NPY_NO_DEPRECATED_API is defined in f2py.Ralf Gommers2014-11-161-0/+3
| | | | | This makes sure to undef at the end, and by putting the define in the C code it ensures that the error message is understandable.
* DEP: Replaced arr->descr, arr->flags and arr->base with the PyArray_* functionsChris Kerr2014-11-101-2/+2
|
* DEP: replaced arr->dimensions with PyArray_DIMS(arr) or PyArray_DIM(arr,i)Chris Kerr2014-11-101-1/+1
|
* DEP: replaced arr->data with PyArray_DATAChris Kerr2014-11-101-1/+1
|
* DEP: replaced arr->nd with PyArray_NDIM in C code generation scriptsChris Kerr2014-11-101-2/+2
|
* STY: Giant comma spacing fixup.Charles Harris2013-08-181-284/+284
| | | | | | | 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.
* MAINT: Apply 2to3 idioms fixer.Charles Harris2013-05-021-5/+5
| | | | | | | | | | | | | | | | | | | The idioms fixer makes the following replacements. 1) int <- bool 2) comparison or identity of types <- isinstance 3) a.sort() <- sorted(a) There were two problems that needed to be dealt with after the application of the fixer. First, the replacement of comparison or identity of types by isinstance was not always correct. The isinstance function returns true for subtypes whereas many of the places where the fixer made a substitution needed to check for exact type equality. Second, the sorted function was applied to arrays, but because it treats them as iterators and constructs a sorted list from the result, that is the wrong thing to do. Closes #3062.
* 2to3: Apply types fixer.Charles Harris2013-04-141-10/+10
| | | | | | | | | | | | | | | | | | | | Python 3 removes the builtin types from the types module. The types fixer replaces such references with the builtin types where possible and also takes care of some special cases: types.TypeNone <- type(None) types.NotImplementedType <- type(NotImplemented) types.EllipsisType <- type(Ellipsis) The only two tricky substitutions are types.StringType <- bytes types.LongType <- int These are fixed up to support both Python 3 and Python 2 code by importing the long and bytes types from numpy.compat. Closes #3240.
* 2to3: Apply `repr` fixer.Charles Harris2013-04-081-3/+3
| | | | | | | | | | | | 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.
* 2to3: Apply `print` fixer.Charles Harris2013-04-061-1/+1
| | | | | | | Add `print_function` to all `from __future__ import ...` statements and use the python3 print function syntax everywhere. Closes #3078.
* 2to3: Use absolute imports.Charles Harris2013-03-281-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 2to3: Put `from __future__ import division in every python file.Charles Harris2013-03-011-2/+3
| | | | | | | | 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.
* ENH: f2py: add 'Wrapper for ...' text to the docstringPauli Virtanen2012-11-171-1/+1
|
* ENH: f2py: generate docstrings in Numpy docstring formatPauli Virtanen2012-11-171-13/+14
|
* Use PyMODINIT_FUNC and update docs accordingly.cgohlke2012-09-021-1/+1
| | | | See https://github.com/scipy/scipy/pull/279
* WIP: implemented assumed shape support for Fortran subroutines.Pearu Peterson2011-02-261-1/+36
|
* FEAT: add C module and f2py fortran wrapper output customization from ↵David Cournapeau2010-09-171-3/+3
| | | | command line.