[Scipy-svn] r2727 - trunk/Lib/sandbox/timeseries

scipy-svn@scip... scipy-svn@scip...
Mon Feb 19 09:08:16 CST 2007


Author: mattknox_ca
Date: 2007-02-19 09:08:12 -0600 (Mon, 19 Feb 2007)
New Revision: 2727

Modified:
   trunk/Lib/sandbox/timeseries/tdates.py
Log:
fixed problem causing test_fromdatearray in test_timeseries.py to fail (strrep)

Modified: trunk/Lib/sandbox/timeseries/tdates.py
===================================================================
--- trunk/Lib/sandbox/timeseries/tdates.py	2007-02-19 07:37:26 UTC (rev 2726)
+++ trunk/Lib/sandbox/timeseries/tdates.py	2007-02-19 15:08:12 UTC (rev 2727)
@@ -539,7 +539,11 @@
         r = ndarray.__getitem__(self, indx)
         if isinstance(r, (generic, int)):
             return Date(self.freq, value=r)
-        elif r.size == 1:
+        elif hasattr(r, 'size') and r.size == 1:
+            # need to check if it has a size attribute for situations
+            # like when the datearray is the data for a maskedarray
+            # or some other subclass of ndarray with wierd getitem
+            # behaviour
             return Date(self.freq, value=r.item())
         else:
             return r



More information about the Scipy-svn mailing list