@@ -59,11 +59,7 @@ def set_paths(self, json_path: str, dag_path: str, data_path: str):
59
59
:param dag_path: string path representation to the .dot file containing the Causal DAG
60
60
:param data_path: string path representation to the data file
61
61
"""
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 )
67
63
68
64
def set_variables (self , inputs : list [dict ], outputs : list [dict ], metas : list [dict ]):
69
65
"""Populate the Causal Variables
@@ -72,11 +68,8 @@ def set_variables(self, inputs: list[dict], outputs: list[dict], metas: list[dic
72
68
:param metas:
73
69
"""
74
70
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
+
80
73
def setup (self ):
81
74
"""Function to populate all the necessary parts of the json_class needed to execute tests"""
82
75
self .modelling_scenario = Scenario (self .variables .inputs + self .variables .outputs + self .variables .metas , None )
@@ -286,12 +279,7 @@ class JsonClassPaths:
286
279
dag_path : Path
287
280
data_path : Path
288
281
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 ):
295
283
self .json_path = Path (json_path )
296
284
self .dag_path = Path (dag_path )
297
285
self .data_path = Path (data_path )
@@ -307,12 +295,7 @@ class CausalVariables:
307
295
outputs : list [Output ]
308
296
metas : list [Meta ]
309
297
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 ]):
316
299
self .inputs = [Input (i ["name" ], i ["type" ], i ["distribution" ]) for i in inputs ]
317
300
self .outputs = [Output (i ["name" ], i ["type" ], i .get ("distribution" , None )) for i in outputs ]
318
301
self .metas = [Meta (i ["name" ], i ["type" ], i ["populate" ]) for i in metas ] if metas else []
0 commit comments