Skip to content

Commit 13a44fc

Browse files
authored
Merge pull request #231 from CITCOM-project/remove-getters-2.0
Remove getters in test usage and examples
2 parents e9173ac + f38c6ee commit 13a44fc

File tree

3 files changed

+2
-30
lines changed

3 files changed

+2
-30
lines changed

causal_testing/testing/causal_test_case.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,6 @@ def __init__(
5757
else:
5858
self.effect_modifier_configuration = {}
5959

60-
def get_treatment_variable(self):
61-
"""Return the treatment variable name (as string) for this causal test case"""
62-
return self.treatment_variable.name
63-
64-
def get_outcome_variable(self):
65-
"""Return the outcome variable name (as string) for this causal test case."""
66-
return self.outcome_variable.name
67-
68-
def get_control_value(self):
69-
"""Return a the control value of the treatment variable in this causal test case."""
70-
return self.control_value
71-
72-
def get_treatment_value(self):
73-
"""Return the treatment value of the treatment variable in this causal test case."""
74-
return self.treatment_value
75-
7660
def execute_test(self, estimator: type(Estimator), data_collector: DataCollector) -> CausalTestResult:
7761
"""Execute a causal test case and return the causal test result.
7862

examples/poisson-line-process/example_poisson_process.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ def causal_test_intensity_num_shapes(
9090
# 8. Set up an estimator
9191
data = pd.read_csv(observational_data_path)
9292

93-
treatment = causal_test_case.get_treatment_variable()
94-
outcome = causal_test_case.get_outcome_variable()
93+
treatment = causal_test_case.treatment_variable.name
94+
outcome = causal_test_case.outcome_variable.name
9595

9696
estimator = None
9797
if empirical:

tests/testing_tests/test_causal_test_case.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,6 @@ def setUp(self) -> None:
3737
treatment_value=1,
3838
)
3939

40-
def test_get_treatment_variable(self):
41-
self.assertEqual(self.causal_test_case.get_treatment_variable(), "A")
42-
43-
def test_get_outcome_variable(self):
44-
self.assertEqual(self.causal_test_case.get_outcome_variable(), "C")
45-
46-
def test_get_treatment_value(self):
47-
self.assertEqual(self.causal_test_case.get_treatment_value(), 1)
48-
49-
def test_get_control_value(self):
50-
self.assertEqual(self.causal_test_case.get_control_value(), 0)
51-
5240
def test_str(self):
5341
self.assertEqual(
5442
str(self.causal_test_case),

0 commit comments

Comments
 (0)