summaryrefslogtreecommitdiff
path: root/test/test_timingharness.py
diff options
context:
space:
mode:
authorBirte Kristina Friesel <birte.friesel@uos.de>2024-01-17 15:13:24 +0100
committerBirte Kristina Friesel <birte.friesel@uos.de>2024-01-17 15:13:24 +0100
commita75b82d75da7146d9559413d9cb7766e751ca7ea (patch)
treefb5fb6acf0229ffc3c9d730be258a4c6390b437f /test/test_timingharness.py
parent0015665bda8511db30c254adb351af94494deb7f (diff)
update tests for 0015665bda8511db30c254adb351af94494deb7f
Diffstat (limited to 'test/test_timingharness.py')
-rwxr-xr-xtest/test_timingharness.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/test/test_timingharness.py b/test/test_timingharness.py
index 0741c7a..c37fd3d 100755
--- a/test/test_timingharness.py
+++ b/test/test_timingharness.py
@@ -31,9 +31,12 @@ class TestModels(unittest.TestCase):
param_model, param_info = model.get_fitted()
self.assertIsInstance(param_info("setPALevel", "duration"), StaticFunction)
- self.assertIsInstance(param_info("setRetries", "duration"), StaticFunction)
self.assertIsInstance(param_info("setup", "duration"), StaticFunction)
self.assertEqual(
+ param_info("setRetries", "duration").model_function,
+ "0 + regression_arg(0) + regression_arg(1) * np.log(function_arg(0) + 1) + regression_arg(2) * np.log(function_arg(1) + 1) + regression_arg(3) * np.log(function_arg(0) + 1) * np.log(function_arg(1) + 1)",
+ )
+ self.assertEqual(
param_info("write", "duration").model_function,
"0 + regression_arg(0) + regression_arg(1) * parameter(max_retry_count) + regression_arg(2) * parameter(retry_delay) + regression_arg(3) * function_arg(1) + regression_arg(4) * parameter(max_retry_count) * parameter(retry_delay) + regression_arg(5) * parameter(max_retry_count) * function_arg(1) + regression_arg(6) * parameter(retry_delay) * function_arg(1) + regression_arg(7) * parameter(max_retry_count) * parameter(retry_delay) * function_arg(1)",
)
@@ -90,9 +93,12 @@ class TestModels(unittest.TestCase):
param_model, param_info = model.get_fitted()
self.assertIsInstance(param_info("getObserveTx", "duration"), StaticFunction)
self.assertIsInstance(param_info("setPALevel", "duration"), StaticFunction)
- self.assertIsInstance(param_info("setRetries", "duration"), StaticFunction)
self.assertIsInstance(param_info("setup", "duration"), StaticFunction)
self.assertEqual(
+ param_info("setRetries", "duration").model_function,
+ "0 + regression_arg(0) + regression_arg(1) * np.log(function_arg(0) + 1) + regression_arg(2) * np.log(function_arg(1) + 1) + regression_arg(3) * np.log(function_arg(0) + 1) * np.log(function_arg(1) + 1)",
+ )
+ self.assertEqual(
param_info("write", "duration").model_function,
"0 + regression_arg(0) + regression_arg(1) * parameter(max_retry_count) + regression_arg(2) * parameter(retry_delay) + regression_arg(3) * function_arg(1) + regression_arg(4) * parameter(max_retry_count) * parameter(retry_delay) + regression_arg(5) * parameter(max_retry_count) * function_arg(1) + regression_arg(6) * parameter(retry_delay) * function_arg(1) + regression_arg(7) * parameter(max_retry_count) * parameter(retry_delay) * function_arg(1)",
)
@@ -159,10 +165,16 @@ class TestModels(unittest.TestCase):
param_model, param_info = model.get_fitted()
self.assertIsInstance(param_info("setAutoAck", "duration"), StaticFunction)
- self.assertIsInstance(param_info("setPALevel", "duration"), StaticFunction)
- self.assertIsInstance(param_info("setRetries", "duration"), StaticFunction)
self.assertIsInstance(param_info("setup", "duration"), StaticFunction)
self.assertEqual(
+ param_info("setRetries", "duration").model_function,
+ "0 + regression_arg(0) + regression_arg(1) * np.exp(function_arg(0)) + regression_arg(2) * np.log(function_arg(1) + 1) + regression_arg(3) * np.exp(function_arg(0)) * np.log(function_arg(1) + 1)",
+ )
+ self.assertEqual(
+ param_info("setPALevel", "duration").model_function,
+ "0 + regression_arg(0) + regression_arg(1) * 1/(parameter(retry_delay))",
+ )
+ self.assertEqual(
param_info("write", "duration").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))",
)