summaryrefslogtreecommitdiff
path: root/test/test_timingharness.py
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2021-02-18 12:07:52 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2021-02-18 12:07:52 +0100
commitc68c4a2bc617dd1356d5d0d2c3ee0ff9754261ab (patch)
tree20446fcd7ed1f8f4a88d112ef5f8573debf0ccd6 /test/test_timingharness.py
parent45310b5f95dba00b1b6e2191309961c98ba9980c (diff)
refactor model generation from Analytic/PTAModel into ModelAttribute class
Iteration over states/transitions and model attributes is no longer hardcoded into most model generation code. This should make support for decision trees and sub-states much easier.
Diffstat (limited to 'test/test_timingharness.py')
-rwxr-xr-xtest/test_timingharness.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/test/test_timingharness.py b/test/test_timingharness.py
index 917e4e2..3e7e5bd 100755
--- a/test/test_timingharness.py
+++ b/test/test_timingharness.py
@@ -21,7 +21,9 @@ class TestModels(unittest.TestCase):
for transition in "setPALevel setRetries setup write".split(" "):
self.assertAlmostEqual(
- model.stats.param_dependence_ratio(transition, "duration", "channel"),
+ model.attr_by_name[transition]["duration"].stats.param_dependence_ratio(
+ "channel"
+ ),
0,
places=2,
)
@@ -36,10 +38,10 @@ class TestModels(unittest.TestCase):
)
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
@@ -66,7 +68,9 @@ class TestModels(unittest.TestCase):
for transition in "getObserveTx setPALevel setRetries setup write".split(" "):
self.assertAlmostEqual(
- model.stats.param_dependence_ratio(transition, "duration", "channel"),
+ model.attr_by_name[transition]["duration"].stats.param_dependence_ratio(
+ "channel"
+ ),
0,
places=2,
)
@@ -82,10 +86,10 @@ class TestModels(unittest.TestCase):
)
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
@@ -121,7 +125,9 @@ class TestModels(unittest.TestCase):
for transition in "setAutoAck setPALevel setRetries setup write".split(" "):
self.assertAlmostEqual(
- model.stats.param_dependence_ratio(transition, "duration", "channel"),
+ model.attr_by_name[transition]["duration"].stats.param_dependence_ratio(
+ "channel"
+ ),
0,
places=2,
)
@@ -137,10 +143,10 @@ class TestModels(unittest.TestCase):
)
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
@@ -149,7 +155,7 @@ class TestModels(unittest.TestCase):
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
)