Skip to content

Commit e43bf38

Browse files
All effects now expect pd.Series for the test values
1 parent 3bcefc7 commit e43bf38

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

causal_testing/testing/causal_test_outcome.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,9 @@ def apply(self, res: CausalTestResult) -> bool:
9898
if res.ci_valid() and not super().apply(res):
9999
return False
100100
if res.test_value.type in {"ate", "coefficient"}:
101-
return bool(res.test_value.value > 0)
101+
return bool(res.test_value.value[0] > 0)
102102
if res.test_value.type == "risk_ratio":
103-
return bool(res.test_value.value > 1)
104-
# Dead code but necessary for pylint
103+
return bool(res.test_value.value[0] > 1)
105104
raise ValueError(f"Test Value type {res.test_value.type} is not valid for this TestOutcome")
106105

107106

@@ -112,8 +111,8 @@ def apply(self, res: CausalTestResult) -> bool:
112111
if res.ci_valid() and not super().apply(res):
113112
return False
114113
if res.test_value.type in {"ate", "coefficient"}:
115-
return bool(res.test_value.value < 0)
114+
return bool(res.test_value.value[0] < 0)
116115
if res.test_value.type == "risk_ratio":
117-
return bool(res.test_value.value < 1)
116+
return bool(res.test_value.value[0] < 1)
118117
# Dead code but necessary for pylint
119118
raise ValueError(f"Test Value type {res.test_value.type} is not valid for this TestOutcome")

0 commit comments

Comments
 (0)