Skip to content

Add type annotation docs for PyGraph - #1685

Open
Krishnendu Rajesh (krishnendurajesh) wants to merge 4 commits into
Qiskit:mainfrom
krishnendurajesh:main
Open

Krishnendu Rajesh (krishnendurajesh) wants to merge 4 commits into
Qiskit:mainfrom
krishnendurajesh:main

Conversation

@krishnendurajesh

Copy link
Copy Markdown

Fixes #1558

Adds "Type Annotations" section to "PyGraph" docstring such that it explains:
1.order of parameters ;PyGraph[NodeData, EdgeData]
2.Requirement of adding | None for edge type annotation while using add_edges_from_no_data method

@CLAassistant

CLAassistant commented Sep 25, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 36174931069

Coverage remained the same at 94.692%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 20308
Covered Lines: 19230
Line Coverage: 94.69%
Coverage Strength: 951496.91 hits per line

💛 - Coveralls

@johnthagen

Copy link
Copy Markdown
Contributor

I'd also suggest at least a small example be added to the Usage section of the README to make it more discoverable for new users

Added section on type annotations for PyGraph parameters and usage examples.
@krishnendurajesh

Copy link
Copy Markdown
Author

Done! Added an example to the Usage section in the README. Hope it works

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven’t had much time to review PRs for rustworkx for the last couple weeks but I left some comments. Thanks for starting the contribution.

Comment thread README.md
Comment thread src/graph.rs
Removed outdated examples and added note on type annotations.
Added type annotation examples for PyDiGraph parameters.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document how to use basic type annotations with PyGraph

5 participants