MCPcopy Create free account
hub / github.com/numpy/numpy / build_code

Function build_code

numpy/f2py/tests/util.py:176–195  ·  view source on GitHub ↗

Compile and import Fortran code using f2py.

(source_code,
               options=[],
               skip=[],
               only=[],
               suffix=None,
               module_name=None)

Source from the content-addressed store, hash-verified

174
175@_memoize
176def build_code(source_code,
177 options=[],
178 skip=[],
179 only=[],
180 suffix=None,
181 module_name=None):
182 """
183 Compile and import Fortran code using f2py.
184
185 """
186 if suffix is None:
187 suffix = ".f"
188 with temppath(suffix=suffix) as path:
189 with open(path, "w") as f:
190 f.write(source_code)
191 return build_module([path],
192 options=options,
193 skip=skip,
194 only=only,
195 module_name=module_name)
196
197
198#

Callers 1

setup_methodMethod · 0.85

Calls 4

temppathFunction · 0.90
openFunction · 0.85
build_moduleFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected