def __buildTrend(self, values, trendDays, positiveThreshold, negativeThreshold, trendMaxLen=None): seqDS = dataseries.SequenceDataSeries() ret = linreg.Trend(seqDS, trendDays, positiveThreshold, negativeThreshold, trendMaxLen) for value in values: seqDS.append(value) return ret
def testInvalidThreshold(self): seqDS = dataseries.SequenceDataSeries() with self.assertRaisesRegexp(Exception, "Invalid thresholds"): linreg.Trend(seqDS, 10, 0.2, 0.5, 5)