Skip to content

Commit 29043b5

Browse files
committed
Tests should pass
1 parent 7ad299a commit 29043b5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

examples/poisson/example_run_causal_tests.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def estimate_ate(self) -> (float, [float, float], float):
6565
class PoissonWidthHeight(CausalTestOutcome):
6666
"""An extension of TestOutcome representing that the expected causal effect should be positive."""
6767

68-
def __init__(self, tolerance=0.5):
69-
self.tolerance = tolerance
68+
def __init__(self, atol=0.5):
69+
self.atol = atol
7070
self.i2c = None
7171

7272
def apply(self, res: CausalTestResult) -> bool:
@@ -79,12 +79,12 @@ def apply(self, res: CausalTestResult) -> bool:
7979
self.i2c = i * 2 * c
8080
logger.info("2ic: 2 * %s * %s = %s", i, c, self.i2c)
8181
logger.info("ate: %s", res.test_value.value)
82-
return np.isclose(res.test_value.value, self.i2c, atol=self.tolerance)
82+
return np.isclose(res.test_value.value, self.i2c, atol=self.atol)
8383

8484
def __str__(self):
8585
if self.i2c is None:
86-
return f"PoissonWidthHeight±{self.tolerance}"
87-
return f"PoissonWidthHeight:{self.i2c}±{self.tolerance}"
86+
return f"PoissonWidthHeight±{self.atol}"
87+
return f"PoissonWidthHeight:{self.i2c}±{self.atol}"
8888

8989

9090
def populate_width_height(data):
@@ -121,7 +121,7 @@ def populate_num_shapes_unit(data):
121121
"PoissonWidthHeight": PoissonWidthHeight(),
122122
"Positive": Positive(),
123123
"Negative": Negative(),
124-
"ExactValue4_05": ExactValue(4, tolerance=0.5),
124+
"ExactValue4_05": ExactValue(4, atol=0.5),
125125
"NoEffect": NoEffect(),
126126
}
127127

0 commit comments

Comments
 (0)