Skip to content

Commit b23a6bd

Browse files
committed
Fixed typing
Signed-off-by: Aryan Roy <[email protected]>
1 parent cb8d57a commit b23a6bd

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

pywhy_graphs/algorithms/generic.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import List, Union
1+
from typing import List, Set, Union
22

33
import networkx as nx
44

@@ -343,7 +343,7 @@ def _directed_sub_graph_ancestors(G, node: Node):
343343
----------
344344
G : Graph
345345
The graph.
346-
node : node label
346+
node : Node
347347
The node for which we have to find the ancestors.
348348
349349
Returns
@@ -362,7 +362,7 @@ def _directed_sub_graph_parents(G, node: Node):
362362
----------
363363
G : Graph
364364
The graph.
365-
node : node label
365+
node : Node
366366
The node for which we have to find the parents.
367367
368368
Returns
@@ -381,7 +381,7 @@ def _bidirected_sub_graph_neighbors(G, node: Node):
381381
----------
382382
G : Graph
383383
The graph.
384-
node : node label
384+
node : Node
385385
The node for which we have to find the neighbors.
386386
387387
Returns
@@ -408,7 +408,7 @@ def _is_collider(G, prev_node: Node, cur_node: Node, next_node: Node):
408408
The previous node in the path.
409409
cur_node : node
410410
The node to be checked.
411-
next_node:
411+
next_node: Node
412412
The next node in the path.
413413
414414
Returns
@@ -429,10 +429,10 @@ def _shortest_valid_path(
429429
G,
430430
node_x: Node,
431431
node_y: Node,
432-
L: set,
433-
S: set,
434-
visited: set,
435-
all_ancestors: set,
432+
L: Set,
433+
S: Set,
434+
visited: Set,
435+
all_ancestors: Set,
436436
cur_node: Node,
437437
prev_node: Node,
438438
):
@@ -448,13 +448,13 @@ def _shortest_valid_path(
448448
The source node.
449449
node_y : node
450450
The destination node
451-
L : set
451+
L : Set
452452
Set containing all the non-colliders.
453-
S : set
453+
S : Set
454454
Set containing all the colliders.
455-
visited : set
455+
visited : Set
456456
Set containing all the nodes already visited.
457-
all_ancestors : set
457+
all_ancestors : Set
458458
Set containing all the ancestors a collider needs to be checked against.
459459
cur_node : node
460460
The current node.
@@ -515,7 +515,7 @@ def _shortest_valid_path(
515515
return (path_exists, path)
516516

517517

518-
def inducing_path(G, node_x: Node, node_y: Node, L: set = None, S: set = None):
518+
def inducing_path(G, node_x: Node, node_y: Node, L: Set = None, S: Set = None):
519519
"""Checks if an inducing path exists between two nodes as defined in :footcite:`Zhang2008`.
520520
521521
Parameters
@@ -526,9 +526,9 @@ def inducing_path(G, node_x: Node, node_y: Node, L: set = None, S: set = None):
526526
The source node.
527527
node_y : node
528528
The destination node.
529-
L : set
529+
L : Set
530530
Nodes that are ignored on the path. Defaults to an empty set. See Notes for details.
531-
S: set
531+
S: Set
532532
Nodes that are always conditioned on. Defaults to an empty set. See Notes for details.
533533
534534
Returns

0 commit comments

Comments
 (0)