File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ def get_treatment_variables(self):
57
57
58
58
def get_outcome_variables (self ):
59
59
"""Return a list of the outcome variables (as strings) for this causal test case."""
60
- return [v . name for v in self .outcome_variables ]
60
+ return [self .outcome_variable . name ]
61
61
62
62
def get_control_values (self ):
63
63
"""Return a list of the control values for each treatment variable in this causal test case."""
@@ -70,7 +70,8 @@ def get_treatment_values(self):
70
70
def __str__ (self ):
71
71
treatment_config = {k .name : v for k , v in self .treatment_input_configuration .items ()}
72
72
control_config = {k .name : v for k , v in self .control_input_configuration .items ()}
73
+ outcome_variable = {self .outcome_variable }
73
74
return (
74
75
f"Running { treatment_config } instead of { control_config } should cause the following "
75
- f"changes to { self . outcome_variable } : { self .expected_causal_effect } ."
76
+ f"changes to { outcome_variable } : { self .expected_causal_effect } ."
76
77
)
Original file line number Diff line number Diff line change 6
6
from causal_testing .specification .causal_dag import CausalDAG
7
7
from causal_testing .testing .causal_test_case import CausalTestCase
8
8
from causal_testing .testing .causal_test_outcome import ExactValue
9
+ from causal_testing .testing .base_causal_test import BaseCausalTest
9
10
10
11
class TestCausalTestEngineObservational (unittest .TestCase ):
11
12
""" Test the CausalTestEngine workflow using observational data.
@@ -33,11 +34,13 @@ def setUp(self) -> None:
33
34
34
35
# 3. Create an intervention and causal test case
35
36
self .expected_causal_effect = ExactValue (4 )
37
+ self .base_causal_test = BaseCausalTest (A , C )
36
38
self .causal_test_case = CausalTestCase (
37
- control_input_configuration = { A : 0 } ,
39
+ base_causal_test = self . base_causal_test ,
38
40
expected_causal_effect = self .expected_causal_effect ,
39
- treatment_input_configuration = {A : 1 },
40
- outcome_variables = {C })
41
+ control_value = 0 ,
42
+ treatment_value = 1
43
+ )
41
44
42
45
def test_get_treatment_variables (self ):
43
46
self .assertEqual (self .causal_test_case .get_treatment_variables (), ["A" ])
You can’t perform that action at this time.
0 commit comments