diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2021-03-03 09:36:43 +0100 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2021-03-03 09:36:43 +0100 |
commit | f33c69dcaf24ecc7e039dec83a4a5c74908da52f (patch) | |
tree | df5ada7af874161f70d866b4f8c1d878f1a373cc /test/test_ptamodel.py | |
parent | d0d3f335739d9333f15ede487574f78f1eb5e638 (diff) |
Remove ModelInfo; add info to ModelFunction instead
Diffstat (limited to 'test/test_ptamodel.py')
-rwxr-xr-x | test/test_ptamodel.py | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/test/test_ptamodel.py b/test/test_ptamodel.py index e571dcc..9f5076c 100755 --- a/test/test_ptamodel.py +++ b/test/test_ptamodel.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -from dfatool.functions import StaticInfo +from dfatool.functions import StaticFunction from dfatool.loader import RawData, pta_trace_to_aggregate from dfatool.model import PTAModel from dfatool.utils import by_name_to_by_param @@ -639,28 +639,26 @@ class TestFromFile(unittest.TestCase): ) param_model, param_info = model.get_fitted() - self.assertIsInstance(param_info("POWERDOWN", "power"), StaticInfo) + self.assertIsInstance(param_info("POWERDOWN", "power"), StaticFunction) self.assertEqual( - param_info("RX", "power").function.model_function, + param_info("RX", "power").model_function, "0 + regression_arg(0) + regression_arg(1) * np.sqrt(parameter(datarate))", ) self.assertAlmostEqual( - param_info("RX", "power").function.model_args[0], 48530.7, places=0 + param_info("RX", "power").model_args[0], 48530.7, places=0 ) - self.assertAlmostEqual( - param_info("RX", "power").function.model_args[1], 117, places=0 - ) - self.assertIsInstance(param_info("STANDBY1", "power"), StaticInfo) + self.assertAlmostEqual(param_info("RX", "power").model_args[1], 117, places=0) + self.assertIsInstance(param_info("STANDBY1", "power"), StaticFunction) self.assertEqual( - param_info("TX", "power").function.model_function, + param_info("TX", "power").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_function, + param_info("epilogue", "timeout").model_function, "0 + regression_arg(0) + regression_arg(1) * 1/(parameter(datarate))", ) self.assertEqual( - param_info("stopListening", "duration").function.model_function, + param_info("stopListening", "duration").model_function, "0 + regression_arg(0) + regression_arg(1) * 1/(parameter(datarate))", ) @@ -1823,22 +1821,18 @@ class TestFromFile(unittest.TestCase): """ param_model, param_info = model.get_fitted() - self.assertIsInstance(param_info("IDLE", "power"), StaticInfo) + self.assertIsInstance(param_info("IDLE", "power"), StaticFunction) self.assertEqual( - param_info("RX", "power").function.model_function, + param_info("RX", "power").model_function, "0 + regression_arg(0) + regression_arg(1) * np.log(parameter(symbolrate) + 1)", ) - self.assertIsInstance(param_info("SLEEP", "power"), StaticInfo) - self.assertIsInstance(param_info("SLEEP_EWOR", "power"), StaticInfo) - self.assertIsInstance(param_info("SYNTH_ON", "power"), StaticInfo) - self.assertIsInstance(param_info("XOFF", "power"), StaticInfo) + self.assertIsInstance(param_info("SLEEP", "power"), StaticFunction) + self.assertIsInstance(param_info("SLEEP_EWOR", "power"), StaticFunction) + self.assertIsInstance(param_info("SYNTH_ON", "power"), StaticFunction) + self.assertIsInstance(param_info("XOFF", "power"), StaticFunction) - self.assertAlmostEqual( - param_info("RX", "power").function.model_args[0], 84415, places=0 - ) - self.assertAlmostEqual( - param_info("RX", "power").function.model_args[1], 206, places=0 - ) + self.assertAlmostEqual(param_info("RX", "power").model_args[0], 84415, places=0) + self.assertAlmostEqual(param_info("RX", "power").model_args[1], 206, places=0) if __name__ == "__main__": |