def test_create_function_str_for_nth_order_given_fixed_values(self): background = PolynomialBackground(order=2) param_values = {"f1.A0": 2.0, "f1.A1": 3.0, "f1.A2": 4.0} expected = "name=Polynomial,n=2,A0=2.000000,A1=3.000000,A2=4.000000" self.assertEqual( expected, background.create_fit_function_str(param_values, param_prefix="f1."))
def test_create_function_str_for_nth_order_given_fixed_values(self): background = PolynomialBackground(order=2) param_values = {"f1.A0": 2.0, "f1.A1": 3.0, "f1.A2": 4.0} expected = "name=Polynomial,n=2,A0=2.000000,A1=3.000000,A2=4.000000" self.assertEqual(expected, background.create_fit_function_str(param_values, param_prefix="f1."))
def test_create_function_str_for_nth_order_with_no_values(self): background = PolynomialBackground(order=2) expected = "name=Polynomial,n=2" self.assertEqual(expected, background.create_fit_function_str())