[Scipy-svn] r2960 - in trunk/Lib/sandbox/timeseries: . plotlib

scipy-svn at scipy.org scipy-svn at scipy.org
Fri May 4 11:43:38 EDT 2007


Author: pierregm
Date: 2007-05-04 10:43:31 -0500 (Fri, 04 May 2007)
New Revision: 2960

Modified:
   trunk/Lib/sandbox/timeseries/
   trunk/Lib/sandbox/timeseries/plotlib/mpl_timeseries.py
   trunk/Lib/sandbox/timeseries/tdates.py
   trunk/Lib/sandbox/timeseries/tseries.py
Log:
mpl_timeseries : prevent series as a keyword of add_tsplot to be overwritten if the figure has no linked series yet.
tseries : quicki fix : raise an exception if the input series has more than one variable (to prevent segfault).


Property changes on: trunk/Lib/sandbox/timeseries
___________________________________________________________________
Name: svn:ignore
   - sandbox
quicktest.py
build

   + sandbox
quicktest.py
build
addons
buildlog


Modified: trunk/Lib/sandbox/timeseries/plotlib/mpl_timeseries.py
===================================================================
--- trunk/Lib/sandbox/timeseries/plotlib/mpl_timeseries.py	2007-05-03 18:52:46 UTC (rev 2959)
+++ trunk/Lib/sandbox/timeseries/plotlib/mpl_timeseries.py	2007-05-04 15:43:31 UTC (rev 2960)
@@ -833,8 +833,9 @@
     #.........
     def add_tsplot(self, *args, **kwargs):
         """Adds a `TimeSeriesPlot` subplot to the figure."""
-        kwargs.update(SubplotClass=TimeSeriesPlot,
-                      series=self._series)
+        kwargs.update(SubplotClass=TimeSeriesPlot)
+        if self._series is not None:
+            kwargs.update(series=self._series)
         return add_generic_subplot(self, *args, **kwargs)
     add_plot = add_tsplot
 TSFigure = TimeSeriesFigure

Modified: trunk/Lib/sandbox/timeseries/tdates.py
===================================================================
--- trunk/Lib/sandbox/timeseries/tdates.py	2007-05-03 18:52:46 UTC (rev 2959)
+++ trunk/Lib/sandbox/timeseries/tdates.py	2007-05-04 15:43:31 UTC (rev 2960)
@@ -3,12 +3,12 @@
 
 :author: Pierre GF Gerard-Marchant & Matt Knox
 :contact: pierregm_at_uga_dot_edu - mattknox_ca_at_hotmail_dot_com
-:version: $Id: tdates.py 2815 2007-03-02 16:39:07Z mattknox_ca $
+:version: $Id$
 """
-__author__ = "Pierre GF Gerard-Marchant & Matt Knox ($Author: mattknox_ca $)"
+__author__ = "Pierre GF Gerard-Marchant & Matt Knox ($Author$)"
 __version__ = '1.0'
-__revision__ = "$Revision: 2815 $"
-__date__     = '$Date: 2007-03-02 11:39:07 -0500 (Fri, 02 Mar 2007) $'
+__revision__ = "$Revision$"
+__date__     = '$Date$'
 
 import datetime as dt
 

Modified: trunk/Lib/sandbox/timeseries/tseries.py
===================================================================
--- trunk/Lib/sandbox/timeseries/tseries.py	2007-05-03 18:52:46 UTC (rev 2959)
+++ trunk/Lib/sandbox/timeseries/tseries.py	2007-05-04 15:43:31 UTC (rev 2960)
@@ -43,6 +43,7 @@
 import cseries
 
 
+
 __all__ = [
 'TimeSeriesError','TimeSeriesCompatibilityError','TimeSeries','isTimeSeries',
 'time_series', 'tsmasked',
@@ -1208,6 +1209,9 @@
     tempData = series._series.filled()
     tempMask = getmaskarray(series)
 
+    if (tempData.size // series._dates.size) > 1:
+        raise TimeSeriesError("convert works with 1D data only !")
+
     cRetVal = cseries.TS_convert(tempData, fromFreq, toFreq, position,
                                  int(start_date), tempMask)
     _values = cRetVal['values']




More information about the Scipy-svn mailing list