def testEvalMany(self): s = segment.FitSet([self.a, self.b]) for x, expectedy in zip([1.5, 2.5], [1.5, 1.5]): self.assertAlmostEqual(s.eval(x), expectedy, 2, "Evaluation with multiple fits failed")
def testAppend(self): s = segment.FitSet([self.a]) self.assertTrue(len(s) == 1, "Construction failed to add one element") s.append(self.b) self.assertTrue(len(s) == 2, "Append failed to add one element")
def testEvalSingle(self): s = segment.FitSet([self.a]) self.assertAlmostEqual(s.eval(1.5), 1.5, 2, "Evaluation at single point failed")
def testInit(self): s = segment.FitSet()