[Scipy-svn] r2588 - trunk/Lib/sandbox/timeseries/tests

scipy-svn at scipy.org scipy-svn at scipy.org
Mon Jan 22 15:29:54 CST 2007


Author: mattknox_ca
Date: 2007-01-22 15:29:50 -0600 (Mon, 22 Jan 2007)
New Revision: 2588

Modified:
   trunk/Lib/sandbox/timeseries/tests/test_timeseries.py
Log:
added test for using DateArray as the data in a TimeSeries

Modified: trunk/Lib/sandbox/timeseries/tests/test_timeseries.py
===================================================================
--- trunk/Lib/sandbox/timeseries/tests/test_timeseries.py	2007-01-22 21:15:50 UTC (rev 2587)
+++ trunk/Lib/sandbox/timeseries/tests/test_timeseries.py	2007-01-22 21:29:50 UTC (rev 2588)
@@ -19,6 +19,7 @@
 from numpy.testing.utils import build_err_msg
 
 import maskedarray
+import maskedarray as MA
 from maskedarray import masked_array, masked, nomask
 
 import maskedarray.testutils
@@ -70,6 +71,26 @@
         assert_equal(series._dates, dates)
         assert_equal(series.freq, 'D')
         
+        
+    def test_fromdatearray(self):
+        _, dates, _ = self.d
+        data = dates.copy()
+        data = dates
+    
+        series = time_series(data, dates)
+        assert(isinstance(series, TimeSeries))
+        assert_equal(series._dates, dates)
+        assert_equal(series._data, data)
+        assert_equal(series.freq, 'D')
+        
+        series[5] = MA.masked
+        
+        # ensure that series can be represented by a string after masking a value
+        # (there was a bug before that prevented this from working when using a 
+        # DateArray for the data)
+        strrep = str(series)
+        
+        
     def test_datafromlist(self):
         (_, dates, _) = self.d
         data = list(range(15))



More information about the Scipy-svn mailing list