diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/test_parameters.py | 2 | ||||
-rwxr-xr-x | test/test_ptamodel.py | 18 | ||||
-rwxr-xr-x | test/test_timingharness.py | 32 |
3 files changed, 26 insertions, 26 deletions
diff --git a/test/test_parameters.py b/test/test_parameters.py index 5d7ec84..baf1c99 100755 --- a/test/test_parameters.py +++ b/test/test_parameters.py @@ -63,7 +63,7 @@ class TestModels(unittest.TestCase): combined_fit = analytic.function_powerset(fit_result, parameter_names, 0) self.assertEqual( - combined_fit._model_str, + combined_fit.model_function, "0 + regression_arg(0) + regression_arg(1) * parameter(p_linear)", ) self.assertEqual( diff --git a/test/test_ptamodel.py b/test/test_ptamodel.py index 3237450..9abe3c0 100755 --- a/test/test_ptamodel.py +++ b/test/test_ptamodel.py @@ -134,26 +134,26 @@ class TestModels(unittest.TestCase): param_model, param_info = model.get_fitted() self.assertEqual(param_info("POWERDOWN", "power"), None) self.assertEqual( - param_info("RX", "power")["function"]._model_str, + param_info("RX", "power")["function"].model_function, "0 + regression_arg(0) + regression_arg(1) * np.sqrt(parameter(datarate))", ) self.assertAlmostEqual( - param_info("RX", "power")["function"]._regression_args[0], 48530.7, places=0 + param_info("RX", "power")["function"].model_args[0], 48530.7, places=0 ) self.assertAlmostEqual( - param_info("RX", "power")["function"]._regression_args[1], 117, places=0 + param_info("RX", "power")["function"].model_args[1], 117, places=0 ) self.assertEqual(param_info("STANDBY1", "power"), None) self.assertEqual( - param_info("TX", "power")["function"]._model_str, + param_info("TX", "power")["function"].model_function, "0 + regression_arg(0) + regression_arg(1) * 1/(parameter(datarate)) + regression_arg(2) * parameter(txpower) + regression_arg(3) * 1/(parameter(datarate)) * parameter(txpower)", ) self.assertEqual( - param_info("epilogue", "timeout")["function"]._model_str, + param_info("epilogue", "timeout")["function"].model_function, "0 + regression_arg(0) + regression_arg(1) * 1/(parameter(datarate))", ) self.assertEqual( - param_info("stopListening", "duration")["function"]._model_str, + param_info("stopListening", "duration")["function"].model_function, "0 + regression_arg(0) + regression_arg(1) * 1/(parameter(datarate))", ) @@ -371,7 +371,7 @@ class TestModels(unittest.TestCase): param_model, param_info = model.get_fitted() self.assertEqual(param_info("IDLE", "power"), None) self.assertEqual( - param_info("RX", "power")["function"]._model_str, + param_info("RX", "power")["function"].model_function, "0 + regression_arg(0) + regression_arg(1) * np.log(parameter(symbolrate) + 1)", ) self.assertEqual(param_info("SLEEP", "power"), None) @@ -380,10 +380,10 @@ class TestModels(unittest.TestCase): self.assertEqual(param_info("XOFF", "power"), None) self.assertAlmostEqual( - param_info("RX", "power")["function"]._regression_args[0], 84415, places=0 + param_info("RX", "power")["function"].model_args[0], 84415, places=0 ) self.assertAlmostEqual( - param_info("RX", "power")["function"]._regression_args[1], 206, places=0 + param_info("RX", "power")["function"].model_args[1], 206, places=0 ) diff --git a/test/test_timingharness.py b/test/test_timingharness.py index 29e21f8..13289ea 100755 --- a/test/test_timingharness.py +++ b/test/test_timingharness.py @@ -30,25 +30,25 @@ class TestModels(unittest.TestCase): self.assertEqual(param_info("setRetries", "duration"), None) self.assertEqual(param_info("setup", "duration"), None) self.assertEqual( - param_info("write", "duration")["function"]._model_str, + param_info("write", "duration")["function"].model_function, "0 + regression_arg(0) + regression_arg(1) * parameter(max_retry_count) + regression_arg(2) * parameter(retry_delay) + regression_arg(3) * parameter(max_retry_count) * parameter(retry_delay)", ) self.assertAlmostEqual( - param_info("write", "duration")["function"]._regression_args[0], + param_info("write", "duration")["function"].model_args[0], 1163, places=0, ) self.assertAlmostEqual( - param_info("write", "duration")["function"]._regression_args[1], + param_info("write", "duration")["function"].model_args[1], 464, places=0, ) self.assertAlmostEqual( - param_info("write", "duration")["function"]._regression_args[2], 1, places=0 + param_info("write", "duration")["function"].model_args[2], 1, places=0 ) self.assertAlmostEqual( - param_info("write", "duration")["function"]._regression_args[3], 1, places=0 + param_info("write", "duration")["function"].model_args[3], 1, places=0 ) def test_dependent_parameter_pruning(self): @@ -80,25 +80,25 @@ class TestModels(unittest.TestCase): self.assertEqual(param_info("setRetries", "duration"), None) self.assertEqual(param_info("setup", "duration"), None) self.assertEqual( - param_info("write", "duration")["function"]._model_str, + param_info("write", "duration")["function"].model_function, "0 + regression_arg(0) + regression_arg(1) * parameter(max_retry_count) + regression_arg(2) * parameter(retry_delay) + regression_arg(3) * parameter(max_retry_count) * parameter(retry_delay)", ) self.assertAlmostEqual( - param_info("write", "duration")["function"]._regression_args[0], + param_info("write", "duration")["function"].model_args[0], 1163, places=0, ) self.assertAlmostEqual( - param_info("write", "duration")["function"]._regression_args[1], + param_info("write", "duration")["function"].model_args[1], 464, places=0, ) self.assertAlmostEqual( - param_info("write", "duration")["function"]._regression_args[2], 1, places=0 + param_info("write", "duration")["function"].model_args[2], 1, places=0 ) self.assertAlmostEqual( - param_info("write", "duration")["function"]._regression_args[3], 1, places=0 + param_info("write", "duration")["function"].model_args[3], 1, places=0 ) def test_function_override(self): @@ -139,28 +139,28 @@ class TestModels(unittest.TestCase): self.assertEqual(param_info("setRetries", "duration"), None) self.assertEqual(param_info("setup", "duration"), None) self.assertEqual( - param_info("write", "duration")["function"]._model_str, + param_info("write", "duration")["function"].model_function, "(parameter(auto_ack!) * (regression_arg(0) + regression_arg(1) * parameter(max_retry_count) + regression_arg(2) * parameter(retry_delay) + regression_arg(3) * parameter(max_retry_count) * parameter(retry_delay))) + ((1 - parameter(auto_ack!)) * regression_arg(4))", ) self.assertAlmostEqual( - param_info("write", "duration")["function"]._regression_args[0], + param_info("write", "duration")["function"].model_args[0], 1162, places=0, ) self.assertAlmostEqual( - param_info("write", "duration")["function"]._regression_args[1], + param_info("write", "duration")["function"].model_args[1], 464, places=0, ) self.assertAlmostEqual( - param_info("write", "duration")["function"]._regression_args[2], 1, places=0 + param_info("write", "duration")["function"].model_args[2], 1, places=0 ) self.assertAlmostEqual( - param_info("write", "duration")["function"]._regression_args[3], 1, places=0 + param_info("write", "duration")["function"].model_args[3], 1, places=0 ) self.assertAlmostEqual( - param_info("write", "duration")["function"]._regression_args[4], + param_info("write", "duration")["function"].model_args[4], 1086, places=0, ) |