Here's a diff that does the staggered import.
seems to work for me, at least when i ran a bunch of the drawing
examples. Maybe not the cleanest thing, but it touched the fewest
lines
of code :) If you'd rather just have a direct numpy import i can do
that as well
and send along a diff (or if it's easy to setup, commit to svn)
--- nx_pylab.py.orig 2009-08-12 09:23:16.000000000 -0400
+++ nx_pylab.py 2009-08-12 09:30:18.000000000 -0400
@@ -206,7 +206,10 @@
"""
try:
import matplotlib.pylab as pylab
- import matplotlib.numerix as nmex
+ try:
+ import numpy as nmex
+ except ImportError:
+ import matplotlib.numerix as nmex
except ImportError:
raise ImportError, "Matplotlib required for draw()"
except RuntimeError:
@@ -285,11 +288,17 @@
try:
import matplotlib
import matplotlib.pylab as pylab
- import matplotlib.numerix as nmex
+ try:
+ import numpy as nmex
+ except ImportError:
+ import matplotlib.numerix as nmex
import matplotlib.cbook as cb
from matplotlib.colors import colorConverter,Colormap
from matplotlib.collections import LineCollection
- import matplotlib.numerix.mlab as mlab
+ try:
+ import numpy as mlab
+ except ImportError:
+ import matplotlib.numerix.mlab as mlab
except ImportError:
raise ImportError, "Matplotlib required for draw()"
except RuntimeError:
@@ -519,7 +528,10 @@
"""
try:
import matplotlib.pylab as pylab
- import matplotlib.numerix as nmex
+ try:
+ import numpy as nmex
+ except ImportError:
+ import matplotlib.numerix as nmex
import matplotlib.cbook as cb
except ImportError:
raise ImportError, "Matplotlib required for draw()"
On Aug 12, 9:37 am, Aric Hagberg <
aric.hagb...@gmail.com> wrote: