Skip to content

Commit 90d6db5

Browse files
committed
Changed from scipy to numpy
svn path=/trunk/matplotlib/; revision=1932
1 parent bb53c0a commit 90d6db5

File tree

22 files changed

+60
-60
lines changed

22 files changed

+60
-60
lines changed

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2006-1-4 Changed to support numpy (new name for scipy_core) - TEO
2+
13
2006-1-4 Added Mark's scaled axes patch for shared axis
24

35
2005-12-28 Added Chris Barker's build_wxagg patch - JDH

INSTALL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ COMPILING
6666
WINDOWS
6767

6868
If you don't already have python installed, you may want to consider
69-
using the enthought edition of python, which has scipy, Numeric, and
69+
using the enthought edition of python, which has (old) scipy, Numeric, and
7070
wxpython, plus a lot of other goodies, preinstalled -
7171
http://www.enthought.com/python . With the enthought edition of
7272
python + matplotlib installer, the following backends should work

lib/matplotlib/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,9 @@ def validate_numerix(s):
461461
sl = s.lower()
462462
if sl=='numeric': return 'Numeric'
463463
elif sl=='numarray': return 'numarray'
464-
elif sl=='scipy': return 'scipy'
464+
elif sl=='numpy': return 'numpy'
465465
else:
466-
raise ValueError('Numerix must be Numeric, numarray, or scipy')
466+
raise ValueError('Numerix must be Numeric, numarray, or numpy')
467467

468468
def validate_toolbar(s):
469469
"""

lib/matplotlib/_contour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
except ImportError:
1313
numerix._import_fail_message("_contour", "_nc")
1414
raise
15-
else: # Must be scipy
15+
else: # Must be numpy
1616
try:
1717
from matplotlib._ns_cntr import *
1818
except ImportError:

lib/matplotlib/_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
except ImportError:
1313
numerix._import_fail_message("_image", "_nc")
1414
raise
15-
else: # Must be scipy
15+
else: # Must be numpy
1616
try:
1717
from matplotlib._ns_image import *
1818
except ImportError:

lib/matplotlib/_transforms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
except ImportError:
1313
numerix._import_fail_message("_transforms", "_nc")
1414
raise
15-
else: # Must be scipy
15+
else: # Must be numpy
1616
try:
1717
from matplotlib._ns_transforms import *
1818
except ImportError:

lib/matplotlib/colors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def __call__(self, X, alpha=1.0):
518518
rgba = take(self._lut, xa)
519519
if vtype == 'scalar':
520520
rgba = tuple(rgba[0,:])
521-
#print rgba[0,1:10,:] # Now the same for scipy, numeric...
521+
#print rgba[0,1:10,:] # Now the same for numpy, numeric...
522522
return rgba
523523

524524
def set_bad(self, color = 'k', alpha = 0.0):

lib/matplotlib/enthought/util/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ def test(level=1,verbosity=1):
3434

3535
# returns a test suite for use elsewhere
3636
def test_suite(level=1):
37-
import scipy_test.testing
37+
import numpy.testing
3838
import matplotlib.enthought.util
39-
return scipy_test.testing.harvest_test_suites(enthought.util,level=level)
39+
return numpy.testing.harvest_test_suites(enthought.util,level=level)

lib/matplotlib/numerix/__init__.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
for a in sys.argv:
2828
if a in ["--Numeric", "--numeric", "--NUMERIC",
2929
"--Numarray", "--numarray", "--NUMARRAY",
30-
"--SciPy", "--scipy", "--SCIPY", "--Scipy",
30+
"--NumPy", "--numpy", "--NUMPY", "--Numpy",
3131
]:
3232
which = a[2:], "command line"
3333
break
@@ -44,8 +44,8 @@
4444
which = "numeric", "defaulted"
4545

4646
which = which[0].strip().lower(), which[1]
47-
if which[0] not in ["numeric", "numarray", "scipy"]:
48-
raise ValueError("numerix selector must be either 'Numeric', 'numarray', or 'scipy' but the value obtained from the %s was '%s'." % (which[1], which[0]))
47+
if which[0] not in ["numeric", "numarray", "numpy"]:
48+
raise ValueError("numerix selector must be either 'Numeric', 'numarray', or 'numpy' but the value obtained from the %s was '%s'." % (which[1], which[0]))
4949

5050
if which[0] == "numarray":
5151
#from na_imports import *
@@ -62,17 +62,17 @@
6262
from Matrix import Matrix
6363
import Numeric
6464
version = 'Numeric %s'%Numeric.__version__
65-
elif which[0] == "scipy":
66-
import scipy
67-
from scipy import *
65+
elif which[0] == "numpy":
66+
import numpy
67+
from numpy import *
6868
from _sp_imports import nx, infinity
6969
from _sp_imports import UInt8, UInt16, UInt32
7070
Matrix = matrix
71-
version = 'scipy' # Don't know how to get scipy version
71+
version = 'numpy %s' % numpy.__version__
7272
else:
7373
raise RuntimeError("invalid numerix selector")
7474

75-
# Some changes are only applicable to the new scipy:
75+
# Some changes are only applicable to the new numpy:
7676
if (which[0] == 'numarray' or
7777
which[0] == 'numeric'):
7878
def typecode(a):
@@ -86,16 +86,16 @@ def itemsize(a):
8686

8787
else:
8888
# We've already checked for a valid numerix selector,
89-
# so assume scipy.
89+
# so assume numpy.
9090
def typecode(a):
9191
return a.dtypechar
9292
def iscontiguous(a):
93-
return a.flags['CONTIGUOUS']
93+
return a.flags.contiguous
9494
def byteswapped(a):
9595
return a.byteswap()
9696
def itemsize(a):
9797
return a.itemsize
98-
# resize function is already defined by scipy
98+
# resize function is already defined by numpy
9999
# Fix typecode->dtype
100100
def fixkwargs(kwargs):
101101
if 'typecode' in kwargs:
@@ -104,13 +104,13 @@ def fixkwargs(kwargs):
104104
kwargs['dtype'] = val
105105
def array(*args, **kwargs):
106106
fixkwargs(kwargs)
107-
return scipy.array(*args, **kwargs)
107+
return numpy.array(*args, **kwargs)
108108
def zeros(*args, **kwargs):
109109
fixkwargs(kwargs)
110-
return scipy.zeros(*args, **kwargs)
110+
return numpy.zeros(*args, **kwargs)
111111
def ones(*args, **kwargs):
112112
fixkwargs(kwargs)
113-
return scipy.ones(*args, **kwargs)
113+
return numpy.ones(*args, **kwargs)
114114

115115

116116
verbose.report('numerix %s'%version)

lib/matplotlib/numerix/_sp_imports.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# Not sure why all the equivalences don't exist ...
2-
from scipy import Int8, UInt8, \
1+
from numpy import Int8, UInt8, \
32
Int16, UInt16, \
43
Int32, UInt32, \
54
Float32, Float64, \
@@ -21,5 +20,5 @@ class _TypeNamespace:
2120

2221
nx = _TypeNamespace()
2322

24-
from scipy import inf, infty, Infinity
23+
from numpy import inf, infty, Infinity
2524
infinity = Infinity

0 commit comments

Comments
 (0)