Skip to content

Commit 2d85097

Browse files
committed
Clarified experiemental estimator test.
1 parent 9cfff7d commit 2d85097

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

tests/estimation_tests/test_experimental_estimator.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,28 @@
22
from causal_testing.estimation.experimental_estimator import ExperimentalEstimator
33

44

5+
class SystemUnderTest:
6+
"""
7+
Basic example of a system under test.
8+
"""
9+
10+
def run(self, x):
11+
return x * 2
12+
13+
514
class ConcreteExperimentalEstimator(ExperimentalEstimator):
6-
def run_system(self, configuration):
7-
return {"Y": 2 * configuration["X"]}
15+
"""
16+
Concrete experimental estimator class which integrates with the system under test.
17+
"""
18+
19+
def run_system(self, configuration: dict):
20+
"""
21+
Sets up the system under test, runs with the given configuration, and returns the result in the correct format.
22+
:param configuration: The configuration.
23+
:returns: Dictionary with the output.
24+
"""
25+
sut = SystemUnderTest()
26+
return {"Y": sut.run(configuration["x"])}
827

928

1029
class TestExperimentalEstimator(unittest.TestCase):

0 commit comments

Comments
 (0)