fgen.f2py

fgen.f2py#

f2py wrapper

Patches the default behaviour of f2py with some custom error handling. This was inspired by the amazing [f90wrap](jameskermode/f90wrap).

patch_f2py#

patch_f2py()[source]#

Patch f2py to raise a RuntimeError if on_error() is called during execution

Interrupt signals are also captured and handled. This has only been tested with numpy 1.21.0 and may be flakey if f2py has substantial changes.

Return type:

None