示例#1
0
文件: tsop.py 项目: andrew361x/dynts
    def testArithOpWithDiffNumberCols(self):
        '''
        you can't perform arithmetic on timeseries that each have a different number of columns
        '''
        ts1 = self.getts(cols=2)
        ts2 = self.getts(cols=1)

        op = list(itervalues(ops))[0]

        curry_fn = lambda: op(ts1, ts2)
        self.assertRaises(exceptions.ExpressionError, curry_fn)
示例#2
0
文件: tsop.py 项目: arjunpmm/dynts
    def testArithOpWithDiffNumberCols(self):
        '''
        you can't perform arithmetic on timeseries that each have a different number of columns
        '''
        ts1 = self.getts(cols=2)
        ts2 = self.getts(cols=1)

        op = list(itervalues(ops))[0]

        curry_fn = lambda: op(ts1, ts2)
        self.assertRaises(exceptions.ExpressionError, curry_fn)
示例#3
0
文件: tsop.py 项目: andrew361x/dynts
    def testArithOpWithMissingDates(self):
        ts1, dates1, data1 = self.getts(returndata=True, cols=2)
        ts2, dates2, data2 = self.getts(returndata=True, cols=2, delta=2)

        all_dates = list(set(dates1).union(set(dates2)))
        all_dates.sort()
        op = list(itervalues(ops))[0]
        ts3 = op(ts1, ts2)
        # Check that all the dates are in the return series by default
        self.check_dates(ts3, all_dates)
        btree = ts3.asbtree()
        not_in_dates2 = set(dates1) - set(dates2)
        self._check_missing_dts(not_in_dates2, btree)

        not_in_dates1 = set(dates2) - set(dates1)
        self._check_missing_dts(not_in_dates1, btree)
示例#4
0
文件: tsop.py 项目: arjunpmm/dynts
    def testArithOpWithMissingDates(self):
        ts1, dates1, data1 = self.getts(returndata=True, cols=2)
        ts2, dates2, data2 = self.getts(returndata=True, cols=2, delta=2)

        all_dates = list(set(dates1).union(set(dates2)))
        all_dates.sort()
        op = list(itervalues(ops))[0]
        ts3 = op(ts1, ts2)
        # Check that all the dates are in the return series by default
        self.check_dates(ts3, all_dates)
        btree = ts3.asbtree()
        not_in_dates2 = set(dates1) - set(dates2)
        self._check_missing_dts(not_in_dates2, btree)

        not_in_dates1 = set(dates2) - set(dates1)
        self._check_missing_dts(not_in_dates1, btree)