MCPcopy Index your code
hub / github.com/numpy/numpy / f2cexpr

Function f2cexpr

numpy/f2py/capi_maps.py:242–254  ·  view source on GitHub ↗

Rewrite Fortran expression as f2py supported C expression. Due to the lack of a proper expression parser in f2py, this function uses a heuristic approach that assumes that Fortran arithmetic expressions are valid C arithmetic expressions when mapping Fortran function calls to the co

(expr)

Source from the content-addressed store, hash-verified

240
241
242def f2cexpr(expr):
243 """Rewrite Fortran expression as f2py supported C expression.
244
245 Due to the lack of a proper expression parser in f2py, this
246 function uses a heuristic approach that assumes that Fortran
247 arithmetic expressions are valid C arithmetic expressions when
248 mapping Fortran function calls to the corresponding C function/CPP
249 macros calls.
250
251 """
252 # TODO: support Fortran `len` function with optional kind parameter
253 expr = re.sub(r'\blen\b', 'f2py_slen', expr)
254 return expr
255
256
257def getstrlength(var):

Callers 1

getstrlengthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…