Exemple #1
0
    def test_preprocess_args(self):
        features = Features()
        time, values, a, b = features.preprocess(self.time, self.values, 1, 2)

        self.assertTrue(np.array_equal(time, self.time))
        self.assertTrue(np.array_equal(values, self.values))
        self.assertEqual(a, 1)
        self.assertEqual(b, 2)
Exemple #2
0
    def test_preprocess_assign(self):
        def preprocess(time, values):
            return "time", "values"

        features = Features(preprocess=preprocess)

        time, values = features.preprocess(self.time, self.values)

        self.assertEqual(time, "time")
        self.assertEqual(values, "values")

        features = Features(preprocess=None)
        features.preprocess = preprocess

        time, values = features.preprocess(self.time, self.values)

        self.assertEqual(time, "time")
        self.assertEqual(values, "values")

        features = Features(preprocess=None)
        with self.assertRaises(TypeError):
            features.preprocess = 12
Exemple #3
0
    def test_preprocess(self):
        features = Features()
        time, values = features.preprocess(self.time, self.values)

        self.assertTrue(np.array_equal(time, self.time))
        self.assertTrue(np.array_equal(values, self.values))