Skip to content

Commit fb5129c

Browse files
committed
Fixed pylint
1 parent 5e53871 commit fb5129c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

causal_testing/testing/causal_test_case.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""This module contains the CausalTestCase class, a class that holds the information required for a causal test"""
22
import logging
33
from typing import Any
4+
import numpy as np
45

56
from causal_testing.specification.variable import Variable
67
from causal_testing.testing.causal_test_outcome import CausalTestOutcome
@@ -81,21 +82,19 @@ def _return_causal_test_results(self, estimator) -> CausalTestResult:
8182
estimate_effect = getattr(estimator, f"estimate_{self.estimate_type}")
8283
try:
8384
effect, confidence_intervals = estimate_effect(**self.estimate_params)
84-
causal_test_result = CausalTestResult(
85+
return CausalTestResult(
8586
estimator=estimator,
8687
test_value=TestValue(self.estimate_type, effect),
8788
effect_modifier_configuration=self.effect_modifier_configuration,
8889
confidence_intervals=confidence_intervals,
8990
)
9091
except np.linalg.LinAlgError:
91-
causal_test_result = CausalTestResult(
92+
return CausalTestResult(
9293
estimator=estimator,
9394
test_value=TestValue(self.estimate_type, "LinAlgError"),
9495
effect_modifier_configuration=self.effect_modifier_configuration,
9596
confidence_intervals=None,
9697
)
97-
finally:
98-
return causal_test_result
9998

10099
def __str__(self):
101100
treatment_config = {self.treatment_variable.name: self.treatment_value}

0 commit comments

Comments
 (0)