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

Function build_code

numpy/f2py/tests/util.py:277–296  ·  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

275
276@_memoize
277def build_code(source_code,
278 options=[],
279 skip=[],
280 only=[],
281 suffix=None,
282 module_name=None):
283 """
284 Compile and import Fortran code using f2py.
285
286 """
287 if suffix is None:
288 suffix = ".f"
289 with temppath(suffix=suffix) as path:
290 with open(path, "w") as f:
291 f.write(source_code)
292 return build_module([path],
293 options=options,
294 skip=skip,
295 only=only,
296 module_name=module_name)
297
298
299#

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…