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

scipy-svn@scip... scipy-svn@scip...
Thu Feb 22 14:50:15 CST 2007


Author: mattknox_ca
Date: 2007-02-22 14:50:12 -0600 (Thu, 22 Feb 2007)
New Revision: 2752

Modified:
   trunk/Lib/sandbox/timeseries/tcore.py
Log:
changed frequency dict to use constants defined in C

Modified: trunk/Lib/sandbox/timeseries/tcore.py
===================================================================
--- trunk/Lib/sandbox/timeseries/tcore.py	2007-02-22 20:49:45 UTC (rev 2751)
+++ trunk/Lib/sandbox/timeseries/tcore.py	2007-02-22 20:50:12 UTC (rev 2752)
@@ -18,6 +18,15 @@
 import maskedarray as MA
 from maskedarray import masked, nomask, getmask
 
+from cseries import TSER_CONSTANTS
+
+"""add constants in cfame.FAME_CONSTANTS dictionary to global namespace
+for this module"""
+
+_g = globals()
+_g.update(TSER_CONSTANTS)
+
+
 #####---------------------------------------------------------------------------
 #---- --- Generic functions ---
 #####---------------------------------------------------------------------------
@@ -82,16 +91,16 @@
 
 
 
-freq_dict = { 1000: ['A','Y','ANNUAL','ANNUALLY','YEAR','YEARLY'],
-              2000: ['Q','QUARTER','QUARTERLY',],
-              3000: ['M','MONTH','MONTHLY',],
-              4000: ['W','WEEK','WEEKLY',],
-              5000: ['B','BUSINESS','BUSINESSLY'],
-              6000: ['D','DAY','DAILY',],
-              7000: ['H','HOUR','HOURLY',],
-              8000: ['T','MINUTE','MINUTELY',],
-              9000: ['S','SECOND','SECONDLY',],
-             -9999: ['U','UNDEF','UNDEFINED'],
+freq_dict = { FR_ANN: ['A','Y','ANNUAL','ANNUALLY','YEAR','YEARLY'],
+              FR_QTR: ['Q','QUARTER','QUARTERLY',],
+              FR_MTH: ['M','MONTH','MONTHLY',],
+              FR_WK: ['W','WEEK','WEEKLY',],
+              FR_BUS: ['B','BUSINESS','BUSINESSLY'],
+              FR_DAY: ['D','DAY','DAILY',],
+              FR_HR: ['H','HOUR','HOURLY',],
+              FR_MIN: ['T','MINUTE','MINUTELY',],
+              FR_SEC: ['S','SECOND','SECONDLY',],
+              FR_UND: ['U','UNDEF','UNDEFINED'],
                 }
 freq_revdict = reverse_dict(freq_dict)
 



More information about the Scipy-svn mailing list