Consolidate Python docstrings in graph.rs#1395
Merged
IvanIsCoding merged 2 commits intoQiskit:mainfrom Mar 13, 2025
Merged
Conversation
Pull Request Test Coverage Report for Build 13842244785Details
💛 - Coveralls |
Collaborator
|
Firstly, thanks for your second contribution! This is higly appreciated. I think for Moreover, when we initially wrote our documentation Sphinx did not support type annotations. I need to get up to date on sphinx-doc/sphinx#7630 and Sphinx support. When writing the docs, take a look at https://github.com/Qiskit/rustworkx/blob/main/rustworkx/rustworkx.pyi. The docstrings should agree with the |
Contributor
Author
|
Thanks, @IvanIsCoding , I hope I could update everything from your review. |
IvanIsCoding
approved these changes
Mar 13, 2025
Collaborator
IvanIsCoding
left a comment
There was a problem hiding this comment.
Fantastic! Thank you.
SILIZ4
pushed a commit
to SILIZ4/rustworkx
that referenced
this pull request
Jul 4, 2025
* Consolidate Python docstrings in graph.rs * Updates from the first review
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As a beginner in rustworkx, when I followed the API docs, sometimes I was not quite sure whether the argument or the return value was the int node indices or the attached objects.
Unfortunately it looks like it is not possible to add Python type hints to the PyO3 signatures. Therefore I reviewed the src/graph.rs and added them wherever possible in the docstrings. I also tried to consolidate the description of the same parameters across the functions.
If this is a good way to go, I'll be happy to tackle the rest of the docstrings in the near future.