47 |
haveGMSH=(os.system("gmsh -version")/256==0) #Do we have gmsh installed? |
haveGMSH=(os.system("gmsh -version")/256==0) #Do we have gmsh installed? |
48 |
haveMPL=False #Do we have matplotlib? |
haveMPL=False #Do we have matplotlib? |
49 |
haveGD=False #Does the matplotlib have griddata? |
haveGD=False #Does the matplotlib have griddata? |
50 |
|
|
51 |
|
mplmagicversion='0.98.5' |
52 |
|
|
53 |
try: |
try: |
54 |
import matplotlib |
import matplotlib |
55 |
haveMPL=True |
haveMPL=True |
56 |
|
mplversion=matplotlib.__version__ |
57 |
from matplotlib.mlab import griddata |
from matplotlib.mlab import griddata |
58 |
haveGD=True |
haveGD=True |
59 |
except ImportError: |
except ImportError: |
62 |
if not haveMPL: |
if not haveMPL: |
63 |
print "matplotlib not found skipping some tests" |
print "matplotlib not found skipping some tests" |
64 |
else: |
else: |
65 |
if not haveGD: |
if mplversion<mplmagicversion: |
66 |
print "matplotlib found but griddata not provided" |
print "matplotlib found but version too early. Some tests skipped." |
67 |
|
|
68 |
if not haveGMSH: |
if not haveGMSH: |
69 |
print "gmsh not found" |
print "gmsh not found" |
79 |
if haveMPL: |
if haveMPL: |
80 |
example_files_no_mpi.append('cookbook/onedheatdiff001.py') |
example_files_no_mpi.append('cookbook/onedheatdiff001.py') |
81 |
example_files_no_mpi.append('cookbook/onedheatdiff002.py') |
example_files_no_mpi.append('cookbook/onedheatdiff002.py') |
82 |
if haveGD: |
if mplversion>=mplmagicversion: |
83 |
example_files_no_mpi.append('cookbook/twodheatdiff001.py') |
example_files_no_mpi.append('cookbook/twodheatdiff001.py') |
84 |
example_files_no_mpi.append('usersguide/poisson_matplotlib.py') |
example_files_no_mpi.append('usersguide/poisson_matplotlib.py') |
85 |
example_files_allow_mpi.append('usersguide/wave.py') |
example_files_allow_mpi.append('usersguide/wave.py') |