Skip to content

Commit abb7e95

Browse files
refactor execute_test_suite return value
1 parent c834ba5 commit abb7e95

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

causal_testing/testing/causal_test_engine.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ def execute_test_suite(
5959
"""Execute a suite of causal tests and return the results in a list"""
6060
if self.scenario_execution_data_df.empty:
6161
raise Exception("No data has been loaded. Please call load_data prior to executing a causal test case.")
62-
causal_test_results = []
62+
test_suite_results = {}
6363
for edge in test_suite:
64-
64+
print("edge: ")
65+
print(edge)
6566
logger.info("treatment: %s", edge.treatment_variable)
6667
logger.info("outcome: %s", edge.outcome_variable)
6768
minimal_adjustment_set = self.causal_dag.identification(edge)
@@ -78,10 +79,13 @@ def execute_test_suite(
7879
estimators = test_suite[edge]["estimators"]
7980
tests = test_suite[edge]["tests"]
8081
estimate_type = test_suite[edge]["estimate_type"]
81-
82+
results = []
8283
for EstimatorClass in estimators:
83-
84+
print("tests: ")
85+
print(tests)
86+
causal_test_results = []
8487
for test in tests:
88+
8589
treatment_variable = list(test.treatment_input_configuration.keys())[0]
8690
treatment_value = list(test.treatment_input_configuration.values())[0]
8791
control_value = list(test.control_input_configuration.values())[0]
@@ -91,7 +95,10 @@ def execute_test_suite(
9195
estimator.df = self.scenario_execution_data_df
9296
causal_test_result = self._return_causal_test_results(estimate_type, estimator, test)
9397
causal_test_results.append(causal_test_result)
94-
return causal_test_results
98+
results.append(causal_test_results)
99+
test_suite_results[edge] = results
100+
breakpoint()
101+
return test_suite_results
95102

96103
def execute_test(
97104
self, estimator: type(Estimator), causal_test_case: CausalTestCase, estimate_type: str = "ate"

0 commit comments

Comments
 (0)