summaryrefslogtreecommitdiff
path: root/numpy/f2py/f2py2e.py
Commit message (Collapse)AuthorAgeFilesLines
* BUG: Fix a refactor leftover bugNamami Shanker2022-06-031-1/+1
|
* BUG: Fix handling of skip-empty-wrappersRohit Goswami2022-04-301-1/+1
|
* MAINT: Pick a better nameRohit Goswami2022-04-291-2/+2
| | | | | | Co-authored-by: Ralf Gommers <ralf.gommers@gmail.com> Co-authored-by: Pearu Peterson <pearu.peterson@gmail.com> Co-authored-by: Melissa Weber Mendonça <melissawm@gmail.com>
* ENH: Switch to a negative flagRohit Goswami2022-03-211-16/+5
| | | | | | Also remove FutureWarning and update documentation Co-authored-by: Ralf Gommers <ralf.gommers@gmail.com>
* MAINT: Add a future warning for --empty-genRohit Goswami2022-03-211-0/+10
|
* ENH: Do not generate F90 wrappers for F77 inputsRohit Goswami2022-03-211-10/+2
|
* ENH: Add an emptygen option for f2pyRohit Goswami2022-03-121-0/+15
|
* DOC: Refactoring f2py user guidemelissawm2022-01-051-3/+5
|
* DOC: Add help string for F2PYRohit Goswami2021-12-261-0/+3
| | | | From https://github.com/HaoZeke/f2py_skel/commit/39a0849b16206e0201e89e12233e5a871a3a71a1
* Merge pull request #20182 from HaoZeke/buildf2pydocRalf Gommers2021-11-161-1/+1
|\ | | | | DOC, MAINT: Update build systems for f2py
| * MAINT: Fix build issuesRohit Goswami2021-11-151-1/+1
| |
* | MAINT: Fix newlines in diagnostics output of numpy.f2py.Christoph Buchner2021-11-141-1/+1
|/ | | | | | Linebreaks were not consistently added to errmess/outmess arguments, which led to very long lines and wrong concatenation with compiler messages in f2py console output.
* MAINT: Fix LGTM.com warningDimitri Papadopoulos2021-09-241-23/+22
| | | | | | | | | | | | Constant in conditional expression or statement Testing a constant will always give the same result. This originates in 0ca82e9, back in 2005, where if scipy_distutils_version[:5]>='0.2.2': was changed into: if 1: Given how old SciPy 0.2 is, the conditional is clearly obsolete.
* MAINT,DOC: f2py cleanupRohit Goswami2021-09-201-1/+1
|
* MAINT,DOC: Refactor, syntax highlighting for f2pyRohit Goswami2021-09-191-2/+2
|
* MAINT: revise OSError aliases (IOError, EnvironmentError)Mike Taves2021-09-021-3/+2
|
* MAINT: refactor "for ... in range(len(" statementsMike Taves2021-09-011-27/+30
|
* MAINT: multiline regex class simplifyTyler Reddy2020-12-291-3/+3
| | | | | | * follow up to gh-18083 covering multi-line uses of `re.compile(..` and some cases for `re.match(..` with single (meta)character classes
* MAINT: regex char class improveTyler Reddy2020-12-281-2/+2
| | | | | | | | | | | | | * replace superfluous single-character regex character classes with their literal string equivalents; this avoids the overhead associated with a character class when there's only a single character enclosed (so there's no benefit to the class overhead) * for more information see: Chapter 6 of: Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O’Reilly Media, 2009.
* Merge pull request #17122 from charris/cleanup-f2py-versioningRalf Gommers2020-11-281-12/+8
|\ | | | | MAINT: Use numpy version for f2py version.
| * MAINT: Use numpy version for f2py version.Charles Harris2020-08-221-12/+8
| | | | | | | | | | | | 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.
* | BUG: mac dylib treated as extra library by f2pyBharat Medasani2020-10-221-1/+1
| |
* | MAINT: Explicit disabling `CCompilerOpt` in F2PYSayed Adel2020-10-131-1/+3
|/ | | | This patch also cleans up `CCompilerOpt` calls in build_ext and build_clib.
* 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-1/+1
| | | Revert ed916ff#diff-c9eccf467e5f6561061d6a5ac4730330 which was needed to workaround http://bugs.python.org/issue4720 which was fixed 12 years ago.
* 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.
* ENH: f2py: add --f2cmap option for specifying the name of .f2py_f2cmapPauli Virtanen2019-12-141-2/+13
| | | | | | | | | | | | | 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.)
* Add code review suggestions from @eric-wieserBharat123rox2019-05-081-2/+3
|
* Use with statement to open/close files to fix LGTM alertsBharat123rox2019-05-071-5/+4
|
* BUG, DOC: test, fix that f2py.compile accepts str and bytes, rework docsmattip2019-01-201-2/+19
|
* ENH: Use entry_points to install the f2py scripts.Charles Harris2018-08-231-6/+18
| | | | | | | | | | | | | | | | | | | | | This adds entry_points for the f2py scripts. The installed scripts differ between Windows and other environments. * On Windows, the only script installed is 'f2py'. This works well in that environment because each Python version is installed in its own directory, making it easy to keep the differing script versions separate. * Otherwise, three scripts are installed, 'f2py', 'f2py' + 'minor', and 'f2py' + 'major.minor'. For instance, if Numpy is installed by Python 2.7, then the installed scripts will be named 'f2py', 'f2py2', and 'f2py2.7'. That naming scheme is used for back compatibility, and also so that more than one Python version can be dealt with in a way common to many Linux distros. Note that 'f2py' will always point to the latest install and 'f2py(2|3)' to the latest Python (2|3) install The script tests have been modified to check for the new environment and the code previously used to install the scripts has been removed.
* STY: Make pyflakes fixes in numpy/f2pyCharles Harris2015-07-251-140/+198
|
* ENH: remove insecure mktemp useJulian Taylor2014-02-061-2/+2
| | | | | mktemp only returns a filename, a malicous user could replace it before it gets used.
* MAINT: remove use of ``reload`` from f2py. See gh-4139.Ralf Gommers2013-12-301-5/+1
|
* STY: Giant comma spacing fixup.Charles Harris2013-08-181-42/+42
| | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | | | 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-8/+6
| | | | | | | | | | | | | | | | | | | | 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 `map` fixer.Charles Harris2013-04-101-2/+2
| | | | | | | | | | | | | | | | | | | 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
* 2to3: Apply `repr` fixer.Charles Harris2013-04-081-4/+4
| | | | | | | | | | | | 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 `dict` fixer.Charles Harris2013-04-061-1/+1
| | | | | | | | | | | | | | | In Python3 `dict.items()`, `dict.keys()`, and `dict.values()` are iterators. This causes problems when a list is needed so the 2to3 fixer explicitly constructs a list when is finds on of those functions. However, that is usually not necessary, so a lot of the work here has been cleaning up those places where the fix is not needed. The big exception to that is the `numpy/f2py/crackfortran.py` file. The code there makes extensive use of loops that modify the contents of the dictionary being looped through, which raises an error. That together with the obscurity of the code in that file made it safest to let the `dict` fixer do its worst. Closes #3050.
* 2to3: Apply `print` fixer.Charles Harris2013-04-061-5/+5
| | | | | | | 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-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+2
| | | | | | | | 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.
* BUG: Fix `not a in ...` to `a not in ...`.Charles Harris2013-02-281-14/+15
| | | | Also break regular expression compiles out of the loop.
* REF: Replace filters with list comprehensions.Charles Harris2013-02-281-12/+17
| | | | | | 2to3 does a lot of list(filter(...)) sort of thing which can be avoided by using list comprehensions instead of filters. This also seems to clarify the code to a considerable degree.
* 2to3: Apply `filter` fixes. Closes #3053.Charles Harris2013-02-281-11/+11
| | | | | Generally, this involves using list comprehension, or explicit list construction as `filter` is an iterator in Python 3.
* 2to3: Use modern exception syntax.Charles Harris2013-02-261-1/+1
| | | | Example: except ValueError,msg: -> except ValueError as msg:
* BUG[f2py]: fix --include_paths bug. Deprecated --include_paths in favor of ↵Pearu Peterson2011-06-211-5/+15
| | | | --include-paths. Updated docs.
* STY: Update exception styles, trickier ones.Charles Harris2011-04-051-1/+1
|
* FEAT: add C module and f2py fortran wrapper output customization from ↵David Cournapeau2010-09-171-3/+20
| | | | command line.