Revision: 6932
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6932&view=rev
Author: efiring
Date: 2009-02-24 21:56:19 +0000 (Tue, 24 Feb 2009)
Log Message:
-----------
Removal of numerix, stage 2.
The only vestiges are a couple method names, and a validator
with a warning to catch numerix keys in matplotlibrc files.
Modified Paths:
--------------
trunk/matplotlib/doc/api/api_changes.rst
trunk/matplotlib/doc/devel/outline.rst
trunk/matplotlib/examples/misc/rc_traits.py
trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
trunk/matplotlib/lib/matplotlib/config/mplconfig.py
trunk/matplotlib/lib/matplotlib/config/rcsetup.py
trunk/matplotlib/lib/matplotlib/rcsetup.py
trunk/matplotlib/matplotlibrc.template
trunk/matplotlib/setup.py
trunk/matplotlib/setupext.py
trunk/matplotlib/test/mplTest/units/UnitDblConverter.py
trunk/matplotlib/test/test_backends/TestAgg.py
trunk/matplotlib/unit/agg_memleak.py
trunk/matplotlib/unit/ft2font_memleak.py
trunk/matplotlib/unit/inside_poly_memleak.py
trunk/matplotlib/unit/inside_poly_profile.py
Modified: trunk/matplotlib/doc/api/api_changes.rst
===================================================================
--- trunk/matplotlib/doc/api/api_changes.rst 2009-02-24 21:15:49 UTC (rev
6931)
+++ trunk/matplotlib/doc/api/api_changes.rst 2009-02-24 21:56:19 UTC (rev
6932)
@@ -19,11 +19,13 @@
Changes for 0.98.x
==================
+* Removed numerix package.
+
* Added new :func:`matplotlib.image.imsave` and exposed it to the
:mod:`matplotlib.pyplot` interface.
* Remove support for pyExcelerator in exceltools -- use xlwt
- instead
+ instead
* Changed the defaults of acorr and xcorr to use usevlines=True,
maxlags=10 and normed=True since these are the best defaults
Modified: trunk/matplotlib/doc/devel/outline.rst
===================================================================
--- trunk/matplotlib/doc/devel/outline.rst 2009-02-24 21:15:49 UTC (rev
6931)
+++ trunk/matplotlib/doc/devel/outline.rst 2009-02-24 21:56:19 UTC (rev
6932)
@@ -107,7 +107,6 @@
config/rcsetup Darren needs conversion
config/tconfig Darren needs conversion
config/verbose Darren needs conversion
-numerix/__init__ needs conversion
projections/__init__ Mike converted
projections/geo Mike converted (not included--experimental)
projections/polar Mike converted
Modified: trunk/matplotlib/examples/misc/rc_traits.py
===================================================================
--- trunk/matplotlib/examples/misc/rc_traits.py 2009-02-24 21:15:49 UTC (rev
6931)
+++ trunk/matplotlib/examples/misc/rc_traits.py 2009-02-24 21:56:19 UTC (rev
6932)
@@ -131,7 +131,6 @@
class RC(traits.HasTraits):
backend = traits.Trait(*backends)
- numerix = traits.Trait('Numeric', 'numarray')
interactive = flexible_false_trait
toolbar = traits.Trait('toolbar2', 'classic', None)
timezone = traits.Trait(*timezones)
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2009-02-24
21:15:49 UTC (rev 6931)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2009-02-24
21:56:19 UTC (rev 6932)
@@ -112,7 +112,7 @@
def seq_allequal(seq1, seq2):
"""
- seq1 and seq2 are either None or sequences or numerix arrays
+ seq1 and seq2 are either None or sequences or arrays
Return True if both are None or both are seqs with identical
elements
"""
Modified: trunk/matplotlib/lib/matplotlib/config/mplconfig.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2009-02-24 21:15:49 UTC
(rev 6931)
+++ trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2009-02-24 21:56:19 UTC
(rev 6932)
@@ -58,7 +58,6 @@
toolbar = T.Trait('toolbar2', 'toolbar2', None)
timezone = T.Trait('UTC', pytz.all_timezones)
datapath = T.Trait(cutils.get_data_path())
- numerix = T.Trait('numpy', 'numpy', 'numeric', 'numarray')
units = T.false
class backend(TConfig):
@@ -290,7 +289,6 @@
self.tconfig_map = {
'backend' : (self.tconfig.backend, 'use'),
'backend_fallback' : (self.tconfig.backend, 'fallback'),
- 'numerix' : (self.tconfig, 'numerix'),
'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 2009-02-24 21:15:49 UTC
(rev 6931)
+++ trunk/matplotlib/lib/matplotlib/config/rcsetup.py 2009-02-24 21:56:19 UTC
(rev 6932)
@@ -75,10 +75,6 @@
'QtAgg', 'Qt4Agg', 'SVG', 'Template', 'TkAgg', 'WX', 'WXAgg',
], ignorecase=True)
-validate_numerix = ValidateInStrings('numerix',[
- 'Numeric','numarray','numpy',
- ], ignorecase=True)
-
validate_toolbar = ValidateInStrings('toolbar',[
'None','classic','toolbar2',
], ignorecase=True)
@@ -298,7 +294,6 @@
# a map from key -> value, converter
defaultParams = {
'backend' : ['WXAgg', validate_backend],
- 'numerix' : ['numpy', validate_numerix],
'toolbar' : ['toolbar2', validate_toolbar],
'datapath' : [None, validate_path_exists], # handled by
_get_data_path_cached
'units' : [False, validate_bool],
Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/rcsetup.py 2009-02-24 21:15:49 UTC (rev
6931)
+++ trunk/matplotlib/lib/matplotlib/rcsetup.py 2009-02-24 21:56:19 UTC (rev
6932)
@@ -106,10 +106,18 @@
if s.startswith('module://'): return s
else: return _validate_standard_backends(s)
-validate_numerix = ValidateInStrings('numerix',[
- 'Numeric','numarray','numpy',
- ], ignorecase=True)
+def validate_numerix(v):
+ # 2009/02/24: start warning; later, remove all traces
+ try:
+ if v == 'obsolete':
+ return v
+ except ValueError:
+ pass
+ warnings.warn('rcParams key "numerix" is obsolete and has no effect;\n'
+ ' please delete it from your matplotlibrc file')
+
+
validate_toolbar = ValidateInStrings('toolbar',[
'None','classic','toolbar2',
], ignorecase=True)
@@ -323,7 +331,7 @@
defaultParams = {
'backend' : ['Agg', validate_backend], # agg is certainly present
'backend_fallback' : [True, validate_bool], # agg is certainly present
- 'numerix' : ['numpy', validate_numerix],
+ 'numerix' : ['obsolete', validate_numerix],
'maskedarray' : ['obsolete', validate_maskedarray], #to be removed
'toolbar' : ['toolbar2', validate_toolbar],
'datapath' : [None, validate_path_exists], # handled by
_get_data_path_cached
Modified: trunk/matplotlib/matplotlibrc.template
===================================================================
--- trunk/matplotlib/matplotlibrc.template 2009-02-24 21:15:49 UTC (rev
6931)
+++ trunk/matplotlib/matplotlibrc.template 2009-02-24 21:56:19 UTC (rev
6932)
@@ -34,7 +34,6 @@
# conflicts, we will automatically try and find a compatible one for
# you if backend_fallback is True
#backend_fallback: True
-numerix : %(numerix)s # numpy, Numeric or numarray
#interactive : False
#toolbar : toolbar2 # None | classic | toolbar2
#timezone : UTC # a pytz timezone string, eg US/Central or
Europe/Paris
Modified: trunk/matplotlib/setup.py
===================================================================
--- trunk/matplotlib/setup.py 2009-02-24 21:15:49 UTC (rev 6931)
+++ trunk/matplotlib/setup.py 2009-02-24 21:56:19 UTC (rev 6932)
@@ -18,7 +18,7 @@
# This dict will be updated as we try to select the best option during
# the build process. However, values in setup.cfg will be used, if
# defined.
-rc = {'backend':'Agg', 'numerix':'numpy'}
+rc = {'backend':'Agg'}
# BEFORE importing disutils, remove MANIFEST. distutils doesn't properly
# update it when the contents of directories change.
@@ -52,13 +52,6 @@
'matplotlib.projections',
# 'matplotlib.toolkits',
'mpl_toolkits',
- 'matplotlib.numerix',
- 'matplotlib.numerix.mlab',
- 'matplotlib.numerix.ma',
- 'matplotlib.numerix.npyma',
- 'matplotlib.numerix.linear_algebra',
- 'matplotlib.numerix.random_array',
- 'matplotlib.numerix.fft',
'matplotlib.sphinxext'
]
@@ -224,14 +217,12 @@
# Write the default matplotlibrc file
if options['backend']: rc['backend'] = options['backend']
-if options['numerix']: rc['numerix'] = options['numerix']
template = file('matplotlibrc.template').read()
file('lib/matplotlib/mpl-data/matplotlibrc', 'w').write(template%rc)
# Write the default matplotlib.conf file
template = file('lib/matplotlib/mpl-data/matplotlib.conf.template').read()
template = template.replace("datapath = ", "#datapath = ")
-template = template.replace("numerix = 'numpy'", "numerix =
'%s'"%rc['numerix'])
template = template.replace(" use = 'Agg'", " use = '%s'"%rc['backend'])
file('lib/matplotlib/mpl-data/matplotlib.conf', 'w').write(template)
Modified: trunk/matplotlib/setupext.py
===================================================================
--- trunk/matplotlib/setupext.py 2009-02-24 21:15:49 UTC (rev 6931)
+++ trunk/matplotlib/setupext.py 2009-02-24 21:56:19 UTC (rev 6932)
@@ -106,8 +106,7 @@
'build_macosx': 'auto',
'build_image': True,
'build_windowing': True,
- 'backend': None,
- 'numerix': None}
+ 'backend': None}
# Based on the contents of setup.cfg, determine the build options
if os.path.exists("setup.cfg"):
@@ -142,10 +141,7 @@
try: options['backend'] = config.get("rc_options", "backend")
except: pass
- try: options['numerix'] = config.get("rc_options", "numerix")
- except: pass
-
if options['display_status']:
def print_line(char='='):
print char * 76
Modified: trunk/matplotlib/test/mplTest/units/UnitDblConverter.py
===================================================================
--- trunk/matplotlib/test/mplTest/units/UnitDblConverter.py 2009-02-24
21:15:49 UTC (rev 6931)
+++ trunk/matplotlib/test/mplTest/units/UnitDblConverter.py 2009-02-24
21:56:19 UTC (rev 6932)
@@ -9,9 +9,9 @@
#===========================================================================
# Place all imports after here.
#
+import numpy as np
import matplotlib.units as units
import matplotlib.ticker as ticker
-import matplotlib.numerix as nx
import matplotlib.projections.polar as polar
from matplotlib.cbook import iterable
#
@@ -27,7 +27,7 @@
# This was copied from matplotlib example code.
def rad_fn(x, pos = None ):
"""Radian function formatter."""
- n = int((x / nx.pi) * 2.0 + 0.25)
+ n = int((x / np.pi) * 2.0 + 0.25)
if n == 0:
return str(x)
elif n == 1:
Modified: trunk/matplotlib/test/test_backends/TestAgg.py
===================================================================
--- trunk/matplotlib/test/test_backends/TestAgg.py 2009-02-24 21:15:49 UTC
(rev 6931)
+++ trunk/matplotlib/test/test_backends/TestAgg.py 2009-02-24 21:56:19 UTC
(rev 6932)
@@ -11,7 +11,7 @@
import sys, time, os
from matplotlib.ft2font import FT2Font
-from matplotlib.numerix import rand
+from numpy.random import rand
from matplotlib.backend_bases import GraphicsContextBase
from matplotlib.backends._backend_agg import RendererAgg
@@ -89,7 +89,7 @@
font.set_size( 12, 72 )
o.draw_text_image( font.get_image(), 30, 40, gc )
-
+
o.write_png( fname % i )
val = report_memory( i )
if i==1: start = val
Modified: trunk/matplotlib/unit/agg_memleak.py
===================================================================
--- trunk/matplotlib/unit/agg_memleak.py 2009-02-24 21:15:49 UTC (rev
6931)
+++ trunk/matplotlib/unit/agg_memleak.py 2009-02-24 21:56:19 UTC (rev
6932)
@@ -1,6 +1,10 @@
+"""
+And another broken test...
+"""
+
import sys, time, os
from matplotlib.ft2font import FT2Font
-from matplotlib.numerix import rand
+from numpy.random import rand
from matplotlib.backend_bases import GraphicsContextBase
from matplotlib.backends._backend_agg import RendererAgg
@@ -23,7 +27,7 @@
ys = [400*int(rand()) for k in range(8)]
rgb = (1,0,0)
pnts = zip(xs, ys)
- o.draw_polygon(gc, rgb, pnts)
+ o.draw_polygon(gc, rgb, pnts) # no such method??
o.draw_polygon(gc, None, pnts)
for j in range(50):
Modified: trunk/matplotlib/unit/ft2font_memleak.py
===================================================================
--- trunk/matplotlib/unit/ft2font_memleak.py 2009-02-24 21:15:49 UTC (rev
6931)
+++ trunk/matplotlib/unit/ft2font_memleak.py 2009-02-24 21:56:19 UTC (rev
6932)
@@ -1,7 +1,10 @@
+"""
+This appears to be obsolete as of 2009/02/24; a key import fails.
+"""
import sys, time, os
-from matplotlib.numerix import rand
+from numpy.random import rand
from matplotlib.ft2font import FT2Font
-from matplotlib.backends.backend_ps import encodeTTFasPS
+from matplotlib.backends.backend_ps import encodeTTFasPS # doesn't exist...
fname = '/usr/local/share/matplotlib/Vera.ttf'
Modified: trunk/matplotlib/unit/inside_poly_memleak.py
===================================================================
--- trunk/matplotlib/unit/inside_poly_memleak.py 2009-02-24 21:15:49 UTC
(rev 6931)
+++ trunk/matplotlib/unit/inside_poly_memleak.py 2009-02-24 21:56:19 UTC
(rev 6932)
@@ -1,8 +1,11 @@
#!/usr/bin/env python
+"""
+Another broken test...
+"""
import os, sys, time
import matplotlib.nxutils as nxutils
-import matplotlib.numerix as nx
+from numpy.random import rand
def report_memory(i):
pid = os.getpid()
@@ -14,12 +17,12 @@
for i in range(500):
report_memory(i)
- verts = nx.mlab.rand(100, 2)
- b = nxutils.pnpoly(x, y, verts)
+ verts = rand(100, 2)
+ b = nxutils.pnpoly(x, y, verts) # x, y don't exist
for i in range(500):
report_memory(i)
- verts = nx.mlab.rand(100, 2)
- points = nx.mlab.rand(10000,2)
+ verts = rand(100, 2)
+ points = rand(10000,2)
mask = nxutils.points_inside_poly(points, verts)
Modified: trunk/matplotlib/unit/inside_poly_profile.py
===================================================================
--- trunk/matplotlib/unit/inside_poly_profile.py 2009-02-24 21:15:49 UTC
(rev 6931)
+++ trunk/matplotlib/unit/inside_poly_profile.py 2009-02-24 21:56:19 UTC
(rev 6932)
@@ -1,7 +1,11 @@
+"""
+Broken.
+"""
+
import os, sys, time
import matplotlib.nxutils as nxutils
-import matplotlib.numerix as nx
+from numpy.random import rand
import matplotlib.mlab
import matplotlib.patches as patches
if 1:
@@ -10,13 +14,14 @@
t0 = time.time()
for i in range(numtrials):
- points = nx.mlab.rand(numpoints,2)
+ points = rand(numpoints,2)
mask = matplotlib.mlab._inside_poly_deprecated(points, verts)
+ ### no such thing
told = time.time() - t0
t0 = time.time()
for i in range(numtrials):
- points = nx.mlab.rand(numpoints,2)
+ points = rand(numpoints,2)
mask = nxutils.points_inside_poly(points, verts)
tnew = time.time() - t0
print numverts, numpoints, told, tnew, told/tnew
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins