def test_engine(self): """changepoint.pelt.Pelt: set numba engine""" c = pelt.Pelt("l2", 1, 1, engine=self.engine) assert hasattr(c.segmentation, "py_func")
def test_init(self): """changepoint.pelt.Pelt.__init__""" c = pelt.Pelt("l2", 1, 1, engine=self.engine) self.assertIsInstance(c.cost, type(self.cost)) self.assertEqual(c._min_size, self.cost.min_size)
def test_find_changepoints(self): """changepoint.pelt.Pelt.find_changepoints""" c = pelt.Pelt("l2", 1, 1, engine=self.engine) cp = c.find_changepoints(self.data, self.penalty) np.testing.assert_equal(cp, self.cp)
def test_engine(self): """changepoint.pelt.Pelt: set python engine""" c = pelt.Pelt("l2", 1, 1, engine=self.engine) self.assertIsInstance(c.segmentation, types.FunctionType)