Revision: 6165
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6165&view=rev
Author:   jdh2358
Date:     2008-10-07 15:13:13 +0000 (Tue, 07 Oct 2008)

Log Message:
-----------
added michaels unit detection optimization for arrays

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

Modified: trunk/matplotlib/lib/matplotlib/units.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/units.py    2008-10-07 06:31:29 UTC (rev 
6164)
+++ trunk/matplotlib/lib/matplotlib/units.py    2008-10-07 15:13:13 UTC (rev 
6165)
@@ -43,6 +43,7 @@
     units.registry[datetime.date] = DateConverter()
 
 """
+import numpy as np
 from matplotlib.cbook import iterable, is_numlike
 
 class AxisInfo:
@@ -127,6 +128,11 @@
             converter = self.get(classx)
 
         if converter is None and iterable(x):
+            # if this is anything but an object array, we'll assume
+            # there are no custom units
+            if isinstance(x, np.ndarray) and x.dtype != np.object:
+                return None
+
             for thisx in x:
                 converter = self.get_converter( thisx )
                 if converter: break


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

Reply via email to