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

scipy-svn@scip... scipy-svn@scip...
Tue Feb 27 09:04:13 CST 2007


Author: mattknox_ca
Date: 2007-02-27 09:04:10 -0600 (Tue, 27 Feb 2007)
New Revision: 2771

Modified:
   trunk/Lib/sandbox/timeseries/tdates.py
Log:
changed "ValueError" to "IndexError" for "Date out of Bounds" errors in DateArray

Modified: trunk/Lib/sandbox/timeseries/tdates.py
===================================================================
--- trunk/Lib/sandbox/timeseries/tdates.py	2007-02-27 14:05:18 UTC (rev 2770)
+++ trunk/Lib/sandbox/timeseries/tdates.py	2007-02-27 15:04:10 UTC (rev 2771)
@@ -733,7 +733,7 @@
             c += (self == d.value)
         c = c.nonzero()
         if fromnumeric.size(c) == 0:
-            raise ValueError, "Date out of bounds!"
+            raise IndexError, "Date out of bounds!"
         return c  
 
     def date_to_index(self, date):
@@ -741,12 +741,12 @@
         if self.isvalid():
             index = date.value - self[0].value
             if index < 0 or index > self.size:
-                raise ValueError, "Date out of bounds!"
+                raise IndexError, "Date out of bounds!"
             return index
         else:
             index_asarray = (self == date.value).nonzero()
             if fromnumeric.size(index_asarray) == 0:
-                raise ValueError, "Date out of bounds!" 
+                raise IndexError, "Date out of bounds!" 
             return index_asarray[0][0]
     #......................................................        
     def get_steps(self):



More information about the Scipy-svn mailing list