Skip to content

Commit 0380154

Browse files
codacy
1 parent 246acd4 commit 0380154

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

causal_testing/json_front/json_class.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def execute_tests(self, effects: dict, mutates: dict, estimators: dict, f_flag:
127127
if failed:
128128
failures += 1
129129

130-
logger.info(f"{failures}/{executed_tests} failed")
130+
logger.info("{%d}/{%d} failed", failures, executed_tests)
131131

132132
def _json_parse(self):
133133
"""Parse a JSON input file into inputs, outputs, metas and a test plan
@@ -180,7 +180,7 @@ def _execute_test_case(self, causal_test_case: CausalTestCase, estimator: Estima
180180
if not test_passes:
181181
failed = True
182182
logger.warning(
183-
f" FAILED - expected {causal_test_case.expected_causal_effect}, got {causal_test_result.ate}")
183+
" FAILED- expected %s, got %s", causal_test_case.expected_causal_effect, causal_test_result.ate)
184184
return failed
185185

186186
def _setup_test(self, causal_test_case: CausalTestCase, estimator: Estimator) -> tuple[CausalTestEngine, Estimator]:

examples/poisson/run_causal_tests.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,6 @@ def populate_num_shapes_unit(data):
9393
area = data['width'] * data['height']
9494
data['num_shapes_unit'] = data['num_shapes_abs'] / area
9595

96-
97-
def logger_setup():
98-
logger = logging.getLogger(__name__)
99-
fh = logging.FileHandler()
100-
logger.addHandler(fh)
101-
102-
10396
inputs = [
10497
{"name": "width", "type": float, "distribution": "uniform"},
10598
{"name": "height", "type": float, "distribution": "uniform"},

0 commit comments

Comments
 (0)