[Scipy-svn] r2570 - in trunk/Lib/sandbox/timeseries: . tests

scipy-svn at scipy.org scipy-svn at scipy.org
Mon Jan 15 22:43:12 CST 2007


Author: pierregm
Date: 2007-01-15 22:43:06 -0600 (Mon, 15 Jan 2007)
New Revision: 2570

Modified:
   trunk/Lib/sandbox/timeseries/
   trunk/Lib/sandbox/timeseries/.project
   trunk/Lib/sandbox/timeseries/__init__.py
   trunk/Lib/sandbox/timeseries/tcore.py
   trunk/Lib/sandbox/timeseries/tdates.py
   trunk/Lib/sandbox/timeseries/tests/test_dates.py
   trunk/Lib/sandbox/timeseries/tmulti.py
   trunk/Lib/sandbox/timeseries/tseries.py
Log:
cosmetic fixes. cf changelog


Property changes on: trunk/Lib/sandbox/timeseries
___________________________________________________________________
Name: svn:ignore
   - sandbox

   + sandbox
quicktest.py
build


Modified: trunk/Lib/sandbox/timeseries/.project
===================================================================
--- trunk/Lib/sandbox/timeseries/.project	2007-01-16 04:38:16 UTC (rev 2569)
+++ trunk/Lib/sandbox/timeseries/.project	2007-01-16 04:43:06 UTC (rev 2570)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-	<name>scipy_svn_timeseries</name>
+	<name>timeseries</name>
 	<comment></comment>
 	<projects>
 	</projects>

Modified: trunk/Lib/sandbox/timeseries/__init__.py
===================================================================
--- trunk/Lib/sandbox/timeseries/__init__.py	2007-01-16 04:38:16 UTC (rev 2569)
+++ trunk/Lib/sandbox/timeseries/__init__.py	2007-01-16 04:43:06 UTC (rev 2570)
@@ -0,0 +1,26 @@
+"""TimeSeries
+
+Support for time series in numpy/scipy
+
+:author: Pierre GF Gerard-Marchant & Matt Knox
+:contact: pierregm_at_uga_dot_edu - mattknox_ca_at_hotmail_dot_com
+:version: $Id$
+"""
+__author__ = "Pierre GF Gerard-Marchant  & Matt Knox ($Author$)"
+__version__ = '1.0'
+__revision__ = "$Revision$"
+__date__     = '$Date$'
+
+import tcore
+from tcore import *
+import tdates
+from tdates import *
+import tseries
+from tseries import *
+import tmulti
+from tmulti import *
+
+__all__ = ['tdates', 'tseries','tmulti']
+__all__ += tdates.__all__
+__all__ += tseries.__all__
+__all__ += tmulti.__all__
\ No newline at end of file

Modified: trunk/Lib/sandbox/timeseries/tcore.py
===================================================================
--- trunk/Lib/sandbox/timeseries/tcore.py	2007-01-16 04:38:16 UTC (rev 2569)
+++ trunk/Lib/sandbox/timeseries/tcore.py	2007-01-16 04:43:06 UTC (rev 2570)
@@ -1,7 +1,22 @@
+"""
+A collection of tools for timeseries
+
+:author: Pierre GF Gerard-Marchant & Matt Knox
+:contact: pierregm_at_uga_dot_edu - mattknow_ca_at_hotmail_dot_com
+:version: $Id$
+"""
+__author__ = "Pierre GF Gerard-Marchant & Matt Knox ($Author$)"
+__version__ = '1.0'
+__revision__ = "$Revision$"
+__date__     = '$Date$'
+
 import numpy
-import maskedarray as MA
+import numpy.core.numeric as numeric
+
 from scipy.interpolate import fitpack
 
+import maskedarray as MA
+from maskedarray import masked, nomask, getmask
 
 #####---------------------------------------------------------------------------
 #---- --- Generic functions ---
@@ -125,9 +140,11 @@
                      }
         
 def freqToType(freq):
+    "Returns the Date dtype corresponding to the given frequency."
     return freq_type_mapping[fmtFreq(freq)]
 
 def isDateType(dtype):
+    "Returns True whether the argument is the dtype of a Date."
     #TODO: That looks messy. We should simplify that
     if len([x for x in freq_type_mapping.values() if x == dtype]) > 0: 
         return True
@@ -163,39 +180,36 @@
 def forward_fill(marr, maxgap=None):
     """forward_fill(marr, maxgap=None)
 
-forward fill masked values in a 1-d array when there are <= maxgap
+Forward fill masked values in a 1-d array when there are <= maxgap
 consecutive masked values. If maxgap is None, then forward fill all
 masked values."""
 
-    assert(marr.ndim == 1)
+    if numeric.ndim(marr) > 1:
+        raise ValueError,"The input array should be 1D only!"
 
-    result = marr.copy()
+    marr = MA.array(marr, copy=True)
+    if getmask(marr) is nomask or marr.size == 0:
+        return marr
 
-    if marr.mask is MA.nomask or marr.size == 0: return result
-
     currGap = 0
 
     if maxgap is not None:
-
-        for i in range(1, result.size):
-            if result.mask[i]:
+        for i in range(1, marr.size):
+            if marr._mask[i]:
                 currGap += 1
-                if currGap <= maxgap and not result.mask[i-1]:
-                    result.data[i] = result.data[i-1]
-                    result.mask[i] = False
+                if currGap <= maxgap and not marr._mask[i-1]:
+                    marr._data[i] = marr._data[i-1]
+                    marr._mask[i] = False
                 elif currGap == maxgap + 1:
-                    result.mask[i-maxgap:i] = True
+                    marr._mask[i-maxgap:i] = True
             else:
-                currGap = 0
-                
+                currGap = 0               
     else:
-        
-        for i in range(1, result.size):
-            if result.mask[i] and not  result.mask[i-1]:
-                result.data[i] = result.data[i-1]
-                result.mask[i] = False
-    
-    return result
+        for i in range(1, marr.size):
+            if marr._mask[i] and not marr._mask[i-1]:
+                marr._data[i] = marr._data[i-1]
+                marr._mask[i] = False
+    return marr
 
 
 def backward_fill(marr, maxgap=None):
@@ -204,7 +218,6 @@
 backward fill masked values in a 1-d array when there are <= maxgap
 consecutive masked values. If maxgap is None, then backward fill all
 masked values."""
-
     return forward_fill(marr[::-1], maxgap=maxgap)[::-1]
     
 
@@ -214,18 +227,20 @@
 Interpolate masked values in marr according to method kind.
 kind must be one of 'constant', 'linear', 'cubic', quintic'
 """
-
+    if numeric.ndim(marr) > 1: 
+        raise ValueError("array must be 1 dimensional!")
+    #
+    marr = MA.array(marr, copy=True)
+    if getmask(marr) is nomask: 
+        return marr
+    #
+    unmaskedIndices = (~marr._mask).nonzero()[0]
+    if unmaskedIndices.size < 2: 
+        return marr
+    #    
     kind = kind.lower()
