[Scipy-svn] r2856 - trunk/Lib/sandbox/timeseries/src

scipy-svn@scip... scipy-svn@scip...
Tue Mar 20 12:47:24 CDT 2007


Author: mattknox_ca
Date: 2007-03-20 12:47:20 -0500 (Tue, 20 Mar 2007)
New Revision: 2856

Modified:
   trunk/Lib/sandbox/timeseries/src/cseries.c
Log:
added cseries_get_freq_group function

Modified: trunk/Lib/sandbox/timeseries/src/cseries.c
===================================================================
--- trunk/Lib/sandbox/timeseries/src/cseries.c	2007-03-20 17:40:17 UTC (rev 2855)
+++ trunk/Lib/sandbox/timeseries/src/cseries.c	2007-03-20 17:47:20 UTC (rev 2856)
@@ -2463,6 +2463,20 @@
     return result;
 }
 
+static char cseries_get_freq_group_doc[] =
+"translate user specified frequency into frequency group constant";
+static PyObject *
+cseries_get_freq_group(PyObject *self, PyObject *args) {
+
+    PyObject *freq;
+    int freq_val;
+
+    if (!PyArg_ParseTuple(args, "O:get_freq_group(freq)", &freq)) return NULL;
+    if ((freq_val = check_freq(freq)) == INT_ERR_CODE) return NULL;
+
+    return PyInt_FromLong(get_freq_group(freq_val));
+}
+
 static char cseries_thisday_doc[] =
 "Returns today's date, at the given frequency\n\n"
 ":Parameters:\n"
@@ -2860,6 +2874,7 @@
     {"thisday", cseries_thisday, METH_VARARGS, cseries_thisday_doc},
     {"check_freq", cseries_check_freq, METH_VARARGS, cseries_check_freq_doc},
     {"check_freq_str", cseries_check_freq_str, METH_VARARGS, cseries_check_freq_str_doc},
+    {"get_freq_group", cseries_get_freq_group, METH_VARARGS, cseries_get_freq_group_doc},
 
     {"set_callback_DateFromString", set_callback_DateFromString, METH_VARARGS,
      set_callback_DateFromString_doc},



More information about the Scipy-svn mailing list