1
2
3
4
5
6
7
8
9 """Import griddata with preference to the version from matplotlib
10 """
11
12 __docformat__ = 'restructuredtext'
13
14 import sys
15 from mvpa.base import externals
16
17 if externals.exists('griddata', raiseException=True):
18 if __debug__:
19 from mvpa.base import debug
20
21 try:
22 if sys.version_info[:2] >= (2, 5):
23
24 griddata = __import__('griddata', globals(),
25 locals(), [], 0).griddata
26 else:
27
28
29 oldname = __name__
30
31 __name__ = 'iaugf9zrkjsbdv91'
32 try:
33 from griddata import griddata
34
35 __name__ = oldname
36 except ImportError:
37
38 __name__ = oldname
39 raise
40 if __debug__:
41 debug('EXT', 'Using python-griddata')
42 except ImportError:
43 from matplotlib.mlab import griddata
44 if __debug__:
45 debug('EXT', 'Using matplotlib.mlab.griddata')
46