@@ -119,7 +119,7 @@ def add_node_array(self, node_array: NodeArray, raise_on_fail: bool = True) -> N
119119 def delete_node_array (self , node_array : NodeArray , raise_on_fail : bool = True ) -> None :
120120 """Delete all nodes in node_array from the graph"""
121121 for node in node_array :
122- self .delete_node (node . id .item (), raise_on_fail = raise_on_fail )
122+ self .delete_node (node [ "id" ] .item (), raise_on_fail = raise_on_fail )
123123
124124 def has_branch (self , from_ext_node_id : int , to_ext_node_id : int ) -> bool :
125125 """Check if a branch exists between two nodes."""
@@ -180,7 +180,7 @@ def delete_branch_array(self, branch_array: BranchArray, raise_on_fail: bool = T
180180 """Delete all branches in branch_array from the graph."""
181181 for branch in branch_array :
182182 if self ._branch_is_relevant (branch ):
183- self .delete_branch (branch . from_node .item (), branch . to_node .item (), raise_on_fail = raise_on_fail )
183+ self .delete_branch (branch [ " from_node" ] .item (), branch [ " to_node" ] .item (), raise_on_fail = raise_on_fail )
184184
185185 def delete_branch3_array (self , branch3_array : Branch3Array , raise_on_fail : bool = True ) -> None :
186186 """Delete all branch3s in the branch3 array from the graph."""
@@ -399,7 +399,7 @@ def _delete_branch(self, from_node_id, to_node_id) -> None:
399399 """
400400
401401 @abstractmethod
402- def _get_shortest_path (self , source , target ): ...
402+ def _get_shortest_path (self , source , target ) -> tuple [ list [ int ], int ] : ...
403403
404404 @abstractmethod
405405 def _get_all_paths (self , source , target ) -> list [list [int ]]: ...
0 commit comments