Skip to content

Commit

Permalink
RF: Add back the optional import machinery in each one of these, so that
Browse files Browse the repository at this point in the history
individual imports are also handled.
  • Loading branch information
arokem committed Aug 4, 2012
1 parent 44c55d9 commit 814802a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
14 changes: 10 additions & 4 deletions dipy/viz/_show_odfs.py
@@ -1,10 +1,16 @@
import numpy as np

# Mayavi appears in many guises:
try:
from enthought.mayavi import mlab
try:
# Mayavi appears in many guises:
try:
from enthought.mayavi import mlab
except ImportError:
from mayavi import mlab
# But if you don't have it, we're not going to give you too much of a hard time:
except ImportError:
from mayavi import mlab
e_s = "You do not have Mayavi installed. Some visualization functions"
e_s += " might not work."
print(e_s)

from dipy.utils.spheremakers import sphere_vf_from

Expand Down
11 changes: 8 additions & 3 deletions dipy/viz/projections.py
Expand Up @@ -8,9 +8,14 @@
import numpy as np
import scipy.interpolate as interp

import matplotlib
import matplotlib.pyplot as plt
import matplotlib.tri as tri
try:
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.tri as tri
except ImportError:
e_s = "You do not have Matplotlib installed. Some visualization functions"
e_s += " might not work for you."
print(e_s)

import dipy.core.geometry as geo

Expand Down

0 comments on commit 814802a

Please sign in to comment.