Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 27, 2024
1 parent 6c4806b commit 06fe76f
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions pywhy_graphs/algorithms/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"dag_to_mag",
"is_maximal",
"all_vstructures",
"possibly_directed_path"
"possibly_directed_path",
]


Expand Down Expand Up @@ -857,18 +857,18 @@ def all_vstructures(G: nx.DiGraph, as_edges: bool = False):
vstructs.add((p1, node, p2)) # type: ignore
return vstructs

def get_X_neighbors(G, X : set):

def get_X_neighbors(G, X: set):

final_neighbors = set()

for elem in X:
elem_possible_neighbors = set(G.neighbors(elem))
to_remove = X.intersection(elem_possible_neighbors)
elem_neighbors = elem_possible_neighbors - to_remove
final_neighbors.update(elem_neighbors)

return final_neighbors
elem_possible_neighbors = set(G.neighbors(elem))
to_remove = X.intersection(elem_possible_neighbors)
elem_neighbors = elem_possible_neighbors - to_remove
final_neighbors.update(elem_neighbors)

return final_neighbors


def possibly_directed_path(G, X: Optional[Set] = None, Y: Optional[Set] = None):
Expand All @@ -878,7 +878,6 @@ def possibly_directed_path(G, X: Optional[Set] = None, Y: Optional[Set] = None):
else:
x_neighbors = G.neighbors(X)


# path_list = recursively_find_pd_paths(G, x_neigbors, Y)

return
return

0 comments on commit 06fe76f

Please sign in to comment.