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

scipy-svn at scipy.org scipy-svn at scipy.org
Fri Jan 26 15:39:53 CST 2007


Author: mattknox_ca
Date: 2007-01-26 15:39:45 -0600 (Fri, 26 Jan 2007)
New Revision: 2616

Modified:
   trunk/Lib/sandbox/timeseries/tdates.py
Log:
fixed bugs with empty DateArray's

Modified: trunk/Lib/sandbox/timeseries/tdates.py
===================================================================
--- trunk/Lib/sandbox/timeseries/tdates.py	2007-01-26 21:20:10 UTC (rev 2615)
+++ trunk/Lib/sandbox/timeseries/tdates.py	2007-01-26 21:39:45 UTC (rev 2616)
@@ -708,15 +708,20 @@
             warnings.warn("Undefined frequency: assuming daily!")
         if self.__steps is None:
             val = numeric.asarray(self).ravel()
-            if val.size > 0:
+            if val.size > 1:
                 steps = val[1:] - val[:-1]
                 if self.__full is None:
                     self.__full = (steps.max() == 1)
                 if self.__hasdups is None:
                     self.__hasdups = (steps.min() == 0)
-            else:
+            elif val.size == 1:
                 self.__full = True
                 self.__hasdups = False
+                steps = numeric.array([], dtype=int_)
+            else:
+                self.__full = False
+                self.__hasdups = False
+                steps = None
             self.__steps = steps
         return self.__steps
     



More information about the Scipy-svn mailing list