File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
causal_testing/specification Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 7
7
from abc import abstractmethod
8
8
from typing import Iterable
9
9
from itertools import combinations
10
- import numpy as np
11
- import pandas as pd
12
- import networkx as nx
13
10
import argparse
14
11
import logging
15
12
import json
13
+ import networkx as nx
14
+ import pandas as pd
15
+ import numpy as np
16
16
17
17
from causal_testing .specification .causal_specification import CausalDAG , Node
18
18
from causal_testing .data_collection .data_collector import ExperimentalDataCollector
@@ -270,14 +270,14 @@ def generate_metamorphic_relations(dag: CausalDAG) -> list[MetamorphicRelation]:
270
270
)
271
271
args = parser .parse_args ()
272
272
273
- dag = CausalDAG (args .dag_path )
274
- relations = generate_metamorphic_relations (dag )
273
+ causal_dag = CausalDAG (args .dag_path )
274
+ relations = generate_metamorphic_relations (causal_dag )
275
275
tests = [
276
276
relation .to_json_stub (skip = False )
277
277
for relation in relations
278
- if len (list (dag .graph .predecessors (relation .output_var ))) > 0
278
+ if len (list (causal_dag .graph .predecessors (relation .output_var ))) > 0
279
279
]
280
280
281
281
logger .info (f"Generated { len (tests )} tests. Saving to { args .output_path } ." )
282
- with open (args .output_path , "w" ) as f :
282
+ with open (args .output_path , "w" , encoding = "utf-8" ) as f :
283
283
json .dump ({"tests" : tests }, f , indent = 2 )
You can’t perform that action at this time.
0 commit comments