Skip to content

Commit 7ad299a

Browse files
committed
Minor corrections
1 parent 1802ab5 commit 7ad299a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

causal_testing/testing/causal_test_outcome.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,20 @@ def apply(self, res: CausalTestResult, atol: float = 1e-10) -> bool:
5959
class ExactValue(SomeEffect):
6060
"""An extension of TestOutcome representing that the expected causal effect should be a specific value."""
6161

62-
def __init__(self, value: float, tolerance: float = None):
62+
def __init__(self, value: float, atol: float = None):
6363
self.value = value
64-
if tolerance is None:
65-
self.tolerance = value * 0.05
64+
if atol is None:
65+
self.atol = value * 0.05
6666
else:
67-
self.tolerance = tolerance
67+
self.atol = atol
6868

6969
def apply(self, res: CausalTestResult) -> bool:
7070
if res.ci_valid():
71-
return super().apply(res) and np.isclose(res.test_value.value, self.value, atol=self.tolerance)
72-
return np.isclose(res.test_value.value, self.value, atol=self.tolerance)
71+
return super().apply(res) and np.isclose(res.test_value.value, self.value, atol=self.atol)
72+
return np.isclose(res.test_value.value, self.value, atol=self.atol)
7373

7474
def __str__(self):
75-
return f"ExactValue: {self.value}±{self.tolerance}"
75+
return f"ExactValue: {self.value}±{self.atol}"
7676

7777

7878
class Positive(SomeEffect):

causal_testing/testing/causal_test_result.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def push(s, inc=" "):
5656
f"Treatment value: {self.estimator.treatment_value}\n"
5757
f"Outcome: {self.estimator.outcome}\n"
5858
f"Adjustment set: {self.adjustment_set}\n"
59-
f"{self.test_value.type}:{result_str}\n"
59+
f"{self.test_value.type}: {result_str}\n"
6060
)
6161
confidence_str = ""
6262
if self.confidence_intervals:

0 commit comments

Comments
 (0)