[Scipy-svn] r2837 - trunk/Lib/sandbox/timeseries/plotlib

scipy-svn@scip... scipy-svn@scip...
Wed Mar 7 10:58:48 CST 2007


Author: mattknox_ca
Date: 2007-03-07 10:58:45 -0600 (Wed, 07 Mar 2007)
New Revision: 2837

Modified:
   trunk/Lib/sandbox/timeseries/plotlib/mpl_timeseries.py
Log:
modified code to work with new annual frequencies

Modified: trunk/Lib/sandbox/timeseries/plotlib/mpl_timeseries.py
===================================================================
--- trunk/Lib/sandbox/timeseries/plotlib/mpl_timeseries.py	2007-03-07 16:58:14 UTC (rev 2836)
+++ trunk/Lib/sandbox/timeseries/plotlib/mpl_timeseries.py	2007-03-07 16:58:45 UTC (rev 2837)
@@ -426,7 +426,7 @@
         return dict([(d,f) for (d,f) in zip(dates[formatted],format[formatted])])
 #...............................................................................
 def _annual_finder(vmin, vmax, freq, aslocator):
-    if freq != TS.FR_ANN: 
+    if TS.get_freq_group(freq) != TS.FR_ANN: 
         raise ValueError("unexpected frequency")   
     (vmin, vmax) = (int(vmin), int(vmax+1))
     span = vmax - vmin + 1
@@ -457,12 +457,13 @@
                  base=1, quarter=1, month=1, day=1):
         self.freq = freq
         self.base = base
+        fgroup = TS.get_freq_group(freq)
         (self.quarter, self.month, self.day) = (quarter, month, day)
         self.isminor = minor_locator
         self.isdynamic = dynamic_mode
         self.offset = 0
         #.....
-        if freq == TS.FR_ANN:
+        if fgroup == TS.FR_ANN:
             self.finder = _annual_finder
         elif freq == TS.FR_QTR:
             self.finder = _quarterly_finder
@@ -530,8 +531,9 @@
         self.isminor = minor_locator
         self.isdynamic = dynamic_mode
         self.offset = 0
+        fgroup = TS.get_freq_group(freq)
         #.....
-        if freq == TS.FR_ANN:
+        if fgroup == TS.FR_ANN:
             self.finder = _annual_finder
         elif freq == TS.FR_QTR:
             self.finder = _quarterly_finder



More information about the Scipy-svn mailing list