@@ -362,58 +362,6 @@ def tearDown(self) -> None:
362362 shutil .rmtree (self .temp_dir_path )
363363
364364
365- class TestDependsOnOutputs (unittest .TestCase ):
366- """
367- Test the depends_on_outputs method.
368- """
369-
370- def setUp (self ) -> None :
371- from scipy .stats import uniform
372- from causal_testing .specification .variable import Input , Output , Meta
373- from causal_testing .specification .scenario import Scenario
374-
375- self .temp_dir_path = tempfile .mkdtemp ()
376- self .dag_dot_path = os .path .join (self .temp_dir_path , "dag.dot" )
377- dag_dot = """digraph G { A -> B; B -> C; D -> A; D -> C}"""
378- f = open (self .dag_dot_path , "w" )
379- f .write (dag_dot )
380- f .close ()
381-
382- D = Input ("D" , float , uniform (0 , 1 ))
383- A = Meta ("A" , float , uniform (0 , 1 ))
384- B = Output ("B" , float , uniform (0 , 1 ))
385- C = Meta ("C" , float , uniform (0 , 1 ))
386-
387- self .scenario = Scenario ({A , B , C , D })
388-
389- def test_depends_on_outputs_output (self ):
390- causal_dag = CausalDAG (self .dag_dot_path )
391- print ("nodes:" , causal_dag .nodes ())
392- print ("graph:" , causal_dag )
393- self .assertTrue (causal_dag .depends_on_outputs ("B" , self .scenario ))
394-
395- def test_depends_on_outputs_output_meta (self ):
396- causal_dag = CausalDAG (self .dag_dot_path )
397- print ("nodes:" , causal_dag .nodes ())
398- print ("graph:" , causal_dag )
399- self .assertTrue (causal_dag .depends_on_outputs ("C" , self .scenario ))
400-
401- def test_depends_on_outputs_input_meta (self ):
402- causal_dag = CausalDAG (self .dag_dot_path )
403- print ("nodes:" , causal_dag .nodes ())
404- print ("graph:" , causal_dag )
405- self .assertFalse (causal_dag .depends_on_outputs ("A" , self .scenario ))
406-
407- def test_depends_on_outputs_input (self ):
408- causal_dag = CausalDAG (self .dag_dot_path )
409- print ("nodes:" , causal_dag .nodes ())
410- print ("graph:" , causal_dag )
411- self .assertFalse (causal_dag .depends_on_outputs ("D" , self .scenario ))
412-
413- def tearDown (self ) -> None :
414- shutil .rmtree (self .temp_dir_path )
415-
416-
417365class TestUndirectedGraphAlgorithms (unittest .TestCase ):
418366 """
419367 Test the graph algorithms designed for the undirected graph variants of a Causal DAG.
0 commit comments