Skip to content

Commit ae695d5

Browse files
authored
Enhance docs for adj/pred/succ methods in PyDiGraph and add find_successor_node_by_edge method (#1401)
* Add examples to adj/successor/predecessor methods of digraph * Add find_successor_node_by_edge method
1 parent 5befc61 commit ae695d5

File tree

4 files changed

+272
-35
lines changed

4 files changed

+272
-35
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
features:
3+
- |
4+
Added new function: :func:`~find_successor_node_by_edge`
5+
to the ``rustworkx.PyDiGraph`` class.
6+
This function finds an arbitrary successor node that is connected
7+
by an edge that matches given condition.

rustworkx/rustworkx.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,6 +1424,7 @@ class PyDiGraph(Generic[_S, _T]):
14241424
def find_successors_by_edge(
14251425
self, node: int, filter_fn: Callable[[_T], bool], /
14261426
) -> list[_S]: ...
1427+
def find_successor_node_by_edge(self, node: int, predicate: Callable[[_T], bool], /) -> _S: ...
14271428
@staticmethod
14281429
def from_adjacency_matrix(
14291430
matrix: npt.NDArray[np.float64], /, null_value: float = ...

0 commit comments

Comments
 (0)