Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e4c9a1a

Browse files
committed
Enforce numpy >= 1.1 and python >= 2.3 when importing matplotlib.
Numpy svn passes the test now. svn path=/trunk/matplotlib/; revision=5073
1 parent 1e637e7 commit e4c9a1a

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

CHANGELOG

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2+
2008-04-24 Make numpy 1.1 and python 2.3 required when importing
3+
matplotlib - EF
4+
15
2008-04-24 Fix compilation issues on VS2003 (Thanks Martin Spacek for
26
all the help) - MGD
37

@@ -3443,4 +3447,4 @@ This is the Old, stale, never used changelog
34433447
2003-11-21 - make a dash-dot dict for the GC
34443448

34453449
2003-12-15 - fix install path bug
3446-
t
3450+
t

lib/matplotlib/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,13 @@
112112
#else: _have_pkg_resources = True
113113

114114
if not _python23:
115-
def enumerate(seq):
116-
for i in range(len(seq)):
117-
yield i, seq[i]
115+
raise SystemExit('matplotlib requires Python 2.3 or later')
118116

117+
import numpy
118+
nn = numpy.__version__.split('.')
119+
if not (int(nn[0]) >= 1 and int(nn[1]) >= 1):
120+
raise SystemExit(
121+
'numpy >= 1.1 is required; you have %s' % numpy.__version__)
119122

120123
def is_string_like(obj):
121124
if hasattr(obj, 'shape'): return 0

lib/matplotlib/transforms.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -693,10 +693,7 @@ def update_from_data_xy(self, xy, ignore=None):
693693

694694
if len(xy) == 0:
695695
return
696-
try:
697-
xym = ma.masked_invalid(xy) # maybe add copy=False
698-
except AttributeError: # masked_invalid not exposed in npy 1.04
699-
xym = ma.masked_where(~npy.isfinite(xy), xy)
696+
xym = ma.masked_invalid(xy) # maybe add copy=False
700697
if (xym.count(axis=1)!=2).all():
701698
return
702699

0 commit comments

Comments
 (0)