Check if a file imports petsc4py.
(f)
| 14 | |
| 15 | |
| 16 | def imports_petsc4py(f): |
| 17 | """Check if a file imports petsc4py.""" |
| 18 | with open(f, encoding="utf-8") as file: |
| 19 | read_data = file.read() |
| 20 | return "petsc4py" in read_data or ".petsc" in read_data |
| 21 | |
| 22 | |
| 23 | # Get directory of this file |