From: <ef...@us...> - 2008-12-13 06:20:38
|
Revision: 6595 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6595&view=rev Author: efiring Date: 2008-12-13 06:20:28 +0000 (Sat, 13 Dec 2008) Log Message: ----------- Start eliminating obsolete and temporary rcParams key, numerix.npyma module Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/config/mplconfig.py trunk/matplotlib/lib/matplotlib/config/rcsetup.py trunk/matplotlib/lib/matplotlib/numerix/__init__.py trunk/matplotlib/lib/matplotlib/numerix/ma/__init__.py trunk/matplotlib/lib/matplotlib/numerix/npyma/__init__.py trunk/matplotlib/lib/matplotlib/rcsetup.py trunk/matplotlib/matplotlibrc.template Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2008-12-12 21:22:04 UTC (rev 6594) +++ trunk/matplotlib/CHANGELOG 2008-12-13 06:20:28 UTC (rev 6595) @@ -1,3 +1,7 @@ +2008-12-12 Preparations to eliminate maskedarray rcParams key: its + use will now generate a warning. Similarly, importing + the obsolote numerix.npyma will generate a warning. - EF + 2008-12-12 Added support for the numpy.histogram() weights parameter to the axes hist() method. Docs taken from numpy - MM @@ -5,7 +9,7 @@ 2008-12-12 Removed external packages: configobj and enthought.traits which are only required by the experimental traited config - and are somewhat out of date. If needed, install them + and are somewhat out of date. If needed, install them independently, see: http://code.enthought.com/projects/traits Modified: trunk/matplotlib/lib/matplotlib/config/mplconfig.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2008-12-12 21:22:04 UTC (rev 6594) +++ trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2008-12-13 06:20:28 UTC (rev 6595) @@ -59,7 +59,6 @@ timezone = T.Trait('UTC', pytz.all_timezones) datapath = T.Trait(cutils.get_data_path()) numerix = T.Trait('numpy', 'numpy', 'numeric', 'numarray') - maskedarray = T.false units = T.false class backend(TConfig): @@ -290,7 +289,6 @@ 'backend' : (self.tconfig.backend, 'use'), 'backend_fallback' : (self.tconfig.backend, 'fallback'), 'numerix' : (self.tconfig, 'numerix'), - 'maskedarray' : (self.tconfig, 'maskedarray'), 'toolbar' : (self.tconfig, 'toolbar'), 'datapath' : (self.tconfig, 'datapath'), 'units' : (self.tconfig, 'units'), Modified: trunk/matplotlib/lib/matplotlib/config/rcsetup.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/rcsetup.py 2008-12-12 21:22:04 UTC (rev 6594) +++ trunk/matplotlib/lib/matplotlib/config/rcsetup.py 2008-12-13 06:20:28 UTC (rev 6595) @@ -296,7 +296,6 @@ defaultParams = { 'backend' : ['WXAgg', validate_backend], 'numerix' : ['numpy', validate_numerix], - 'maskedarray' : [False, validate_bool], 'toolbar' : ['toolbar2', validate_toolbar], 'datapath' : [None, validate_path_exists], # handled by _get_data_path_cached 'units' : [False, validate_bool], Modified: trunk/matplotlib/lib/matplotlib/numerix/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/numerix/__init__.py 2008-12-12 21:22:04 UTC (rev 6594) +++ trunk/matplotlib/lib/matplotlib/numerix/__init__.py 2008-12-13 06:20:28 UTC (rev 6595) @@ -20,7 +20,6 @@ from matplotlib import rcParams, verbose which = None, None -use_maskedarray = None # First, see if --numarray or --Numeric was specified on the command # line: @@ -31,10 +30,6 @@ "--NumPy", "--numpy", "--NUMPY", "--Numpy", ]: which = a[2:], "command line" - if a == "--maskedarray": - use_maskedarray = True - if a == "--ma": - use_maskedarray = False try: del a except NameError: pass @@ -45,11 +40,6 @@ except KeyError: pass -if use_maskedarray is None: - try: - use_maskedarray = rcParams['maskedarray'] - except KeyError: - use_maskedarray = False # If all the above fail, default to Numeric. Most likely not used. if which[0] is None: Modified: trunk/matplotlib/lib/matplotlib/numerix/ma/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/numerix/ma/__init__.py 2008-12-12 21:22:04 UTC (rev 6594) +++ trunk/matplotlib/lib/matplotlib/numerix/ma/__init__.py 2008-12-13 06:20:28 UTC (rev 6595) @@ -1,4 +1,4 @@ -from matplotlib.numerix import which, use_maskedarray +from matplotlib.numerix import which if which[0] == "numarray": from numarray.ma import * @@ -9,15 +9,10 @@ nomask = None getmaskorNone = getmask elif which[0] == "numpy": - if use_maskedarray: - from maskedarray import * - print "using maskedarray" - else: - try: - from numpy.ma import * # numpy 1.05 and later - except ImportError: - from numpy.core.ma import * # earlier - #print "using ma" + try: + from numpy.ma import * # numpy 1.05 and later + except ImportError: + from numpy.core.ma import * # earlier def getmaskorNone(obj): _msk = getmask(obj) if _msk is nomask: Modified: trunk/matplotlib/lib/matplotlib/numerix/npyma/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/numerix/npyma/__init__.py 2008-12-12 21:22:04 UTC (rev 6594) +++ trunk/matplotlib/lib/matplotlib/numerix/npyma/__init__.py 2008-12-13 06:20:28 UTC (rev 6595) @@ -1,11 +1,7 @@ -from matplotlib.numerix import use_maskedarray +import warnings -if use_maskedarray: - from maskedarray import * - print "using maskedarray" -else: - try: - from numpy.ma import * # numpy 1.05 and later - except ImportError: - from numpy.core.ma import * # earlier - #print "using ma" +warnings.warn("npyma is obsolete and will be removed", DeprecationWarning) +try: + from numpy.ma import * # numpy 1.05 and later +except ImportError: + from numpy.core.ma import * # earlier Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py =================================================================== --- trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-12-12 21:22:04 UTC (rev 6594) +++ trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-12-13 06:20:28 UTC (rev 6595) @@ -118,6 +118,16 @@ if v: warnings.warn("figure.autolayout is not currently supported") +def validate_maskedarray(v): + # 2008/12/12: start warning; later, remove all traces of maskedarray + try: + if v == 'obsolete': + return v + except ValueError: + pass + warnings.warn('rcParams key "maskedarray" is obsolete and has no effect;\n' + ' please delete it from your matplotlibrc file') + class validate_nseq_float: def __init__(self, n): self.n = n @@ -311,7 +321,7 @@ 'backend' : ['Agg', validate_backend], # agg is certainly present 'backend_fallback' : [True, validate_bool], # agg is certainly present 'numerix' : ['numpy', validate_numerix], - 'maskedarray' : [False, validate_bool], + 'maskedarray' : ['obsolete', validate_maskedarray], #to be removed 'toolbar' : ['toolbar2', validate_toolbar], 'datapath' : [None, validate_path_exists], # handled by _get_data_path_cached 'units' : [False, validate_bool], Modified: trunk/matplotlib/matplotlibrc.template =================================================================== --- trunk/matplotlib/matplotlibrc.template 2008-12-12 21:22:04 UTC (rev 6594) +++ trunk/matplotlib/matplotlibrc.template 2008-12-13 06:20:28 UTC (rev 6595) @@ -35,9 +35,6 @@ # you if backend_fallback is True #backend_fallback: True numerix : %(numerix)s # numpy, Numeric or numarray -#maskedarray : False # True to use external maskedarray module - # instead of numpy.ma; this is a temporary - # setting for testing maskedarray. #interactive : False # see http://matplotlib.sourceforge.net/interactive.html #toolbar : toolbar2 # None | classic | toolbar2 #timezone : UTC # a pytz timezone string, eg US/Central or Europe/Paris This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |