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

scipy-svn at scipy.org scipy-svn at scipy.org
Tue Jan 2 09:31:33 CST 2007


Author: mattknox_ca
Date: 2007-01-02 09:31:29 -0600 (Tue, 02 Jan 2007)
New Revision: 2470

Modified:
   trunk/Lib/sandbox/timeseries/timeseries.py
Log:
fixed bug with series of type date losing their data type when performing operations on them

Modified: trunk/Lib/sandbox/timeseries/timeseries.py
===================================================================
--- trunk/Lib/sandbox/timeseries/timeseries.py	2007-01-02 14:23:02 UTC (rev 2469)
+++ trunk/Lib/sandbox/timeseries/timeseries.py	2007-01-02 15:31:29 UTC (rev 2470)
@@ -45,9 +45,15 @@
             ts_compatible(a, b)
             return TimeSeries(self.f(a, b, *args, **kwargs), freq=a.freq, observed=a.observed, start_date=a.start_date())
         elif isinstance(a, TimeSeries):
-            return TimeSeries(self.f(a, b, *args, **kwargs), freq=a.freq, observed=a.observed, start_date=a.start_date())
+            if corelib.isDateType(a.tstype):
+                return TimeSeries(self.f(a, b, *args, **kwargs), dtype=a.tstype, freq=a.freq, observed=a.observed, start_date=a.start_date())
+            else:
+                return TimeSeries(self.f(a, b, *args, **kwargs), freq=a.freq, observed=a.observed, start_date=a.start_date())
         elif isinstance(b, TimeSeries):
-            return TimeSeries(self.f(a, b, *args, **kwargs), freq=b.freq, observed=b.observed, start_date=b.start_date())
+            if corelib.isDateType(b.tstype):
+                return TimeSeries(self.f(a, b, *args, **kwargs), dtype=b.tstype, freq=b.freq, observed=b.observed, start_date=b.start_date())
+            else:
+                return TimeSeries(self.f(a, b, *args, **kwargs), freq=b.freq, observed=b.observed, start_date=b.start_date())
         else:
             return self.f(a, b, *args, **kwargs)
             



More information about the Scipy-svn mailing list