SF.net SVN: matplotlib:[6095] trunk/matplotlib/lib/matplotlib/axes.py

2008-09-15 Thread jrevans
Revision: 6095
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6095&view=rev
Author:   jrevans
Date: 2008-09-15 19:58:25 + (Mon, 15 Sep 2008)

Log Message:
---
Fixed bug #1889750.
Now an axes will not attempt to determine the default units to use if units 
have already been determined for a particular Axis.
Previously, by doing this it would override any axis labels set whenever any 
unit determination calls were made.  This can still happen, but now some of the 
unneccessary unit determination calls are no longer being made.

Modified Paths:
--
trunk/matplotlib/lib/matplotlib/axes.py

Modified: trunk/matplotlib/lib/matplotlib/axes.py
===
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-09-14 19:18:54 UTC (rev 
6094)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-09-15 19:58:25 UTC (rev 
6095)
@@ -1374,11 +1374,15 @@
 
 #print 'processing', self.get_geometry()
 if xdata is not None:
-self.xaxis.update_units(xdata)
+# we only need to update if there is nothing set yet.
+if not self.xaxis.have_units():
+   self.xaxis.update_units(xdata)
 #print '\tset from xdata', self.xaxis.units
 
 if ydata is not None:
-self.yaxis.update_units(ydata)
+# we only need to update if there is nothing set yet.
+if not self.yaxis.have_units():
+   self.yaxis.update_units(ydata)
 #print '\tset from ydata', self.yaxis.units
 
 # process kwargs 2nd since these will override default units


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[6097] trunk/matplotlib/lib/matplotlib

2008-09-15 Thread jrevans
Revision: 6097
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6097&view=rev
Author:   jrevans
Date: 2008-09-15 23:09:24 + (Mon, 15 Sep 2008)

Log Message:
---
Fixed contour to now properly strip away units for unitized data on the x and y 
axes.
Unit registry now properly determines the registered converter to use for 
nested array data types.

Modified Paths:
--
trunk/matplotlib/lib/matplotlib/contour.py
trunk/matplotlib/lib/matplotlib/units.py

Modified: trunk/matplotlib/lib/matplotlib/contour.py
===
--- trunk/matplotlib/lib/matplotlib/contour.py  2008-09-15 19:59:47 UTC (rev 
6096)
+++ trunk/matplotlib/lib/matplotlib/contour.py  2008-09-15 23:09:24 UTC (rev 
6097)
@@ -724,8 +724,12 @@
 Possible change: I think we should make and use an ArgumentError
 Exception class (here and elsewhere).
 '''
-x = np.asarray(args[0], dtype=np.float64)
-y = np.asarray(args[1], dtype=np.float64)
+# We can strip away the x and y units
+x = self.ax.convert_xunits( args[0] )
+y = self.ax.convert_yunits( args[1] )
+
+x = np.asarray(x, dtype=np.float64)
+y = np.asarray(y, dtype=np.float64)
 z = ma.asarray(args[2], dtype=np.float64)
 if z.ndim != 2:
 raise TypeError("Input z must be a 2D array.")

Modified: trunk/matplotlib/lib/matplotlib/units.py
===
--- trunk/matplotlib/lib/matplotlib/units.py2008-09-15 19:59:47 UTC (rev 
6096)
+++ trunk/matplotlib/lib/matplotlib/units.py2008-09-15 23:09:24 UTC (rev 
6097)
@@ -128,12 +128,9 @@
 
 if converter is None and iterable(x):
 for thisx in x:
-classx = getattr(thisx, '__class__', None)
-break
-if classx is not None:
-converter = self.get(classx)
+converter = self.get_converter( thisx )
+if converter: break
 
-
 #DISABLED self._cached[idx] = converter
 return converter
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins