summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2021-02-26 16:02:19 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2021-02-26 16:02:19 +0100
commit32bcad3482781e7e2e42c5de10d938c1567b8390 (patch)
tree3bbb58740d04c789f549de50dce1f0cc2a45480d /test
parent21698b9915f02216a1afa5afb36b56f65f30b8ca (diff)
refactor param_info, show splits in analyze-archive output
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_ptamodel.py18
-rwxr-xr-xtest/test_timingharness.py32
2 files changed, 25 insertions, 25 deletions
diff --git a/test/test_ptamodel.py b/test/test_ptamodel.py
index 55f84b8..257215f 100755
--- a/test/test_ptamodel.py
+++ b/test/test_ptamodel.py
@@ -640,26 +640,26 @@ class TestFromFile(unittest.TestCase):
param_model, param_info = model.get_fitted()
self.assertEqual(param_info("POWERDOWN", "power"), None)
self.assertEqual(
- param_info("RX", "power")["function"].model_function,
+ 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"].model_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"].model_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_function,
+ 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_function,
+ 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_function,
+ param_info("stopListening", "duration").function.model_function,
"0 + regression_arg(0) + regression_arg(1) * 1/(parameter(datarate))",
)
@@ -1825,7 +1825,7 @@ class TestFromFile(unittest.TestCase):
param_model, param_info = model.get_fitted()
self.assertEqual(param_info("IDLE", "power"), None)
self.assertEqual(
- param_info("RX", "power")["function"].model_function,
+ 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)
@@ -1834,10 +1834,10 @@ class TestFromFile(unittest.TestCase):
self.assertEqual(param_info("XOFF", "power"), None)
self.assertAlmostEqual(
- param_info("RX", "power")["function"].model_args[0], 84415, places=0
+ param_info("RX", "power").function.model_args[0], 84415, places=0
)
self.assertAlmostEqual(
- param_info("RX", "power")["function"].model_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 9b55231..5cc0bec 100755
--- a/test/test_timingharness.py
+++ b/test/test_timingharness.py
@@ -34,21 +34,21 @@ 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_function,
+ 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"].model_args[0], 1163, places=0
+ param_info("write", "duration").function.model_args[0], 1163, places=0
)
self.assertAlmostEqual(
- param_info("write", "duration")["function"].model_args[1], 464, places=0
+ param_info("write", "duration").function.model_args[1], 464, places=0
)
self.assertAlmostEqual(
- param_info("write", "duration")["function"].model_args[2], 1, places=0
+ param_info("write", "duration").function.model_args[2], 1, places=0
)
self.assertAlmostEqual(
- param_info("write", "duration")["function"].model_args[3], 1, places=0
+ param_info("write", "duration").function.model_args[3], 1, places=0
)
def test_dependent_parameter_pruning(self):
@@ -82,21 +82,21 @@ 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_function,
+ 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"].model_args[0], 1163, places=0
+ param_info("write", "duration").function.model_args[0], 1163, places=0
)
self.assertAlmostEqual(
- param_info("write", "duration")["function"].model_args[1], 464, places=0
+ param_info("write", "duration").function.model_args[1], 464, places=0
)
self.assertAlmostEqual(
- param_info("write", "duration")["function"].model_args[2], 1, places=0
+ param_info("write", "duration").function.model_args[2], 1, places=0
)
self.assertAlmostEqual(
- param_info("write", "duration")["function"].model_args[3], 1, places=0
+ param_info("write", "duration").function.model_args[3], 1, places=0
)
def test_function_override(self):
@@ -140,24 +140,24 @@ 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_function,
+ 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"].model_args[0], 1162, places=0
+ param_info("write", "duration").function.model_args[0], 1162, places=0
)
self.assertAlmostEqual(
- param_info("write", "duration")["function"].model_args[1], 464, places=0
+ param_info("write", "duration").function.model_args[1], 464, places=0
)
self.assertAlmostEqual(
- param_info("write", "duration")["function"].model_args[2], 1, places=0
+ param_info("write", "duration").function.model_args[2], 1, places=0
)
self.assertAlmostEqual(
- param_info("write", "duration")["function"].model_args[3], 1, places=0
+ param_info("write", "duration").function.model_args[3], 1, places=0
)
self.assertAlmostEqual(
- param_info("write", "duration")["function"].model_args[4], 1086, places=0
+ param_info("write", "duration").function.model_args[4], 1086, places=0
)
os.environ.pop("DFATOOL_NO_DECISIONTREES")