Skip to content

Commit

Permalink
Added adc check to each MAG
Browse files Browse the repository at this point in the history
Signed-off-by: Aryan Roy <[email protected]>
  • Loading branch information
aryan26roy committed Sep 23, 2023
1 parent 822e355 commit 4657c72
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pywhy_graphs/algorithms/tests/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,9 @@ def test_dag_to_mag():
S = {"S"}
L = {"H"}

out_edges = pywhy_graphs.dag_to_mag(admg, L, S).edges()

out_mag = pywhy_graphs.dag_to_mag(admg, L, S)
assert not pywhy_graphs.has_adc(out_mag)
out_edges = out_mag.edges()
dir_edges = list(out_edges["directed"])
assert (
("A", "R") in out_edges["directed"]
Expand All @@ -385,7 +386,9 @@ def test_dag_to_mag():
S = {"S"}
L = {"H"}

out_edges = pywhy_graphs.dag_to_mag(admg, L, S).edges()
out_mag = pywhy_graphs.dag_to_mag(admg, L, S)
assert not pywhy_graphs.has_adc(out_mag)
out_edges = out_mag.edges()

dir_edges = list(out_edges["directed"])
assert ("A", "E") in out_edges["directed"] and len(out_edges["directed"]) == 1
Expand All @@ -407,7 +410,9 @@ def test_dag_to_mag():
S = set()
L = {"J"}

out_edges = pywhy_graphs.dag_to_mag(admg, L, S).edges()
out_mag = pywhy_graphs.dag_to_mag(admg, L, S)
assert not pywhy_graphs.has_adc(out_mag)
out_edges = out_mag.edges()
dir_edges = list(out_edges["directed"])
assert (
("G", "S") in dir_edges
Expand Down

0 comments on commit 4657c72

Please sign in to comment.