ADflow  v1.0
ADflow is a finite volume RANS solver tailored for gradient-based aerodynamic design optimization.
get_f2py.py
Go to the documentation of this file.
1 # ------------- VERY IMPORTANT ------------
2 
3 # This script is necessary since f2py INSISTS on priting crap out when
4 # .f2py_f2cmap exists in the directory. Normally it get deleted, but
5 # if its still around a more naive approach will fail miseribly. Here
6 # we temporily reassign stdout such that when we import it, the output
7 # goes to stdout. Then we reassign stdout and simply puck off the
8 # include directory.
9 import os
10 import sys
11 import numpy.f2py
12 
13 tmp = sys.stdout
14 sys.stdout = sys.stderr
15 
16 sys.stdout = tmp
17 print(os.path.dirname(os.path.abspath(numpy.f2py.__file__)))