Compile and import Fortran code using f2py.
(source_code,
options=[],
skip=[],
only=[],
suffix=None,
module_name=None)
| 174 | |
| 175 | @_memoize |
| 176 | def 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 | # |
no test coverage detected