-    
-    if kind == 'constant': return forward_fill(marr)
-    
-    if marr.ndim != 1: raise ValueError("array must be 1 dimensional!")
-    
-    if not hasattr(marr, 'mask') or marr.mask is MA.nomask: return marr.copy()
-    
-    unmaskedIndices = numpy.where((marr.mask == False))[0]
-    if unmaskedIndices.size < 2: return marr.copy()
-
+    if kind == 'constant': 
+        return forward_fill(marr)
     try:
         k = {'linear' : 1,
              'cubic' : 3,
@@ -239,9 +254,8 @@
     
     tck = fitpack.splrep(unmaskedIndices, vals, k=k)
     
-    maskedIndices = numpy.where(marr.mask)[0]
-    interpIndices = maskedIndices[(maskedIndices > first_unmasked) & (maskedIndices < last_unmasked)]
-    
-    result = marr.copy()
-    result[interpIndices] = fitpack.splev(interpIndices, tck).astype(marr.dtype)
-    return result
+    maskedIndices = marr._mask.nonzero()[0]
+    interpIndices = maskedIndices[(maskedIndices > first_unmasked) & \
+                                  (maskedIndices < last_unmasked)]
+    marr[interpIndices] = fitpack.splev(interpIndices, tck).astype(marr.dtype)
+    return marr

Modified: trunk/Lib/sandbox/timeseries/tdates.py
===================================================================
--- trunk/Lib/sandbox/timeseries/tdates.py	2007-01-16 04:38:16 UTC (rev 2569)
+++ trunk/Lib/sandbox/timeseries/tdates.py	2007-01-16 04:43:06 UTC (rev 2570)
@@ -1,9 +1,11 @@
 """
-:author: Pierre Gerard-Marchant
-:contact: pierregm_at_uga_dot_edu
+Classes definition for the support of individual dates and array of dates.
+
+:author: Pierre GF Gerard-Marchant & Matt Knox
+:contact: pierregm_at_uga_dot_edu - mattknow_ca_at_hotmail_dot_com
 :version: $Id$
 """
-__author__ = "Pierre GF Gerard-Marchant ($Author$)"
+__author__ = "Pierre GF Gerard-Marchant & Matt Knox ($Author$)"
 __version__ = '1.0'
 __revision__ = "$Revision$"
 __date__     = '$Date$'
@@ -35,6 +37,16 @@
 daflog = logging.getLogger('darray_from')
 dalog = logging.getLogger('DateArray')
 
+
+__all__ = [
+'Date', 'DateArray','isDate','isDateArray',
+'DateError', 'ArithmeticDateError', 'FrequencyDateError','InsufficientDateError',
+'datearray','date_array', 'date_array_fromlist_', 'date_array_fromrange',
+'day_of_week','dat_of_year','day','month','quarter','year','hour','minute','second',
+'truncateDate','monthToQuarter','thisday','today','prevbusday','asfreq'
+           ]
+
+
 #####---------------------------------------------------------------------------
 #---- --- Date Info ---
 #####---------------------------------------------------------------------------
@@ -282,7 +294,8 @@
         elif self.freq == 'B':
             days = self.mxDate.absdate
             weeks = days // 7
-            val = days - weeks*2  # (weeks*5) + (days - weeks*7)
+            val = days - weeks*2  
+            # (weeks*5) + (days - weeks*7)
         # Daily/undefined
         elif self.freq in ['D', 'U']:
             val = self.mxDate.absdate
@@ -736,23 +749,7 @@
                 tostr = firststr
             self.__tostr = tostr
         return self.__tostr
-    #
-#    def asfreq_ini(self, freq=None):
-#        "Converts the dates to another frequency."
-#        # Note: As we define a new object, we don't need caching
-#        if freq is None:
-#            return self
-#        freq = corelib.fmtFreq(freq)
-#        if freq == self.freq:
-#            return self        
-#        if self.isvalid():
-#            new = numeric.arange(self.size, dtype=int_)
-#            new += self[0].asfreq(freq).value
-#        else:
-#            new = numpy.fromiter((d.asfreq(freq).value for d in self),
-#                                 dtype=float_)
-#        return DateArray(new, freq=freq)
-    
+    #   
     def asfreq(self, freq=None, relation="BEFORE"):
         "Converts the dates to another frequency."
         # Note: As we define a new object, we don't need caching

Modified: trunk/Lib/sandbox/timeseries/tests/test_dates.py
===================================================================
--- trunk/Lib/sandbox/timeseries/tests/test_dates.py	2007-01-16 04:38:16 UTC (rev 2569)
+++ trunk/Lib/sandbox/timeseries/tests/test_dates.py	2007-01-16 04:43:06 UTC (rev 2570)
@@ -1,15 +1,14 @@
 # pylint: disable-msg=W0611, W0612, W0511,R0201
-"""Tests suite for MaskedArray.
-Adapted from the original test_ma by Pierre Gerard-Marchant
+"""Tests suite for timeseries.tdates.
 
-:author: Pierre Gerard-Marchant
-:contact: pierregm_at_uga_dot_edu
-:version: $Id: test_core.py 59 2006-12-22 23:58:11Z backtopop $
+:author: Pierre Gerard-Marchant & Matt Knox
+:contact: pierregm_at_uga_dot_edu - mattknow_ca_at_hotmail_dot_com
+:version: $Id$
 """
-__author__ = "Pierre GF Gerard-Marchant ($Author: backtopop $)"
+__author__ = "Pierre GF Gerard-Marchant ($Author$)"
 __version__ = '1.0'
-__revision__ = "$Revision: 59 $"
-__date__     = '$Date: 2006-12-22 18:58:11 -0500 (Fri, 22 Dec 2006) $'
+__revision__ = "$Revision$"
+__date__     = '$Date$'
 
 import types
 import datetime
@@ -26,10 +25,10 @@
 import maskedarray.testutils
 from maskedarray.testutils import assert_equal, assert_array_equal
 
-from timeseries import tdates
-from timeseries import tcore
+import tdates
+import tcore
 reload(tdates)
-from timeseries.tdates import date_array_fromlist, Date, DateArray, mxDFromString
+from tdates import date_array_fromlist, Date, DateArray, mxDFromString
 
 class test_creation(NumpyTestCase):
     "Base test class for MaskedArrays."
@@ -121,388 +120,455 @@
     def test_conv_annual(self):
         "frequency conversion tests: from Annual Frequency"
 
-        date_A = tdates.Date(freq='A', year=2007)
-        date_A_to_Q_before = tdates.Date(freq='Q', year=2007, quarter=1)
-        date_A_to_Q_after = tdates.Date(freq='Q', year=2007, quarter=4)
-        date_A_to_M_before = tdates.Date(freq='M', year=2007, month=1)
-        date_A_to_M_after = tdates.Date(freq='M', year=2007, month=12)
-        date_A_to_W_before = tdates.Date(freq='W', year=2007, month=1, day=1)
-        date_A_to_W_after = tdates.Date(freq='W', year=2007, month=12, day=31)
-        date_A_to_B_before = tdates.Date(freq='B', year=2007, month=1, day=1)
-        date_A_to_B_after = tdates.Date(freq='B', year=2007, month=12, day=31)
-        date_A_to_D_before = tdates.Date(freq='D', year=2007, month=1, day=1)
-        date_A_to_D_after = tdates.Date(freq='D', year=2007, month=12, day=31)
-        date_A_to_H_before = tdates.Date(freq='H', year=2007, month=1, day=1, hours=0)
-        date_A_to_H_after = tdates.Date(freq='H', year=2007, month=12, day=31, hours=23)
-        date_A_to_T_before = tdates.Date(freq='T', year=2007, month=1, day=1, hours=0, minutes=0)
-        date_A_to_T_after = tdates.Date(freq='T', year=2007, month=12, day=31, hours=23, minutes=59)
-        date_A_to_S_before = tdates.Date(freq='S', year=2007, month=1, day=1, hours=0, minutes=0, seconds=0)
-        date_A_to_S_after = tdates.Date(freq='S', year=2007, month=12, day=31, hours=23, minutes=59, seconds=59)
+        date_A = Date(freq='A', year=2007)
+        date_A_to_Q_before = Date(freq='Q', year=2007, quarter=1)
+        date_A_to_Q_after = Date(freq='Q', year=2007, quarter=4)
+        date_A_to_M_before = Date(freq='M', year=2007, month=1)
+        date_A_to_M_after = Date(freq='M', year=2007, month=12)
+        date_A_to_W_before = Date(freq='W', year=2007, month=1, day=1)
+        date_A_to_W_after = Date(freq='W', year=2007, month=12, day=31)
+        date_A_to_B_before = Date(freq='B', year=2007, month=1, day=1)
+        date_A_to_B_after = Date(freq='B', year=2007, month=12, day=31)
+        date_A_to_D_before = Date(freq='D', year=2007, month=1, day=1)
+        date_A_to_D_after = Date(freq='D', year=2007, month=12, day=31)
+        date_A_to_H_before = Date(freq='H', year=2007, month=1, day=1, 
+                                  hours=0)
+        date_A_to_H_after = Date(freq='H', year=2007, month=12, day=31, 
+                                 hours=23)
+        date_A_to_T_before = Date(freq='T', year=2007, month=1, day=1, 
+                                  hours=0, minutes=0)
+        date_A_to_T_after = Date(freq='T', year=2007, month=12, day=31, 
+                                 hours=23, minutes=59)
+        date_A_to_S_before = Date(freq='S', year=2007, month=1, day=1, 
+                                  hours=0, minutes=0, seconds=0)
+        date_A_to_S_after = Date(freq='S', year=2007, month=12, day=31, 
+                                 hours=23, minutes=59, seconds=59)
         
-        assert(date_A.asfreq('Q', "BEFORE") == date_A_to_Q_before)
-        assert(date_A.asfreq('Q', "AFTER") == date_A_to_Q_after)
-        assert(date_A.asfreq('M', "BEFORE") == date_A_to_M_before)
-        assert(date_A.asfreq('M', "AFTER") == date_A_to_M_after)
-        assert(date_A.asfreq('W', "BEFORE") == date_A_to_W_before)
-        assert(date_A.asfreq('W', "AFTER") == date_A_to_W_after)
-        assert(date_A.asfreq('B', "BEFORE") == date_A_to_B_before)
-        assert(date_A.asfreq('B', "AFTER") == date_A_to_B_after)
-        assert(date_A.asfreq('D', "BEFORE") == date_A_to_D_before)
-        assert(date_A.asfreq('D', "AFTER") == date_A_to_D_after)
-        assert(date_A.asfreq('H', "BEFORE") == date_A_to_H_before)
-        assert(date_A.asfreq('H', "AFTER") == date_A_to_H_after)
-        assert(date_A.asfreq('T', "BEFORE") == date_A_to_T_before)
-        assert(date_A.asfreq('T', "AFTER") == date_A_to_T_after)
-        assert(date_A.asfreq('S', "BEFORE") == date_A_to_S_before)
-        assert(date_A.asfreq('S', "AFTER") == date_A_to_S_after)
+        assert_equal(date_A.asfreq('Q', "BEFORE"), date_A_to_Q_before)
+        assert_equal(date_A.asfreq('Q', "AFTER"), date_A_to_Q_after)
+        assert_equal(date_A.asfreq('M', "BEFORE"), date_A_to_M_before)
+        assert_equal(date_A.asfreq('M', "AFTER"), date_A_to_M_after)
+        assert_equal(date_A.asfreq('W', "BEFORE"), date_A_to_W_before)
+        assert_equal(date_A.asfreq('W', "AFTER"), date_A_to_W_after)
+        assert_equal(date_A.asfreq('B', "BEFORE"), date_A_to_B_before)
+        assert_equal(date_A.asfreq('B', "AFTER"), date_A_to_B_after)
+        assert_equal(date_A.asfreq('D', "BEFORE"), date_A_to_D_before)
+        assert_equal(date_A.asfreq('D', "AFTER"), date_A_to_D_after)
+        assert_equal(date_A.asfreq('H', "BEFORE"), date_A_to_H_before)
+        assert_equal(date_A.asfreq('H', "AFTER"), date_A_to_H_after)
+        assert_equal(date_A.asfreq('T', "BEFORE"), date_A_to_T_before)
+        assert_equal(date_A.asfreq('T', "AFTER"), date_A_to_T_after)
+        assert_equal(date_A.asfreq('S', "BEFORE"), date_A_to_S_before)
+        assert_equal(date_A.asfreq('S', "AFTER"), date_A_to_S_after)
 
         
     def test_conv_quarterly(self):
         "frequency conversion tests: from Quarterly Frequency"
 
-        date_Q = tdates.Date(freq='Q', year=2007, quarter=1)
-        date_Q_end_of_year = tdates.Date(freq='Q', year=2007, quarter=4)
-        date_Q_to_A = tdates.Date(freq='A', year=2007)
-        date_Q_to_M_before = tdates.Date(freq='M', year=2007, month=1)
-        date_Q_to_M_after = tdates.Date(freq='M', year=2007, month=3)
-        date_Q_to_W_before = tdates.Date(freq='W', year=2007, month=1, day=1)
-        date_Q_to_W_after = tdates.Date(freq='W', year=2007, month=3, day=31)
-        date_Q_to_B_before = tdates.Date(freq='B', year=2007, month=1, day=1)
-        date_Q_to_B_after = tdates.Date(freq='B', year=2007, month=3, day=30)
-        date_Q_to_D_before = tdates.Date(freq='D', year=2007, month=1, day=1)
-        date_Q_to_D_after = tdates.Date(freq='D', year=2007, month=3, day=31)
-        date_Q_to_H_before = tdates.Date(freq='H', year=2007, month=1, day=1, hours=0)
-        date_Q_to_H_after = tdates.Date(freq='H', year=2007, month=3, day=31, hours=23)
-        date_Q_to_T_before = tdates.Date(freq='T', year=2007, month=1, day=1, hours=0, minutes=0)
-        date_Q_to_T_after = tdates.Date(freq='T', year=2007, month=3, day=31, hours=23, minutes=59)
-        date_Q_to_S_before = tdates.Date(freq='S', year=2007, month=1, day=1, hours=0, minutes=0, seconds=0)
-        date_Q_to_S_after = tdates.Date(freq='S', year=2007, month=3, day=31, hours=23, minutes=59, seconds=59)
+        date_Q = Date(freq='Q', year=2007, quarter=1)
+        date_Q_end_of_year = Date(freq='Q', year=2007, quarter=4)
+        date_Q_to_A = Date(freq='A', year=2007)
+        date_Q_to_M_before = Date(freq='M', year=2007, month=1)
+        date_Q_to_M_after = Date(freq='M', year=2007, month=3)
+        date_Q_to_W_before = Date(freq='W', year=2007, month=1, day=1)
+        date_Q_to_W_after = Date(freq='W', year=2007, month=3, day=31)
+        date_Q_to_B_before = Date(freq='B', year=2007, month=1, day=1)
+        date_Q_to_B_after = Date(freq='B', year=2007, month=3, day=30)
+        date_Q_to_D_before = Date(freq='D', year=2007, month=1, day=1)
+        date_Q_to_D_after = Date(freq='D', year=2007, month=3, day=31)
+        date_Q_to_H_before = Date(freq='H', year=2007, month=1, day=1, 
+                                  hours=0)
+        date_Q_to_H_after = Date(freq='H', year=2007, month=3, day=31, 
+                                 hours=23)
+        date_Q_to_T_before = Date(freq='T', year=2007, month=1, day=1, 
+                                  hours=0, minutes=0)
+        date_Q_to_T_after = Date(freq='T', year=2007, month=3, day=31, 
+                                 hours=23, minutes=59)
+        date_Q_to_S_before = Date(freq='S', year=2007, month=1, day=1, 
+                                  hours=0, minutes=0, seconds=0)
+        date_Q_to_S_after = Date(freq='S', year=2007, month=3, day=31, 
+                                 hours=23, minutes=59, seconds=59)
         
-        assert(date_Q.asfreq('A') == date_Q_to_A)
-        assert(date_Q_end_of_year.asfreq('A') == date_Q_to_A)
+        assert_equal(date_Q.asfreq('A'), date_Q_to_A)
+        assert_equal(date_Q_end_of_year.asfreq('A'), date_Q_to_A)
         
-        assert(date_Q.asfreq('M', "BEFORE") == date_Q_to_M_before)
-        assert(date_Q.asfreq('M', "AFTER") == date_Q_to_M_after)
-        assert(date_Q.asfreq('W', "BEFORE") == date_Q_to_W_before)
-        assert(date_Q.asfreq('W', "AFTER") == date_Q_to_W_after)
-        assert(date_Q.asfreq('B', "BEFORE") == date_Q_to_B_before)
-        assert(date_Q.asfreq('B', "AFTER") == date_Q_to_B_after)
-        assert(date_Q.asfreq('D', "BEFORE") == date_Q_to_D_before)
-        assert(date_Q.asfreq('D', "AFTER") == date_Q_to_D_after)
-        assert(date_Q.asfreq('H', "BEFORE") == date_Q_to_H_before)
-        assert(date_Q.asfreq('H', "AFTER") == date_Q_to_H_after)
-        assert(date_Q.asfreq('T', "BEFORE") == date_Q_to_T_before)
-        assert(date_Q.asfreq('T', "AFTER") == date_Q_to_T_after)
-        assert(date_Q.asfreq('S', "BEFORE") == date_Q_to_S_before)
-        assert(date_Q.asfreq('S', "AFTER") == date_Q_to_S_after)
+        assert_equal(date_Q.asfreq('M', "BEFORE"), date_Q_to_M_before)
+        assert_equal(date_Q.asfreq('M', "AFTER"), date_Q_to_M_after)
+        assert_equal(date_Q.asfreq('W', "BEFORE"), date_Q_to_W_before)
+        assert_equal(date_Q.asfreq('W', "AFTER"), date_Q_to_W_after)
+        assert_equal(date_Q.asfreq('B', "BEFORE"), date_Q_to_B_before)
+        assert_equal(date_Q.asfreq('B', "AFTER"), date_Q_to_B_after)
+        assert_equal(date_Q.asfreq('D', "BEFORE"), date_Q_to_D_before)
+        assert_equal(date_Q.asfreq('D', "AFTER"), date_Q_to_D_after)
+        assert_equal(date_Q.asfreq('H', "BEFORE"), date_Q_to_H_before)
+        assert_equal(date_Q.asfreq('H', "AFTER"), date_Q_to_H_after)
+        assert_equal(date_Q.asfreq('T', "BEFORE"), date_Q_to_T_before)
+        assert_equal(date_Q.asfreq('T', "AFTER"), date_Q_to_T_after)
+        assert_equal(date_Q.asfreq('S', "BEFORE"), date_Q_to_S_before)
+        assert_equal(date_Q.asfreq('S', "AFTER"), date_Q_to_S_after)
         
 
     def test_conv_monthly(self):
         "frequency conversion tests: from Monthly Frequency"
         
-        date_M = tdates.Date(freq='M', year=2007, month=1)
-        date_M_end_of_year = tdates.Date(freq='M', year=2007, month=12)
-        date_M_end_of_quarter = tdates.Date(freq='M', year=2007, month=3)
-        date_M_to_A = tdates.Date(freq='A', year=2007)
-        date_M_to_Q = tdates.Date(freq='Q', year=2007, quarter=1)
-        date_M_to_W_before = tdates.Date(freq='W', year=2007, month=1, day=1)
-        date_M_to_W_after = tdates.Date(freq='W', year=2007, month=1, day=31)
-        date_M_to_B_before = tdates.Date(freq='B', year=2007, month=1, day=1)
-        date_M_to_B_after = tdates.Date(freq='B', year=2007, month=1, day=31)
-        date_M_to_D_before = tdates.Date(freq='D', year=2007, month=1, day=1)
-        date_M_to_D_after = tdates.Date(freq='D', year=2007, month=1, day=31)
-        date_M_to_H_before = tdates.Date(freq='H', year=2007, month=1, day=1, hours=0)
-        date_M_to_H_after = tdates.Date(freq='H', year=2007, month=1, day=31, hours=23)
-        date_M_to_T_before = tdates.Date(freq='T', year=2007, month=1, day=1, hours=0, minutes=0)
-        date_M_to_T_after = tdates.Date(freq='T', year=2007, month=1, day=31, hours=23, minutes=59)
-        date_M_to_S_before = tdates.Date(freq='S', year=2007, month=1, day=1, hours=0, minutes=0, seconds=0)
-        date_M_to_S_after = tdates.Date(freq='S', year=2007, month=1, day=31, hours=23, minutes=59, seconds=59)
+        date_M = Date(freq='M', year=2007, month=1)
+        date_M_end_of_year = Date(freq='M', year=2007, month=12)
+        date_M_end_of_quarter = Date(freq='M', year=2007, month=3)
+        date_M_to_A = Date(freq='A', year=2007)
+        date_M_to_Q = Date(freq='Q', year=2007, quarter=1)
+        date_M_to_W_before = Date(freq='W', year=2007, month=1, day=1)
+        date_M_to_W_after = Date(freq='W', year=2007, month=1, day=31)
+        date_M_to_B_before = Date(freq='B', year=2007, month=1, day=1)
+        date_M_to_B_after = Date(freq='B', year=2007, month=1, day=31)
+        date_M_to_D_before = Date(freq='D', year=2007, month=1, day=1)
+        date_M_to_D_after = Date(freq='D', year=2007, month=1, day=31)
+        date_M_to_H_before = Date(freq='H', year=2007, month=1, day=1, 
+                                  hours=0)
+        date_M_to_H_after = Date(freq='H', year=2007, month=1, day=31, 
+                                 hours=23)
+        date_M_to_T_before = Date(freq='T', year=2007, month=1, day=1, 
+                                  hours=0, minutes=0)
+        date_M_to_T_after = Date(freq='T', year=2007, month=1, day=31, 
+                                 hours=23, minutes=59)
+        date_M_to_S_before = Date(freq='S', year=2007, month=1, day=1, 
+                                  hours=0, minutes=0, seconds=0)
+        date_M_to_S_after = Date(freq='S', year=2007, month=1, day=31, 
+                                 hours=23, minutes=59, seconds=59)
         
-        assert(date_M.asfreq('A') == date_M_to_A)
-        assert(date_M_end_of_year.asfreq('A') == date_M_to_A)
-        assert(date_M.asfreq('Q') == date_M_to_Q)
-        assert(date_M_end_of_quarter.asfreq('Q') == date_M_to_Q)
+        assert_equal(date_M.asfreq('A'), date_M_to_A)
+        assert_equal(date_M_end_of_year.asfreq('A'), date_M_to_A)
+        assert_equal(date_M.asfreq('Q'), date_M_to_Q)
+        assert_equal(date_M_end_of_quarter.asfreq('Q'), date_M_to_Q)
 
-        assert(date_M.asfreq('W', "BEFORE") == date_M_to_W_before)
-        assert(date_M.asfreq('W', "AFTER") == date_M_to_W_after)
-        assert(date_M.asfreq('B', "BEFORE") == date_M_to_B_before)
-        assert(date_M.asfreq('B', "AFTER") == date_M_to_B_after)
-        assert(date_M.asfreq('D', "BEFORE") == date_M_to_D_before)
-        assert(date_M.asfreq('D', "AFTER") == date_M_to_D_after)
-        assert(date_M.asfreq('H', "BEFORE") == date_M_to_H_before)
-        assert(date_M.asfreq('H', "AFTER") == date_M_to_H_after)
-        assert(date_M.asfreq('T', "BEFORE") == date_M_to_T_before)
-        assert(date_M.asfreq('T', "AFTER") == date_M_to_T_after)
-        assert(date_M.asfreq('S', "BEFORE") == date_M_to_S_before)
-        assert(date_M.asfreq('S', "AFTER") == date_M_to_S_after)
+        assert_equal(date_M.asfreq('W', "BEFORE"), date_M_to_W_before)
+        assert_equal(date_M.asfreq('W', "AFTER"), date_M_to_W_after)
+        assert_equal(date_M.asfreq('B', "BEFORE"), date_M_to_B_before)
+        assert_equal(date_M.asfreq('B', "AFTER"), date_M_to_B_after)
+        assert_equal(date_M.asfreq('D', "BEFORE"), date_M_to_D_before)
+        assert_equal(date_M.asfreq('D', "AFTER"), date_M_to_D_after)
+        assert_equal(date_M.asfreq('H', "BEFORE"), date_M_to_H_before)
+        assert_equal(date_M.asfreq('H', "AFTER"), date_M_to_H_after)
+        assert_equal(date_M.asfreq('T', "BEFORE"), date_M_to_T_before)
+        assert_equal(date_M.asfreq('T', "AFTER"), date_M_to_T_after)
+        assert_equal(date_M.asfreq('S', "BEFORE"), date_M_to_S_before)
+        assert_equal(date_M.asfreq('S', "AFTER"), date_M_to_S_after)
 
         
     def test_conv_weekly(self):
         "frequency conversion tests: from Weekly Frequency"
         
-        date_W = tdates.Date(freq='W', year=2007, month=1, day=1)
-        date_W_end_of_year = tdates.Date(freq='W', year=2007, month=12, day=31)
-        date_W_end_of_quarter = tdates.Date(freq='W', year=2007, month=3, day=31)
-        date_W_end_of_month = tdates.Date(freq='W', year=2007, month=1, day=31)
-        date_W_to_A = tdates.Date(freq='A', year=2007)
-        date_W_to_Q = tdates.Date(freq='Q', year=2007, quarter=1)
-        date_W_to_M = tdates.Date(freq='M', year=2007, month=1)
+        date_W = Date(freq='W', year=2007, month=1, day=1)
+        date_W_end_of_year = Date(freq='W', year=2007, month=12, day=31)
+        date_W_end_of_quarter = Date(freq='W', year=2007, month=3, day=31)
+        date_W_end_of_month = Date(freq='W', year=2007, month=1, day=31)
+        date_W_to_A = Date(freq='A', year=2007)
+        date_W_to_Q = Date(freq='Q', year=2007, quarter=1)
+        date_W_to_M = Date(freq='M', year=2007, month=1)
 
-        if tdates.Date(freq='D', year=2007, month=12, day=31).day_of_week() == 6:
-            date_W_to_A_end_of_year = tdates.Date(freq='A', year=2007)
+        if Date(freq='D', year=2007, month=12, day=31).day_of_week() == 6:
+            date_W_to_A_end_of_year = Date(freq='A', year=2007)
         else:
-            date_W_to_A_end_of_year = tdates.Date(freq='A', year=2008)
+            date_W_to_A_end_of_year = Date(freq='A', year=2008)
 
-        if tdates.Date(freq='D', year=2007, month=3, day=31).day_of_week() == 6:
-            date_W_to_Q_end_of_quarter = tdates.Date(freq='Q', year=2007, quarter=1)
+        if Date(freq='D', year=2007, month=3, day=31).day_of_week() == 6:
+            date_W_to_Q_end_of_quarter = Date(freq='Q', year=2007, quarter=1)
         else:
-            date_W_to_Q_end_of_quarter = tdates.Date(freq='Q', year=2007, quarter=2)
+            date_W_to_Q_end_of_quarter = Date(freq='Q', year=2007, quarter=2)
 
-        if tdates.Date(freq='D', year=2007, month=1, day=31).day_of_week() == 6:
-            date_W_to_M_end_of_month = tdates.Date(freq='M', year=2007, month=1)
+        if Date(freq='D', year=2007, month=1, day=31).day_of_week() == 6:
+            date_W_to_M_end_of_month = Date(freq='M', year=2007, month=1)
         else:
-            date_W_to_M_end_of_month = tdates.Date(freq='M', year=2007, month=2)
+            date_W_to_M_end_of_month = Date(freq='M', year=2007, month=2)
 
-        date_W_to_B_before = tdates.Date(freq='B', year=2007, month=1, day=1)
-        date_W_to_B_after = tdates.Date(freq='B', year=2007, month=1, day=5)
-        date_W_to_D_before = tdates.Date(freq='D', year=2007, month=1, day=1)
-        date_W_to_D_after = tdates.Date(freq='D', year=2007, month=1, day=7)
-        date_W_to_H_before = tdates.Date(freq='H', year=2007, month=1, day=1, hours=0)
-        date_W_to_H_after = tdates.Date(freq='H', year=2007, month=1, day=7, hours=23)
-        date_W_to_T_before = tdates.Date(freq='T', year=2007, month=1, day=1, hours=0, minutes=0)
-        date_W_to_T_after = tdates.Date(freq='T', year=2007, month=1, day=7, hours=23, minutes=59)
-        date_W_to_S_before = tdates.Date(freq='S', year=2007, month=1, day=1, hours=0, minutes=0, seconds=0)
-        date_W_to_S_after = tdates.Date(freq='S', year=2007, month=1, day=7, hours=23, minutes=59, seconds=59)
+        date_W_to_B_before = Date(freq='B', year=2007, month=1, day=1)
+        date_W_to_B_after = Date(freq='B', year=2007, month=1, day=5)
+        date_W_to_D_before = Date(freq='D', year=2007, month=1, day=1)
+        date_W_to_D_after = Date(freq='D', year=2007, month=1, day=7)
+        date_W_to_H_before = Date(freq='H', year=2007, month=1, day=1, 
+                                  hours=0)
+        date_W_to_H_after = Date(freq='H', year=2007, month=1, day=7, 
+                                 hours=23)
+        date_W_to_T_before = Date(freq='T', year=2007, month=1, day=1, 
+                                  hours=0, minutes=0)
+        date_W_to_T_after = Date(freq='T', year=2007, month=1, day=7, 
+                                 hours=23, minutes=59)
+        date_W_to_S_before = Date(freq='S', year=2007, month=1, day=1, 
+                                  hours=0, minutes=0, seconds=0)
+        date_W_to_S_after = Date(freq='S', year=2007, month=1, day=7, 
+                                 hours=23, minutes=59, seconds=59)
         
-        assert(date_W.asfreq('A') == date_W_to_A)
-        assert(date_W_end_of_year.asfreq('A') == date_W_to_A_end_of_year)
-        assert(date_W.asfreq('Q') == date_W_to_Q)
-        assert(date_W_end_of_quarter.asfreq('Q') == date_W_to_Q_end_of_quarter)
-        assert(date_W.asfreq('M') == date_W_to_M)
-        assert(date_W_end_of_month.asfreq('M') == date_W_to_M_end_of_month)
+        assert_equal(date_W.asfreq('A'), date_W_to_A)
+        assert_equal(date_W_end_of_year.asfreq('A'), date_W_to_A_end_of_year)
+        assert_equal(date_W.asfreq('Q'), date_W_to_Q)
+        assert_equal(date_W_end_of_quarter.asfreq('Q'), date_W_to_Q_end_of_quarter)
+        assert_equal(date_W.asfreq('M'), date_W_to_M)
+        assert_equal(date_W_end_of_month.asfreq('M'), date_W_to_M_end_of_month)
 
-        assert(date_W.asfreq('B', "BEFORE") == date_W_to_B_before)
-        assert(date_W.asfreq('B', "AFTER") == date_W_to_B_after)
-        assert(date_W.asfreq('D', "BEFORE") == date_W_to_D_before)
-        assert(date_W.asfreq('D', "AFTER") == date_W_to_D_after)
-        assert(date_W.asfreq('H', "BEFORE") == date_W_to_H_before)
-        assert(date_W.asfreq('H', "AFTER") == date_W_to_H_after)
-        assert(date_W.asfreq('T', "BEFORE") == date_W_to_T_before)
-        assert(date_W.asfreq('T', "AFTER") == date_W_to_T_after)
-        assert(date_W.asfreq('S', "BEFORE") == date_W_to_S_before)
-        assert(date_W.asfreq('S', "AFTER") == date_W_to_S_after)
+        assert_equal(date_W.asfreq('B', "BEFORE"), date_W_to_B_before)
+        assert_equal(date_W.asfreq('B', "AFTER"), date_W_to_B_after)
+        assert_equal(date_W.asfreq('D', "BEFORE"), date_W_to_D_before)
+        assert_equal(date_W.asfreq('D', "AFTER"), date_W_to_D_after)
+        assert_equal(date_W.asfreq('H', "BEFORE"), date_W_to_H_before)
+        assert_equal(date_W.asfreq('H', "AFTER"), date_W_to_H_after)
+        assert_equal(date_W.asfreq('T', "BEFORE"), date_W_to_T_before)
+        assert_equal(date_W.asfreq('T', "AFTER"), date_W_to_T_after)
+        assert_equal(date_W.asfreq('S', "BEFORE"), date_W_to_S_before)
+        assert_equal(date_W.asfreq('S', "AFTER"), date_W_to_S_after)
         
     def test_conv_business(self):
         "frequency conversion tests: from Business Frequency"
         
-        date_B = tdates.Date(freq='B', year=2007, month=1, day=1)
-        date_B_end_of_year = tdates.Date(freq='B', year=2007, month=12, day=31)
-        date_B_end_of_quarter = tdates.Date(freq='B', year=2007, month=3, day=30)
-        date_B_end_of_month = tdates.Date(freq='B', year=2007, month=1, day=31)
-        date_B_end_of_week = tdates.Date(freq='B', year=2007, month=1, day=5)
+        date_B = Date(freq='B', year=2007, month=1, day=1)
+        date_B_end_of_year = Date(freq='B', year=2007, month=12, day=31)
+        date_B_end_of_quarter = Date(freq='B', year=2007, month=3, day=30)
+        date_B_end_of_month = Date(freq='B', year=2007, month=1, day=31)
+        date_B_end_of_week = Date(freq='B', year=2007, month=1, day=5)
         
-        date_B_to_A = tdates.Date(freq='A', year=2007)
-        date_B_to_Q = tdates.Date(freq='Q', year=2007, quarter=1)
-        date_B_to_M = tdates.Date(freq='M', year=2007, month=1)
-        date_B_to_W = tdates.Date(freq='W', year=2007, month=1, day=7)
-        date_B_to_D = tdates.Date(freq='D', year=2007, month=1, day=1)
-        date_B_to_H_before = tdates.Date(freq='H', year=2007, month=1, day=1, hours=0)
-        date_B_to_H_after = tdates.Date(freq='H', year=2007, month=1, day=1, hours=23)
-        date_B_to_T_before = tdates.Date(freq='T', year=2007, month=1, day=1, hours=0, minutes=0)
-        date_B_to_T_after = tdates.Date(freq='T', year=2007, month=1, day=1, hours=23, minutes=59)
-        date_B_to_S_before = tdates.Date(freq='S', year=2007, month=1, day=1, hours=0, minutes=0, seconds=0)
-        date_B_to_S_after = tdates.Date(freq='S', year=2007, month=1, day=1, hours=23, minutes=59, seconds=59)
+        date_B_to_A = Date(freq='A', year=2007)
+        date_B_to_Q = Date(freq='Q', year=2007, quarter=1)
+        date_B_to_M = Date(freq='M', year=2007, month=1)
+        date_B_to_W = Date(freq='W', year=2007, month=1, day=7)
+        date_B_to_D = Date(freq='D', year=2007, month=1, day=1)
+        date_B_to_H_before = Date(freq='H', year=2007, month=1, day=1, 
+                                  hours=0)
+        date_B_to_H_after = Date(freq='H', year=2007, month=1, day=1, 
+                                 hours=23)
+        date_B_to_T_before = Date(freq='T', year=2007, month=1, day=1, 
+                                  hours=0, minutes=0)
+        date_B_to_T_after = Date(freq='T', year=2007, month=1, day=1, 
+                                 hours=23, minutes=59)
+        date_B_to_S_before = Date(freq='S', year=2007, month=1, day=1, 
+                                  hours=0, minutes=0, seconds=0)
+        date_B_to_S_after = Date(freq='S', year=2007, month=1, day=1, 
+                                 hours=23, minutes=59, seconds=59)
         
-        assert(date_B.asfreq('A') == date_B_to_A)
-        assert(date_B_end_of_year.asfreq('A') == date_B_to_A)
-        assert(date_B.asfreq('Q') == date_B_to_Q)
-        assert(date_B_end_of_quarter.asfreq('Q') == date_B_to_Q)
-        assert(date_B.asfreq('M') == date_B_to_M)
-        assert(date_B_end_of_month.asfreq('M') == date_B_to_M)
-        assert(date_B.asfreq('W') == date_B_to_W)
-        assert(date_B_end_of_week.asfreq('W') == date_B_to_W)
+        assert_equal(date_B.asfreq('A'), date_B_to_A)
+        assert_equal(date_B_end_of_year.asfreq('A'), date_B_to_A)
+        assert_equal(date_B.asfreq('Q'), date_B_to_Q)
+        assert_equal(date_B_end_of_quarter.asfreq('Q'), date_B_to_Q)
+        assert_equal(date_B.asfreq('M'), date_B_to_M)
+        assert_equal(date_B_end_of_month.asfreq('M'), date_B_to_M)
+        assert_equal(date_B.asfreq('W'), date_B_to_W)
+        assert_equal(date_B_end_of_week.asfreq('W'), date_B_to_W)
 
-        assert(date_B.asfreq('D') == date_B_to_D)
+        assert_equal(date_B.asfreq('D'), date_B_to_D)
 
-        assert(date_B.asfreq('H', "BEFORE") == date_B_to_H_before)
-        assert(date_B.asfreq('H', "AFTER") == date_B_to_H_after)
-        assert(date_B.asfreq('T', "BEFORE") == date_B_to_T_before)
-        assert(date_B.asfreq('T', "AFTER") == date_B_to_T_after)
-        assert(date_B.asfreq('S', "BEFORE") == date_B_to_S_before)
-        assert(date_B.asfreq('S', "AFTER") == date_B_to_S_after)
+        assert_equal(date_B.asfreq('H', "BEFORE"), date_B_to_H_before)
+        assert_equal(date_B.asfreq('H', "AFTER"), date_B_to_H_after)
+        assert_equal(date_B.asfreq('T', "BEFORE"), date_B_to_T_before)
+        assert_equal(date_B.asfreq('T', "AFTER"), date_B_to_T_after)
+        assert_equal(date_B.asfreq('S', "BEFORE"), date_B_to_S_before)
+        assert_equal(date_B.asfreq('S', "AFTER"), date_B_to_S_after)
 
     def test_conv_daily(self):
         "frequency conversion tests: from Business Frequency"
         
-        date_D = tdates.Date(freq='D', year=2007, month=1, day=1)
-        date_D_end_of_year = tdates.Date(freq='D', year=2007, month=12, day=31)
-        date_D_end_of_quarter = tdates.Date(freq='D', year=2007, month=3, day=31)
-        date_D_end_of_month = tdates.Date(freq='D', year=2007, month=1, day=31)
-        date_D_end_of_week = tdates.Date(freq='D', year=2007, month=1, day=7)
+        date_D = Date(freq='D', year=2007, month=1, day=1)
+        date_D_end_of_year = Date(freq='D', year=2007, month=12, day=31)
+        date_D_end_of_quarter = Date(freq='D', year=2007, month=3, day=31)
+        date_D_end_of_month = Date(freq='D', year=2007, month=1, day=31)
+        date_D_end_of_week = Date(freq='D', year=2007, month=1, day=7)
         
-        date_D_friday = tdates.Date(freq='D', year=2007, month=1, day=5)
-        date_D_saturday = tdates.Date(freq='D', year=2007, month=1, day=6)
-        date_D_sunday = tdates.Date(freq='D', year=2007, month=1, day=7)
-        date_D_monday = tdates.Date(freq='D', year=2007, month=1, day=8)
+        date_D_friday = Date(freq='D', year=2007, month=1, day=5)
+        date_D_saturday = Date(freq='D', year=2007, month=1, day=6)
+        date_D_sunday = Date(freq='D', year=2007, month=1, day=7)
+        date_D_monday = Date(freq='D', year=2007, month=1, day=8)
         
-        date_B_friday = tdates.Date(freq='B', year=2007, month=1, day=5)
-        date_B_monday = tdates.Date(freq='B', year=2007, month=1, day=8)
+        date_B_friday = Date(freq='B', year=2007, month=1, day=5)
+        date_B_monday = Date(freq='B', year=2007, month=1, day=8)
         
-        date_D_to_A = tdates.Date(freq='A', year=2007)
-        date_D_to_Q = tdates.Date(freq='Q', year=2007, quarter=1)
-        date_D_to_M = tdates.Date(freq='M', year=2007, month=1)
-        date_D_to_W = tdates.Date(freq='W', year=2007, month=1, day=7)
+        date_D_to_A = Date(freq='A', year=2007)
+        date_D_to_Q = Date(freq='Q', year=2007, quarter=1)
+        date_D_to_M = Date(freq='M', year=2007, month=1)
+        date_D_to_W = Date(freq='W', year=2007, month=1, day=7)
 
-        date_D_to_H_before = tdates.Date(freq='H', year=2007, month=1, day=1, hours=0)
-        date_D_to_H_after = tdates.Date(freq='H', year=2007, month=1, day=1, hours=23)
-        date_D_to_T_before = tdates.Date(freq='T', year=2007, month=1, day=1, hours=0, minutes=0)
-        date_D_to_T_after = tdates.Date(freq='T', year=2007, month=1, day=1, hours=23, minutes=59)
-        date_D_to_S_before = tdates.Date(freq='S', year=2007, month=1, day=1, hours=0, minutes=0, seconds=0)
-        date_D_to_S_after = tdates.Date(freq='S', year=2007, month=1, day=1, hours=23, minutes=59, seconds=59)
+        date_D_to_H_before = Date(freq='H', year=2007, month=1, day=1, 
+                                  hours=0)
+        date_D_to_H_after = Date(freq='H', year=2007, month=1, day=1, 
+                                 hours=23)
+        date_D_to_T_before = Date(freq='T', year=2007, month=1, day=1, 
+                                  hours=0, minutes=0)
+        date_D_to_T_after = Date(freq='T', year=2007, month=1, day=1, 
+                                 hours=23, minutes=59)
+        date_D_to_S_before = Date(freq='S', year=2007, month=1, day=1, 
+                                  hours=0, minutes=0, seconds=0)
+        date_D_to_S_after = Date(freq='S', year=2007, month=1, day=1, 
+                                 hours=23, minutes=59, seconds=59)
         
-        assert(date_D.asfreq('A') == date_D_to_A)
-        assert(date_D_end_of_year.asfreq('A') == date_D_to_A)
-        assert(date_D.asfreq('Q') == date_D_to_Q)
-        assert(date_D_end_of_quarter.asfreq('Q') == date_D_to_Q)
-        assert(date_D.asfreq('M') == date_D_to_M)
-        assert(date_D_end_of_month.asfreq('M') == date_D_to_M)
-        assert(date_D.asfreq('W') == date_D_to_W)
-        assert(date_D_end_of_week.asfreq('W') == date_D_to_W)
+        assert_equal(date_D.asfreq('A'), date_D_to_A)
+        assert_equal(date_D_end_of_year.asfreq('A'), date_D_to_A)
+        assert_equal(date_D.asfreq('Q'), date_D_to_Q)
+        assert_equal(date_D_end_of_quarter.asfreq('Q'), date_D_to_Q)
+        assert_equal(date_D.asfreq('M'), date_D_to_M)
+        assert_equal(date_D_end_of_month.asfreq('M'), date_D_to_M)
+        assert_equal(date_D.asfreq('W'), date_D_to_W)
+        assert_equal(date_D_end_of_week.asfreq('W'), date_D_to_W)
 
-        assert(date_D_friday.asfreq('B') == date_B_friday)
-        assert(date_D_saturday.asfreq('B', "BEFORE") == date_B_friday)
-        assert(date_D_saturday.asfreq('B', "AFTER") == date_B_monday)
-        assert(date_D_sunday.asfreq('B', "BEFORE") == date_B_friday)
-        assert(date_D_sunday.asfreq('B', "AFTER") == date_B_monday)
+        assert_equal(date_D_friday.asfreq('B'), date_B_friday)
+        assert_equal(date_D_saturday.asfreq('B', "BEFORE"), date_B_friday)
+        assert_equal(date_D_saturday.asfreq('B', "AFTER"), date_B_monday)
+        assert_equal(date_D_sunday.asfreq('B', "BEFORE"), date_B_friday)
+        assert_equal(date_D_sunday.asfreq('B', "AFTER"), date_B_monday)
 
-        assert(date_D.asfreq('H', "BEFORE") == date_D_to_H_before)
-        assert(date_D.asfreq('H', "AFTER") == date_D_to_H_after)
-        assert(date_D.asfreq('T', "BEFORE") == date_D_to_T_before)
-        assert(date_D.asfreq('T', "AFTER") == date_D_to_T_after)
-        assert(date_D.asfreq('S', "BEFORE") == date_D_to_S_before)
-        assert(date_D.asfreq('S', "AFTER") == date_D_to_S_after)
+        assert_equal(date_D.asfreq('H', "BEFORE"), date_D_to_H_before)
+        assert_equal(date_D.asfreq('H', "AFTER"), date_D_to_H_after)
+        assert_equal(date_D.asfreq('T', "BEFORE"), date_D_to_T_before)
+        assert_equal(date_D.asfreq('T', "AFTER"), date_D_to_T_after)
+        assert_equal(date_D.asfreq('S', "BEFORE"), date_D_to_S_before)
+        assert_equal(date_D.asfreq('S', "AFTER"), date_D_to_S_after)
 
     def test_conv_hourly(self):
         "frequency conversion tests: from Hourly Frequency"
         
-        date_H = tdates.Date(freq='H', year=2007, month=1, day=1, hours=0)
-        date_H_end_of_year = tdates.Date(freq='H', year=2007, month=12, day=31, hours=23)
-        date_H_end_of_quarter = tdates.Date(freq='H', year=2007, month=3, day=31, hours=23)
-        date_H_end_of_month = tdates.Date(freq='H', year=2007, month=1, day=31, hours=23)
-        date_H_end_of_week = tdates.Date(freq='H', year=2007, month=1, day=7, hours=23)
-        date_H_end_of_day = tdates.Date(freq='H', year=2007, month=1, day=1, hours=23)
-        date_H_end_of_bus = tdates.Date(freq='H', year=2007, month=1, day=1, hours=23)
+        date_H = Date(freq='H', year=2007, month=1, day=1, hours=0)
+        date_H_end_of_year = Date(freq='H', year=2007, month=12, day=31, 
+                                  hours=23)
+        date_H_end_of_quarter = Date(freq='H', year=2007, month=3, day=31, 
+                                     hours=23)
+        date_H_end_of_month = Date(freq='H', year=2007, month=1, day=31, 
+                                   hours=23)
+        date_H_end_of_week = Date(freq='H', year=2007, month=1, day=7, 
+                                  hours=23)
+        date_H_end_of_day = Date(freq='H', year=2007, month=1, day=1, 
+                                 hours=23)
+        date_H_end_of_bus = Date(freq='H', year=2007, month=1, day=1, 
+                                 hours=23)
         
-        date_H_to_A = tdates.Date(freq='A', year=2007)
-        date_H_to_Q = tdates.Date(freq='Q', year=2007, quarter=1)
-        date_H_to_M = tdates.Date(freq='M', year=2007, month=1)
-        date_H_to_W = tdates.Date(freq='W', year=2007, month=1, day=7)
-        date_H_to_D = tdates.Date(freq='D', year=2007, month=1, day=1)
-        date_H_to_B = tdates.Date(freq='B', year=2007, month=1, day=1)
+        date_H_to_A = Date(freq='A', year=2007)
+        date_H_to_Q = Date(freq='Q', year=2007, quarter=1)
+        date_H_to_M = Date(freq='M', year=2007, month=1)
+        date_H_to_W = Date(freq='W', year=2007, month=1, day=7)
+        date_H_to_D = Date(freq='D', year=2007, month=1, day=1)
+        date_H_to_B = Date(freq='B', year=2007, month=1, day=1)
         
-        date_H_to_T_before = tdates.Date(freq='T', year=2007, month=1, day=1, hours=0, minutes=0)
-        date_H_to_T_after = tdates.Date(freq='T', year=2007, month=1, day=1, hours=0, minutes=59)
-        date_H_to_S_before = tdates.Date(freq='S', year=2007, month=1, day=1, hours=0, minutes=0, seconds=0)
-        date_H_to_S_after = tdates.Date(freq='S', year=2007, month=1, day=1, hours=0, minutes=59, seconds=59)
+        date_H_to_T_before = Date(freq='T', year=2007, month=1, day=1, 
+                                  hours=0, minutes=0)
+        date_H_to_T_after = Date(freq='T', year=2007, month=1, day=1, 
+                                 hours=0, minutes=59)
+        date_H_to_S_before = Date(freq='S', year=2007, month=1, day=1, 
+                                  hours=0, minutes=0, seconds=0)
+        date_H_to_S_after = Date(freq='S', year=2007, month=1, day=1, 
+                                 hours=0, minutes=59, seconds=59)
         
-        assert(date_H.asfreq('A') == date_H_to_A)
-        assert(date_H_end_of_year.asfreq('A') == date_H_to_A)
-        assert(date_H.asfreq('Q') == date_H_to_Q)
-        assert(date_H_end_of_quarter.asfreq('Q') == date_H_to_Q)
-        assert(date_H.asfreq('M') == date_H_to_M)
-        assert(date_H_end_of_month.asfreq('M') == date_H_to_M)
-        assert(date_H.asfreq('W') == date_H_to_W)
-        assert(date_H_end_of_week.asfreq('W') == date_H_to_W)
-        assert(date_H.asfreq('D') == date_H_to_D)
-        assert(date_H_end_of_day.asfreq('D') == date_H_to_D)
-        assert(date_H.asfreq('B') == date_H_to_B)
-        assert(date_H_end_of_bus.asfreq('B') == date_H_to_B)
+        assert_equal(date_H.asfreq('A'), date_H_to_A)
+        assert_equal(date_H_end_of_year.asfreq('A'), date_H_to_A)
+        assert_equal(date_H.asfreq('Q'), date_H_to_Q)
+        assert_equal(date_H_end_of_quarter.asfreq('Q'), date_H_to_Q)
+        assert_equal(date_H.asfreq('M'), date_H_to_M)
+        assert_equal(date_H_end_of_month.asfreq('M'), date_H_to_M)
+        assert_equal(date_H.asfreq('W'), date_H_to_W)
+        assert_equal(date_H_end_of_week.asfreq('W'), date_H_to_W)
+        assert_equal(date_H.asfreq('D'), date_H_to_D)
+        assert_equal(date_H_end_of_day.asfreq('D'), date_H_to_D)
+        assert_equal(date_H.asfreq('B'), date_H_to_B)
+        assert_equal(date_H_end_of_bus.asfreq('B'), date_H_to_B)
 
-        assert(date_H.asfreq('T', "BEFORE") == date_H_to_T_before)
-        assert(date_H.asfreq('T', "AFTER") == date_H_to_T_after)
-        assert(date_H.asfreq('S', "BEFORE") == date_H_to_S_before)
-        assert(date_H.asfreq('S', "AFTER") == date_H_to_S_after)
+        assert_equal(date_H.asfreq('T', "BEFORE"), date_H_to_T_before)
+        assert_equal(date_H.asfreq('T', "AFTER"), date_H_to_T_after)
+        assert_equal(date_H.asfreq('S', "BEFORE"), date_H_to_S_before)
+        assert_equal(date_H.asfreq('S', "AFTER"), date_H_to_S_after)
 
     def test_conv_minutely(self):
         "frequency conversion tests: from Minutely Frequency"
         
-        date_T = tdates.Date(freq='T', year=2007, month=1, day=1, hours=0, minutes=0)
-        date_T_end_of_year = tdates.Date(freq='T', year=2007, month=12, day=31, hours=23, minutes=59)
-        date_T_end_of_quarter = tdates.Date(freq='T', year=2007, month=3, day=31, hours=23, minutes=59)
-        date_T_end_of_month = tdates.Date(freq='T', year=2007, month=1, day=31, hours=23, minutes=59)
-        date_T_end_of_week = tdates.Date(freq='T', year=2007, month=1, day=7, hours=23, minutes=59)
-        date_T_end_of_day = tdates.Date(freq='T', year=2007, month=1, day=1, hours=23, minutes=59)
-        date_T_end_of_bus = tdates.Date(freq='T', year=2007, month=1, day=1, hours=23, minutes=59)
-        date_T_end_of_hour = tdates.Date(freq='T', year=2007, month=1, day=1, hours=0, minutes=59)
+        date_T = Date(freq='T', year=2007, month=1, day=1, 
+                      hours=0, minutes=0)
+        date_T_end_of_year = Date(freq='T', year=2007, month=12, day=31, 
+                                  hours=23, minutes=59)
+        date_T_end_of_quarter = Date(freq='T', year=2007, month=3, day=31, 
+                                     hours=23, minutes=59)
+        date_T_end_of_month = Date(freq='T', year=2007, month=1, day=31, 
+                                   hours=23, minutes=59)
+        date_T_end_of_week = Date(freq='T', year=2007, month=1, day=7, 
+                                  hours=23, minutes=59)
+        date_T_end_of_day = Date(freq='T', year=2007, month=1, day=1, 
+                                 hours=23, minutes=59)
+        date_T_end_of_bus = Date(freq='T', year=2007, month=1, day=1, 
+                                 hours=23, minutes=59)
+        date_T_end_of_hour = Date(freq='T', year=2007, month=1, day=1, 
+                                  hours=0, minutes=59)
         
-        date_T_to_A = tdates.Date(freq='A', year=2007)
-        date_T_to_Q = tdates.Date(freq='Q', year=2007, quarter=1)
-        date_T_to_M = tdates.Date(freq='M', year=2007, month=1)
-        date_T_to_W = tdates.Date(freq='W', year=2007, month=1, day=7)
-        date_T_to_D = tdates.Date(freq='D', year=2007, month=1, day=1)
-        date_T_to_B = tdates.Date(freq='B', year=2007, month=1, day=1)
-        date_T_to_H = tdates.Date(freq='H', year=2007, month=1, day=1, hours=0)
+        date_T_to_A = Date(freq='A', year=2007)
+        date_T_to_Q = Date(freq='Q', year=2007, quarter=1)
+        date_T_to_M = Date(freq='M', year=2007, month=1)
+        date_T_to_W = Date(freq='W', year=2007, month=1, day=7)
+        date_T_to_D = Date(freq='D', year=2007, month=1, day=1)
+        date_T_to_B = Date(freq='B', year=2007, month=1, day=1)
+        date_T_to_H = Date(freq='H', year=2007, month=1, day=1, hours=0)
         
-        date_T_to_S_before = tdates.Date(freq='S', year=2007, month=1, day=1, hours=0, minutes=0, seconds=0)
-        date_T_to_S_after = tdates.Date(freq='S', year=2007, month=1, day=1, hours=0, minutes=0, seconds=59)
+        date_T_to_S_before = Date(freq='S', year=2007, month=1, day=1, 
+                                  hours=0, minutes=0, seconds=0)
+        date_T_to_S_after = Date(freq='S', year=2007, month=1, day=1, 
+                                 hours=0, minutes=0, seconds=59)
         
-        assert(date_T.asfreq('A') == date_T_to_A)
-        assert(date_T_end_of_year.asfreq('A') == date_T_to_A)
-        assert(date_T.asfreq('Q') == date_T_to_Q)
-        assert(date_T_end_of_quarter.asfreq('Q') == date_T_to_Q)
-        assert(date_T.asfreq('M') == date_T_to_M)
-        assert(date_T_end_of_month.asfreq('M') == date_T_to_M)
-        assert(date_T.asfreq('W') == date_T_to_W)
-        assert(date_T_end_of_week.asfreq('W') == date_T_to_W)
-        assert(date_T.asfreq('D') == date_T_to_D)
-        assert(date_T_end_of_day.asfreq('D') == date_T_to_D)
-        assert(date_T.asfreq('B') == date_T_to_B)
-        assert(date_T_end_of_bus.asfreq('B') == date_T_to_B)
-        assert(date_T.asfreq('H') == date_T_to_H)
-        assert(date_T_end_of_hour.asfreq('H') == date_T_to_H)
+        assert_equal(date_T.asfreq('A'), date_T_to_A)
+        assert_equal(date_T_end_of_year.asfreq('A'), date_T_to_A)
+        assert_equal(date_T.asfreq('Q'), date_T_to_Q)
+        assert_equal(date_T_end_of_quarter.asfreq('Q'), date_T_to_Q)
+        assert_equal(date_T.asfreq('M'), date_T_to_M)
+        assert_equal(date_T_end_of_month.asfreq('M'), date_T_to_M)
+        assert_equal(date_T.asfreq('W'), date_T_to_W)
+        assert_equal(date_T_end_of_week.asfreq('W'), date_T_to_W)
+        assert_equal(date_T.asfreq('D'), date_T_to_D)
+        assert_equal(date_T_end_of_day.asfreq('D'), date_T_to_D)
+        assert_equal(date_T.asfreq('B'), date_T_to_B)
+        assert_equal(date_T_end_of_bus.asfreq('B'), date_T_to_B)
+        assert_equal(date_T.asfreq('H'), date_T_to_H)
+        assert_equal(date_T_end_of_hour.asfreq('H'), date_T_to_H)
 
-        assert(date_T.asfreq('S', "BEFORE") == date_T_to_S_before)
-        assert(date_T.asfreq('S', "AFTER") == date_T_to_S_after)
+        assert_equal(date_T.asfreq('S', "BEFORE"), date_T_to_S_before)
+        assert_equal(date_T.asfreq('S', "AFTER"), date_T_to_S_after)
 
 
     def test_conv_secondly(self):
         "frequency conversion tests: from Secondly Frequency"
         
-        date_S = tdates.Date(freq='S', year=2007, month=1, day=1, hours=0, minutes=0, seconds=0)
-        date_S_end_of_year = tdates.Date(freq='S', year=2007, month=12, day=31, hours=23, minutes=59, seconds=59)
-        date_S_end_of_quarter = tdates.Date(freq='S', year=2007, month=3, day=31, hours=23, minutes=59, seconds=59)
-        date_S_end_of_month = tdates.Date(freq='S', year=2007, month=1, day=31, hours=23, minutes=59, seconds=59)
-        date_S_end_of_week = tdates.Date(freq='S', year=2007, month=1, day=7, hours=23, minutes=59, seconds=59)
-        date_S_end_of_day = tdates.Date(freq='S', year=2007, month=1, day=1, hours=23, minutes=59, seconds=59)
-        date_S_end_of_bus = tdates.Date(freq='S', year=2007, month=1, day=1, hours=23, minutes=59, seconds=59)
-        date_S_end_of_hour = tdates.Date(freq='S', year=2007, month=1, day=1, hours=0, minutes=59, seconds=59)
-        date_S_end_of_minute = tdates.Date(freq='S', year=2007, month=1, day=1, hours=0, minutes=0, seconds=59)
+        date_S = Date(freq='S', year=2007, month=1, day=1, 
+                      hours=0, minutes=0, seconds=0)
+        date_S_end_of_year = Date(freq='S', year=2007, month=12, day=31, 
+                                  hours=23, minutes=59, seconds=59)
+        date_S_end_of_quarter = Date(freq='S', year=2007, month=3, day=31, 
+                                     hours=23, minutes=59, seconds=59)
+        date_S_end_of_month = Date(freq='S', year=2007, month=1, day=31, 
+                                   hours=23, minutes=59, seconds=59)
+        date_S_end_of_week = Date(freq='S', year=2007, month=1, day=7, 
+                                  hours=23, minutes=59, seconds=59)
+        date_S_end_of_day = Date(freq='S', year=2007, month=1, day=1, 
+                                 hours=23, minutes=59, seconds=59)
+        date_S_end_of_bus = Date(freq='S', year=2007, month=1, day=1, 
+                                 hours=23, minutes=59, seconds=59)
+        date_S_end_of_hour = Date(freq='S', year=2007, month=1, day=1, 
+                                  hours=0, minutes=59, seconds=59)
+        date_S_end_of_minute = Date(freq='S', year=2007, month=1, day=1, 
+                                    hours=0, minutes=0, seconds=59)
         
-        date_S_to_A = tdates.Date(freq='A', year=2007)
-        date_S_to_Q = tdates.Date(freq='Q', year=2007, quarter=1)
-        date_S_to_M = tdates.Date(freq='M', year=2007, month=1)
-        date_S_to_W = tdates.Date(freq='W', year=2007, month=1, day=7)
-        date_S_to_D = tdates.Date(freq='D', year=2007, month=1, day=1)
-        date_S_to_B = tdates.Date(freq='B', year=2007, month=1, day=1)
-        date_S_to_H = tdates.Date(freq='H', year=2007, month=1, day=1, hours=0)
-        date_S_to_T = tdates.Date(freq='T', year=2007, month=1, day=1, hours=0, minutes=0)
+        date_S_to_A = Date(freq='A', year=2007)
+        date_S_to_Q = Date(freq='Q', year=2007, quarter=1)
+        date_S_to_M = Date(freq='M', year=2007, month=1)
+        date_S_to_W = Date(freq='W', year=2007, month=1, day=7)
+        date_S_to_D = Date(freq='D', year=2007, month=1, day=1)
+        date_S_to_B = Date(freq='B', year=2007, month=1, day=1)
+        date_S_to_H = Date(freq='H', year=2007, month=1, day=1, 
+                           hours=0)
+        date_S_to_T = Date(freq='T', year=2007, month=1, day=1, 
+                           hours=0, minutes=0)
         
-        assert(date_S.asfreq('A') == date_S_to_A)
-        assert(date_S_end_of_year.asfreq('A') == date_S_to_A)
-        assert(date_S.asfreq('Q') == date_S_to_Q)
-        assert(date_S_end_of_quarter.asfreq('Q') == date_S_to_Q)
-        assert(date_S.asfreq('M') == date_S_to_M)
-        assert(date_S_end_of_month.asfreq('M') == date_S_to_M)
-        assert(date_S.asfreq('W') == date_S_to_W)
-        assert(date_S_end_of_week.asfreq('W') == date_S_to_W)
-        assert(date_S.asfreq('D') == date_S_to_D)
-        assert(date_S_end_of_day.asfreq('D') == date_S_to_D)
-        assert(date_S.asfreq('B') == date_S_to_B)
-        assert(date_S_end_of_bus.asfreq('B') == date_S_to_B)
-        assert(date_S.asfreq('H') == date_S_to_H)
-        assert(date_S_end_of_hour.asfreq('H') == date_S_to_H)
-        assert(date_S.asfreq('T') == date_S_to_T)
-        assert(date_S_end_of_minute.asfreq('T') == date_S_to_T)
+        assert_equal(date_S.asfreq('A'), date_S_to_A)
+        assert_equal(date_S_end_of_year.asfreq('A'), date_S_to_A)
+        assert_equal(date_S.asfreq('Q'), date_S_to_Q)
+        assert_equal(date_S_end_of_quarter.asfreq('Q'), date_S_to_Q)
+        assert_equal(date_S.asfreq('M'), date_S_to_M)
+        assert_equal(date_S_end_of_month.asfreq('M'), date_S_to_M)
+        assert_equal(date_S.asfreq('W'), date_S_to_W)
+        assert_equal(date_S_end_of_week.asfreq('W'), date_S_to_W)
+        assert_equal(date_S.asfreq('D'), date_S_to_D)
+        assert_equal(date_S_end_of_day.asfreq('D'), date_S_to_D)
+        assert_equal(date_S.asfreq('B'), date_S_to_B)
+        assert_equal(date_S_end_of_bus.asfreq('B'), date_S_to_B)
+        assert_equal(date_S.asfreq('H'), date_S_to_H)
+        assert_equal(date_S_end_of_hour.asfreq('H'), date_S_to_H)
+        assert_equal(date_S.asfreq('T'), date_S_to_T)
+        assert_equal(date_S_end_of_minute.asfreq('T'), date_S_to_T)
         
 
 class test_methods(NumpyTestCase):


Property changes on: trunk/Lib/sandbox/timeseries/tests/test_dates.py
___________________________________________________________________
Name: svn:keywords
   + Date 
Author 
Revision
Id

Modified: trunk/Lib/sandbox/timeseries/tmulti.py
===================================================================
--- trunk/Lib/sandbox/timeseries/tmulti.py	2007-01-16 04:38:16 UTC (rev 2569)
+++ trunk/Lib/sandbox/timeseries/tmulti.py	2007-01-16 04:43:06 UTC (rev 2570)
@@ -18,6 +18,7 @@
 from numpy import bool_, complex_, float_, int_, str_, object_
 import numpy.core.fromnumeric as fromnumeric
 import numpy.core.numeric as numeric
+from numpy.core.numeric import ndarray
 import numpy.core.numerictypes as ntypes
 import numpy.core.umath as umath
 from numpy.core.defchararray import chararray
@@ -35,7 +36,7 @@
     make_mask_none, mask_or, masked_array, filled
 
 import maskedarray.mrecords as MR
-reload(MR)
+#reload(MR)
 from maskedarray.mrecords import _checknames, _guessvartypes, openfile,\
     MaskedRecords
 from maskedarray.mrecords import fromrecords as mrecfromrecords
@@ -43,7 +44,7 @@
 from tseries import TimeSeries, time_series, _getdatalength
 from tdates import Date, DateArray, date_array
 
-ndarray = numeric.ndarray
+#ndarray = numeric.ndarray
 _byteorderconv = numpy.core.records._byteorderconv
 _typestr = ntypes._typestr
 
@@ -54,6 +55,9 @@
 logging.basicConfig(level=logging.DEBUG,
                     format='%(name)-15s %(levelname)s %(message)s',)
 
+__all__ = [
+'MultiTimeSeries','fromarrays','fromrecords','fromtextfile',           
+]
 
 def _getformats(data):
     """Returns the formats of each array of arraylist as a comma-separated 
@@ -130,6 +134,27 @@
 #        assert(_datadatescompat(data,newdates))
         #
         return _data.view(cls)
+    
+        #..................................
+    def __array_wrap__(self, obj, context=None):
+        """Special hook for ufuncs.
+Wraps the numpy array and sets the mask according to context.
+        """
+#        mclass = self.__class__
+        #..........
+        logging.debug("__wrap__ received %s" % type(obj))
+        if context is None:
+#            return mclass(obj, mask=self._mask, copy=False)
+            return MaskedArray(obj, mask=self._mask, copy=False,
+                               dtype=obj.dtype,
+                               fill_value=self.fill_value, )
+        #..........
+        (func, args) = context[:2]
+ 
+#        return mclass(obj, copy=False, mask=m)
+        return MultiTimeSeries(obj, copy=False, mask=m,)
+#                           dtype=obj.dtype, fill_value=self._fill_value)
+    
         
     def __array_finalize__(self,obj):
         logging.debug("__array_finalize__ received %s" % type(obj))      
@@ -600,6 +625,7 @@
 #        descr = [('A',N.float_),('B',N.float_)]
 #
 #if 1:
+#    import numpy as N
 #    if 1:        
 ##    def setup(self):       
 ##        "Generic setup" 
@@ -613,6 +639,8 @@
 #        dates = date_array(dlist)
 #        ts = time_series(mrec,dates)
 #        mts = MultiTimeSeries(mrec,dates)
+#        
+#        logmts = N.log(mts)
 #        self_data = [d, m, mrec, dlist, dates, ts, mts]
 #        #
 #        mts.addfield(masked_array(d+10, mask=m[::-1]))

Modified: trunk/Lib/sandbox/timeseries/tseries.py
===================================================================
--- trunk/Lib/sandbox/timeseries/tseries.py	2007-01-16 04:38:16 UTC (rev 2569)
+++ trunk/Lib/sandbox/timeseries/tseries.py	2007-01-16 04:43:06 UTC (rev 2570)
@@ -17,20 +17,15 @@
 
 
 
-:author: Pierre Gerard-Marchant
-:contact: pierregm_at_uga_dot_edu
+:author: Pierre GF Gerard-Marchant & Matt Knox
+:contact: pierregm_at_uga_dot_edu - mattknox_ca_at_hotmail_dot_com
 :version: $Id$
 """
-__author__ = "Pierre GF Gerard-Marchant ($Author$)"
+__author__ = "Pierre GF Gerard-Marchant & Matt Knox ($Author$)"
 __version__ = '1.0'
 __revision__ = "$Revision$"
 __date__     = '$Date$'
 
-
-import logging
-import weakref
-
-
 import numpy
 from numpy import ndarray
 from numpy.core import bool_, complex_, float_, int_, object_
@@ -42,7 +37,6 @@
 
 import maskedarray as MA
 #reload(MA)
-#MaskedArray = MA.MaskedArray
 from maskedarray.core import MaskedArray, MAError, masked, nomask, \
     filled, getmask, getmaskarray, make_mask_none, mask_or, make_mask, \
     masked_array
@@ -60,7 +54,17 @@
 import cseries
 #reload(cseries)
 
+__all__ = [
+'TimeSeriesError','TimeSeriesCompatibilityError','TimeSeries','isTimeSeries',
+'time_series',
+'day_of_week','dat_of_year','day','month','quarter','year','hour','minute','second',  
+'tofile','asrecords','flatten','adjust_endpoints','align_series','aligned',
+'mask_period','mask_inside_period','mask_outside_period',
+'convert','fill_missing_dates'
+           ]
+
 #...............................................................................
+import logging
 logging.basicConfig(level=logging.DEBUG,
                     format='%(name)-15s %(levelname)s %(message)s',)
 talog = logging.getLogger('log.TimeArray')
@@ -1143,7 +1147,8 @@
     delta = dflat.get_steps()-1
     gap = delta.nonzero()
     slcid = numpy.r_[[0,], numpy.arange(1,n)[gap], [n,]]
-    oldslc = numpy.array([slice(i,e) for (i,e) in numpy.broadcast(slcid[:-1],slcid[1:])])
+    oldslc = numpy.array([slice(i,e) 
+                          for (i,e) in numpy.broadcast(slcid[:-1],slcid[1:])])
     addidx = delta[gap].astype(int_).cumsum()
     newslc = numpy.r_[[oldslc[0]], 
                       [slice(i+d,e+d) for (i,e,d) in \
@@ -1184,7 +1189,7 @@
     return time_series(newdata.reshape(nshp), newdates)
 
 
-
+################################################################################
 if __name__ == '__main__':
     logging.basicConfig(level=logging.DEBUG)
     from maskedarray.testutils import assert_equal



More information about the Scipy-svn mailing list