| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
|
|/ |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* follow up to gh-18083 covering multi-line uses
of `re.compile(..` and some cases for `re.match(..`
with single (meta)character classes
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|\
| |
| | |
MAINT: exprtype regex simplify
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* `determineexprtype_re_1` was modified to remove extraneous
character class markers around a single `,`
* a similar change was applied for the word metacharacter
in `determineexprtype_re_2` and `determineexprtype_re_3`
* the third character class in `determineexprtype_re_3` was
simplified to remove an escape sequence--by placing the
`-` at the start of the character class its metacharacter
status can be avoided
|
| |
| |
| |
| |
| |
| | |
* `name_match` regular expression now starts by
matching a letter only, based on reviewer
feedback
|
|/
|
|
|
|
|
|
|
|
|
| |
* remove extraneous character class markers used in
`crackline_re_1`: `\w` and `=` on their own have no
benefit to character class `[]` inclusion
* `name_match` has a character class that can be
simplified because `\w` metacharacter already
encompasses the digit metacharacter and the
underscore
|
|
|
|
| |
See also PR gh-17687.
|
|\
| |
| | |
DOC: f2py: Add a docstring for getarrlen
|
| |
| |
| |
| |
| | |
The API of this function is awful, and I still have no idea what it does.
Maybe someone reading the docstring will be able to work it out.
|
|\ \
| |/
| | |
TST: f2py: Add a doctest for `getlincoef`
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
In fortran functions passed to f2py, calculations that occur in the
dimensions of array declarations are interpreted as floats. Valid
fortran requires integers. Problem only occurs with fortran functions
not subroutines as only for the former does f2py generate fortran
wrapper code that fails to compile.
Relevant code is in numpy.f2py.crackfortran.getlincoef(), which
calculates and returns the coefficients to getarrlen() for writing to
the fortran wrapper code.
Fixes gh-8062.
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
MAINT: Fixing typos in f2py comments and code.
|
| | |
|
|/
|
|
| |
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
| |
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|
| |
|
| |
|
|
|
|
| |
This fixes numpy.f2py.tests.test_kind.TestKind
|
|
|
|
|
| |
This is for the _selected_real_kind_func function in
f2py/crackfortran.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Use list comprehension
* More list comprehension migration
* Revert key copying in dict
* A few more fixes
* More reverts
* Use dict comprehension
* Fix dict comprehension
* Address review comments
* More review comments
* Fix for empty unpacking of zip(*
* Revert zip(* unpacking altogether
* Fix dict copying
* More simplifications
|
| |
|
| |
|
|
|
| |
Found via `codespell -q 3 -I ../numpy-whitelist.txt`
|
|
|
|
|
|
| |
The variable line was assigned to before checking whether it
contains a multiline or f2py enhancement pattern. In these cases
the line should not be split by ';'. See pull request #10676.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* BUG: improve parsing of quoted control characters in numpy.f2py.
See #10634. Fixes a couple of cases where quoted control
characters are parsed as if they are unquoted. The control
characters considered are "()!;".
* TST: quoted characters parsing by numpy.f2py.
Basic test of parsing quoted Fortran control characters. See #10634.
* BUG: add missing space character when reconstructing fortran line.
The missing space caused a line starting with "!f2py" to be considered
a continuation line.
|
| |
|
|
|
|
|
|
|
| |
* make exception raising 2/3 compatible
* remove unnecesary else statement after while loop without break clause
* ensure file is always enclosed even in the event of an exception
* ensure list comprehension variable does not override enclosing loop variable
|
|
|
|
|
|
|
| |
A missing call to rmbadname1 in analyzecommon caused a look up of
common block variables with a name in the badnames list to fail
and the fall back of defaultimplicitrules to be used.
See ticket 9228.
|
|
|
|
| |
Bare except is very rarely the right thing
|
| |
|
|
|
|
|
|
| |
Fix Fortran kind detection for PPC64el.
See: gh-3424.
|
|
|
|
| |
per request from @charris
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #8493
In the reported problem snippet the attempt to infer the type of
parameter (wasize=maxiterates*2)
leads to a lookup of maxiterates in the logic of get_parameters
which finds and correctly assigns to 'v' the value string '50000'
However, then in the logic proceds to attempt to split off any
underscore-appended precision spec from v_ which yields ['50000']
because there is no underscore.
Finally line
v = ''.join(v_[:-1]).lower().replace(v_[-1].lower(), '')
if not quarded by the newly introduced lengthtest sets v to empty
because [:-1] of a list with one element yields an empty list.
Subsequently the type inference by running eval on an empty string
fails with the error message quoted.
The introduced length check appears to correct this problem.
|
|
|
|
|
|
|
| |
In Python 3.6 a number of escape sequences that were previously accepted
-- for instance "\(" that was translated to "\\(" -- are deprecated. To
retain the previous behavior either raw strings must be used or the
backslash must be properly escaped itself.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fortran sources with parameters having kind-specifiers
where not correctly intercepted in the crackfortran.py
source.
The reason was a restrictive check for only integer specifiers
which did not split real's into the correct number.
Furthermore, several tests has been added which tests the different
kind specifiers and their use in codes, also all of them together.
Signed-off-by: Nick Papior <nickpapior@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The files
* capi_maps.py
* crackfortran.py
* f90mod_rules.py
previously used `from .auxfuncs import *` and also called `eval`
without an explicit enviroment. An attempt to use explicit imports
led to errors, and because static code analysis in not sufficient
to determine what functions need to be imported, it is safest to
continue using `import *` pending a major refactoring of f2py.
Closes #6563.
|
|\
| |
| | |
Cleanup 6306: BUG: allow extension of common blocks in numpy.f2py
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Lack of this feature resulted in the generation of incorrect *.pyf
files.
For example, the pyf file created by:
subroutine sub3 (some arguments)
real a, b, c, d
common /coeff/ a, b
common /coeff/ c, d
<do stuff>
return
end
Should contain both common statements the declaration of all four
variables a, b, c, and d.
Closes #5876.
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
Nested use of parameters in specifying dimensions caused problems.
For example
parameter (i=7)
common buf(nvar*(nvar+1) * (n + 1))
This fix was suggested by Pearu on github.
Closes #5877.
|
|
|
|
|
|
|
| |
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.
|