Skip to content

Commit c6e4794

Browse files
Remove TODOs + black
1 parent 095da5d commit c6e4794

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed

causal_testing/json_front/json_class.py

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,7 @@ def set_paths(self, json_path: str, dag_path: str, data_path: str):
5959
:param dag_path: string path representation to the .dot file containing the Causal DAG
6060
:param data_path: string path representation to the data file
6161
"""
62-
self.paths = JsonClassPaths(
63-
json_path=json_path,
64-
dag_path=dag_path,
65-
data_path=data_path
66-
)
62+
self.paths = JsonClassPaths(json_path=json_path, dag_path=dag_path, data_path=data_path)
6763

6864
def set_variables(self, inputs: list[dict], outputs: list[dict], metas: list[dict]):
6965
"""Populate the Causal Variables
@@ -72,11 +68,8 @@ def set_variables(self, inputs: list[dict], outputs: list[dict], metas: list[dic
7268
:param metas:
7369
"""
7470

75-
self.variables = CausalVariables(
76-
inputs=inputs,
77-
outputs=outputs,
78-
metas=metas
79-
)
71+
self.variables = CausalVariables(inputs=inputs, outputs=outputs, metas=metas)
72+
8073
def setup(self):
8174
"""Function to populate all the necessary parts of the json_class needed to execute tests"""
8275
self.modelling_scenario = Scenario(self.variables.inputs + self.variables.outputs + self.variables.metas, None)
@@ -286,12 +279,7 @@ class JsonClassPaths:
286279
dag_path: Path
287280
data_path: Path
288281

289-
def __init__(
290-
self,
291-
json_path: str,
292-
dag_path: str,
293-
data_path: str
294-
):
282+
def __init__(self, json_path: str, dag_path: str, data_path: str):
295283
self.json_path = Path(json_path)
296284
self.dag_path = Path(dag_path)
297285
self.data_path = Path(data_path)
@@ -307,12 +295,7 @@ class CausalVariables:
307295
outputs: list[Output]
308296
metas: list[Meta]
309297

310-
def __init__(
311-
self,
312-
inputs: list[dict],
313-
outputs: list[dict],
314-
metas: list[dict]
315-
):
298+
def __init__(self, inputs: list[dict], outputs: list[dict], metas: list[dict]):
316299
self.inputs = [Input(i["name"], i["type"], i["distribution"]) for i in inputs]
317300
self.outputs = [Output(i["name"], i["type"], i.get("distribution", None)) for i in outputs]
318301
self.metas = [Meta(i["name"], i["type"], i["populate"]) for i in metas] if metas else []

causal_testing/testing/estimators.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,6 @@ def estimate_ate(self) -> float:
569569
reduced_df = reduced_df[~missing_rows]
570570

571571
# Split data into effect modifiers (X), confounders (W), treatments (T), and outcome (Y)
572-
# TODO: Is it right to ignore the adjustment set if we have effect modifiers?
573572
if self.effect_modifiers:
574573
effect_modifier_df = reduced_df[list(self.effect_modifiers)]
575574
else:

0 commit comments

Comments
 (0)