Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allows pep 338 execution via python -mnumpy.f2py
- Loading branch information
1 parent
8cf7c4a
commit a81e323
Showing
2 changed files
with
27 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# See http://cens.ioc.ee/projects/f2py2e/ | ||
import os, sys | ||
for mode in ["g3-numpy", "2e-numeric", "2e-numarray", "2e-numpy"]: | ||
try: | ||
i=sys.argv.index("--"+mode) | ||
del sys.argv[i] | ||
break | ||
except ValueError: pass | ||
os.environ["NO_SCIPY_IMPORT"]="f2py" | ||
if mode=="g3-numpy": | ||
sys.stderr.write("G3 f2py support is not implemented, yet.\\n") | ||
sys.exit(1) | ||
elif mode=="2e-numeric": | ||
from f2py2e import main | ||
elif mode=="2e-numarray": | ||
sys.argv.append("-DNUMARRAY") | ||
from f2py2e import main | ||
elif mode=="2e-numpy": | ||
from numpy.f2py import main | ||
else: | ||
sys.stderr.write("Unknown mode: " + repr(mode) + "\\n") | ||
sys.exit(1) | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters