@@ -60,7 +60,7 @@ def execute_test_suite(self, test_suite: CausalTestSuite) -> list[CausalTestResu
60
60
causal_test_result objects
61
61
"""
62
62
if self .scenario_execution_data_df .empty :
63
- raise Exception ("No data has been loaded. Please call load_data prior to executing a causal test case." )
63
+ raise ValueError ("No data has been loaded. Please call load_data prior to executing a causal test case." )
64
64
test_suite_results = {}
65
65
for edge in test_suite :
66
66
print ("edge: " )
@@ -75,7 +75,7 @@ def execute_test_suite(self, test_suite: CausalTestSuite) -> list[CausalTestResu
75
75
list (minimal_adjustment_set ) + [edge .treatment_variable .name ] + [edge .outcome_variable .name ]
76
76
)
77
77
if self ._check_positivity_violation (variables_for_positivity ):
78
- raise Exception ("POSITIVITY VIOLATION -- Cannot proceed." )
78
+ raise ValueError ("POSITIVITY VIOLATION -- Cannot proceed." )
79
79
80
80
estimators = test_suite [edge ]["estimators" ]
81
81
tests = test_suite [edge ]["tests" ]
@@ -122,7 +122,7 @@ def execute_test(
122
122
:return causal_test_result: A CausalTestResult for the executed causal test case.
123
123
"""
124
124
if self .scenario_execution_data_df .empty :
125
- raise Exception ("No data has been loaded. Please call load_data prior to executing a causal test case." )
125
+ raise ValueError ("No data has been loaded. Please call load_data prior to executing a causal test case." )
126
126
if estimator .df is None :
127
127
estimator .df = self .scenario_execution_data_df
128
128
treatment_variable = causal_test_case .treatment_variable
@@ -138,7 +138,7 @@ def execute_test(
138
138
variables_for_positivity = list (minimal_adjustment_set ) + [treatment_variable .name ] + [outcome_variable .name ]
139
139
140
140
if self ._check_positivity_violation (variables_for_positivity ):
141
- raise Exception ("POSITIVITY VIOLATION -- Cannot proceed." )
141
+ raise ValueError ("POSITIVITY VIOLATION -- Cannot proceed." )
142
142
143
143
causal_test_result = self ._return_causal_test_results (estimate_type , estimator , causal_test_case )
144
144
return causal_test_result
0 commit comments