Skip to content

Commit fcd934f

Browse files
pylint + black
1 parent fbd4842 commit fcd934f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

causal_testing/json_front/json_class.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ def _populate_metas(self):
146146
def _execute_test_case(self, causal_test_case: CausalTestCase, test: Iterable[Mapping], f_flag: bool) -> bool:
147147
"""Executes a singular test case, prints the results and returns the test case result
148148
:param causal_test_case: The concrete test case to be executed
149+
:param test: Single JSON test definition stored in a mapping (dict)
149150
:param f_flag: Failure flag that if True the script will stop executing when a test fails.
150151
:return: A boolean that if True indicates the causal test case passed and if false indicates the test case
151152
failed.
@@ -178,9 +179,10 @@ def _execute_test_case(self, causal_test_case: CausalTestCase, test: Iterable[Ma
178179
logger.warning(" FAILED- expected %s, got %s", causal_test_case.expected_causal_effect, result_string)
179180
return failed
180181

181-
def _setup_test(self, causal_test_case: CausalTestCase, test) -> tuple[CausalTestEngine, Estimator]:
182+
def _setup_test(self, causal_test_case: CausalTestCase, test: Mapping) -> tuple[CausalTestEngine, Estimator]:
182183
"""Create the necessary inputs for a single test case
183184
:param causal_test_case: The concrete test case to be executed
185+
:param test: Single JSON test definition stored in a mapping (dict)
184186
:returns:
185187
- causal_test_engine - Test Engine instance for the test being run
186188
- estimation_model - Estimator instance for the test being run
@@ -201,7 +203,7 @@ def _setup_test(self, causal_test_case: CausalTestCase, test) -> tuple[CausalTes
201203
outcome=causal_test_case.outcome_variable.name,
202204
df=causal_test_engine.scenario_execution_data_df,
203205
effect_modifiers=causal_test_case.effect_modifier_configuration,
204-
formula=test["formula"]
206+
formula=test["formula"],
205207
)
206208
else:
207209
estimation_model = test["estimator"](

causal_testing/testing/estimators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def _run_logistic_regression(self, data) -> RegressionResultsWrapper:
158158
model = smf.logit(formula=self.formula, data=data).fit(disp=0)
159159
return model
160160

161-
def estimate(self, data: pd.DataFrame, adjustment_config:dict = None) -> RegressionResultsWrapper:
161+
def estimate(self, data: pd.DataFrame, adjustment_config: dict = None) -> RegressionResultsWrapper:
162162
"""add terms to the dataframe and estimate the outcome from the data
163163
:param data: A pandas dataframe containing execution data from the system-under-test.
164164
:param adjustment_config: Dictionary containing the adjustment configuration of the adjustment set

0 commit comments

Comments
 (0)