Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix find_node_by_weight type annotations #1324

Merged
merged 5 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
fixes:
- |
Fixed a bug in the type hints for :meth:`~rustworkx.PyGraph.find_node_by_weight`
and :meth:`~rustworkx.PyDiGraph.find_node_by_weight`.
Refer to `issue 1243 <https://github.com/Qiskit/rustworkx/issues/1322>`__ for
more information.
4 changes: 2 additions & 2 deletions rustworkx/rustworkx.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ class PyGraph(Generic[_S, _T]):
def filter_nodes(self, filter_function: Callable[[_S], bool]) -> NodeIndices: ...
def find_node_by_weight(
self,
obj: Callable[[_S], bool],
obj: _S,
/,
) -> int | None: ...
@staticmethod
Expand Down Expand Up @@ -1378,7 +1378,7 @@ class PyDiGraph(Generic[_S, _T]):
def find_adjacent_node_by_edge(self, node: int, predicate: Callable[[_T], bool], /) -> _S: ...
def find_node_by_weight(
self,
obj: Callable[[_S], bool],
obj: _S,
/,
) -> int | None: ...
def find_predecessors_by_edge(
Expand Down