From: <jd...@us...> - 2008-10-08 19:54:07
|
Revision: 6173 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6173&view=rev Author: jdh2358 Date: 2008-10-08 19:53:57 +0000 (Wed, 08 Oct 2008) Log Message: ----------- fixed deprecation warning in legend Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/legend.py trunk/matplotlib/lib/matplotlib/mlab.py Modified: trunk/matplotlib/lib/matplotlib/legend.py =================================================================== --- trunk/matplotlib/lib/matplotlib/legend.py 2008-10-08 18:16:49 UTC (rev 6172) +++ trunk/matplotlib/lib/matplotlib/legend.py 2008-10-08 19:53:57 UTC (rev 6173) @@ -124,7 +124,7 @@ value=rcParams["legend."+name] setattr(self,name,value) if pad: - warnings.DeprecationWarning("Use 'borderpad' instead of 'pad'.") + warnings.warn("Use 'borderpad' instead of 'pad'.", DeprecationWarning) # 2008/10/04 if self.numpoints <= 0: raise ValueError("numpoints must be >= 0; it was %d"% numpoints) Modified: trunk/matplotlib/lib/matplotlib/mlab.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mlab.py 2008-10-08 18:16:49 UTC (rev 6172) +++ trunk/matplotlib/lib/matplotlib/mlab.py 2008-10-08 19:53:57 UTC (rev 6173) @@ -1799,8 +1799,9 @@ def rec_join(key, r1, r2, jointype='inner', defaults=None, r1postfix='1', r2postfix='2'): """ - join record arrays r1 and r2 on key; key is a tuple of field - names. If r1 and r2 have equal values on all the keys in the key + join record arrays r1 and r2 on key; key is a tuple of field names + -- if key is a string it is assumed to be a single attribute + name. If r1 and r2 have equal values on all the keys in the key tuple, then their fields will be merged into a new record array containing the intersection of the fields of r1 and r2. @@ -1812,10 +1813,13 @@ The defaults keyword is a dictionary filled with {column_name:default_value} pairs. - The keywords r1postfix and r2postfix are postfixed to column names + The keywords r1postfix and r2postfix are postfixed to column names (other than keys) that are both in r1 and r2. """ + if cbook.is_string_like(key): + key = (key, ) + for name in key: if name not in r1.dtype.names: raise ValueError('r1 does not have key field %s'%name) @@ -1862,7 +1866,7 @@ keydesc = [key_desc(name) for name in key] - + def mapped_r1field(name): """ the column name in newrec that corresponds to the colmn in r1 """ if name in key or name not in r2.dtype.names: return name This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |