Compile and import Fortran code using f2py.
(source_code,
options=[],
skip=[],
only=[],
suffix=None,
module_name=None)
| 275 | |
| 276 | @_memoize |
| 277 | def 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 | # |
no test coverage detected
searching dependent graphs…