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

Skip to content

Commit f0a001a

Browse files
committed
Start eliminating obsolete and temporary rcParams key, numerix.npyma module
svn path=/trunk/matplotlib/; revision=6595
1 parent 8e00ba3 commit f0a001a

8 files changed

Lines changed: 27 additions & 38 deletions

File tree

CHANGELOG

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
2008-12-12 Preparations to eliminate maskedarray rcParams key: its
2+
use will now generate a warning. Similarly, importing
3+
the obsolote numerix.npyma will generate a warning. - EF
4+
15
2008-12-12 Added support for the numpy.histogram() weights parameter
26
to the axes hist() method. Docs taken from numpy - MM
37

48
2008-12-12 Fixed warning in hist() with numpy 1.2 - MM
59

610
2008-12-12 Removed external packages: configobj and enthought.traits
711
which are only required by the experimental traited config
8-
and are somewhat out of date. If needed, install them
12+
and are somewhat out of date. If needed, install them
913
independently, see:
1014

1115
http://code.enthought.com/projects/traits

lib/matplotlib/config/mplconfig.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class MPLConfig(TConfig):
5959
timezone = T.Trait('UTC', pytz.all_timezones)
6060
datapath = T.Trait(cutils.get_data_path())
6161
numerix = T.Trait('numpy', 'numpy', 'numeric', 'numarray')
62-
maskedarray = T.false
6362
units = T.false
6463

6564
class backend(TConfig):
@@ -290,7 +289,6 @@ def __init__(self, tconfig):
290289
'backend' : (self.tconfig.backend, 'use'),
291290
'backend_fallback' : (self.tconfig.backend, 'fallback'),
292291
'numerix' : (self.tconfig, 'numerix'),
293-
'maskedarray' : (self.tconfig, 'maskedarray'),
294292
'toolbar' : (self.tconfig, 'toolbar'),
295293
'datapath' : (self.tconfig, 'datapath'),
296294
'units' : (self.tconfig, 'units'),

lib/matplotlib/config/rcsetup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ def __call__(self, s):
296296
defaultParams = {
297297
'backend' : ['WXAgg', validate_backend],
298298
'numerix' : ['numpy', validate_numerix],
299-
'maskedarray' : [False, validate_bool],
300299
'toolbar' : ['toolbar2', validate_toolbar],
301300
'datapath' : [None, validate_path_exists], # handled by _get_data_path_cached
302301
'units' : [False, validate_bool],

lib/matplotlib/numerix/__init__.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from matplotlib import rcParams, verbose
2121

2222
which = None, None
23-
use_maskedarray = None
2423

2524
# First, see if --numarray or --Numeric was specified on the command
2625
# line:
@@ -31,10 +30,6 @@
3130
"--NumPy", "--numpy", "--NUMPY", "--Numpy",
3231
]:
3332
which = a[2:], "command line"
34-
if a == "--maskedarray":
35-
use_maskedarray = True
36-
if a == "--ma":
37-
use_maskedarray = False
3833

3934
try: del a
4035
except NameError: pass
@@ -45,11 +40,6 @@
4540
except KeyError:
4641
pass
4742

48-
if use_maskedarray is None:
49-
try:
50-
use_maskedarray = rcParams['maskedarray']
51-
except KeyError:
52-
use_maskedarray = False
5343

5444
# If all the above fail, default to Numeric. Most likely not used.
5545
if which[0] is None:

lib/matplotlib/numerix/ma/__init__.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from matplotlib.numerix import which, use_maskedarray
1+
from matplotlib.numerix import which
22

33
if which[0] == "numarray":
44
from numarray.ma import *
@@ -9,15 +9,10 @@
99
nomask = None
1010
getmaskorNone = getmask
1111
elif which[0] == "numpy":
12-
if use_maskedarray:
13-
from maskedarray import *
14-
print "using maskedarray"
15-
else:
16-
try:
17-
from numpy.ma import * # numpy 1.05 and later
18-
except ImportError:
19-
from numpy.core.ma import * # earlier
20-
#print "using ma"
12+
try:
13+
from numpy.ma import * # numpy 1.05 and later
14+
except ImportError:
15+
from numpy.core.ma import * # earlier
2116
def getmaskorNone(obj):
2217
_msk = getmask(obj)
2318
if _msk is nomask:
Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
from matplotlib.numerix import use_maskedarray
1+
import warnings
22

3-
if use_maskedarray:
4-
from maskedarray import *
5-
print "using maskedarray"
6-
else:
7-
try:
8-
from numpy.ma import * # numpy 1.05 and later
9-
except ImportError:
10-
from numpy.core.ma import * # earlier
11-
#print "using ma"
3+
warnings.warn("npyma is obsolete and will be removed", DeprecationWarning)
4+
try:
5+
from numpy.ma import * # numpy 1.05 and later
6+
except ImportError:
7+
from numpy.core.ma import * # earlier

lib/matplotlib/rcsetup.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,16 @@ def validate_autolayout(v):
118118
if v:
119119
warnings.warn("figure.autolayout is not currently supported")
120120

121+
def validate_maskedarray(v):
122+
# 2008/12/12: start warning; later, remove all traces of maskedarray
123+
try:
124+
if v == 'obsolete':
125+
return v
126+
except ValueError:
127+
pass
128+
warnings.warn('rcParams key "maskedarray" is obsolete and has no effect;\n'
129+
' please delete it from your matplotlibrc file')
130+
121131
class validate_nseq_float:
122132
def __init__(self, n):
123133
self.n = n
@@ -311,7 +321,7 @@ def __call__(self, s):
311321
'backend' : ['Agg', validate_backend], # agg is certainly present
312322
'backend_fallback' : [True, validate_bool], # agg is certainly present
313323
'numerix' : ['numpy', validate_numerix],
314-
'maskedarray' : [False, validate_bool],
324+
'maskedarray' : ['obsolete', validate_maskedarray], #to be removed
315325
'toolbar' : ['toolbar2', validate_toolbar],
316326
'datapath' : [None, validate_path_exists], # handled by _get_data_path_cached
317327
'units' : [False, validate_bool],

matplotlibrc.template

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ backend : %(backend)s
3535
# you if backend_fallback is True
3636
#backend_fallback: True
3737
numerix : %(numerix)s # numpy, Numeric or numarray
38-
#maskedarray : False # True to use external maskedarray module
39-
# instead of numpy.ma; this is a temporary
40-
# setting for testing maskedarray.
4138
#interactive : False # see http://matplotlib.sourceforge.net/interactive.html
4239
#toolbar : toolbar2 # None | classic | toolbar2
4340
#timezone : UTC # a pytz timezone string, eg US/Central or Europe/Paris

0 commit comments

Comments
 (0)