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

Added clear, clear_edges functions to PyGraph and PyDiGraph objects #993

Merged
merged 14 commits into from
Oct 6, 2023

Conversation

abhamra
Copy link
Contributor

@abhamra abhamra commented Oct 4, 2023

Can now use clear() and clear_edges() on any PyGraph or PyDiGraph object, fixes #984.
clear(): Clears all nodes and edges, updates node_removed value to true
clear_edges(): Clears all edges, leaves nodes intact.

@abhamra abhamra marked this pull request as draft October 4, 2023 19:45
@abhamra abhamra marked this pull request as ready for review October 4, 2023 19:46
Copy link
Collaborator

@IvanIsCoding IvanIsCoding left a comment

Choose a reason for hiding this comment

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

Overall this LGTM, I think we just need to add another test and it should be good to go

@abhamra
Copy link
Contributor Author

abhamra commented Oct 5, 2023

@IvanIsCoding Just put in a commit that adds graph reuse cases for both clear() and clear_edges(), let me know if anything else needs fixing and thank you for the feedback!

@mtreinish
Copy link
Member

The CI failures you hit before were caused by the new release of rust that happened today: https://blog.rust-lang.org/2023/10/05/Rust-1.73.0.html

I pushed up a separate PR to fix these build errors: #996

@abhamra
Copy link
Contributor Author

abhamra commented Oct 5, 2023

Copy that @mtreinish, I pushed those fixes on my end since the issue you reference seems to have been merged.

@IvanIsCoding IvanIsCoding added the automerge Queue a approved PR for merging label Oct 6, 2023
@coveralls
Copy link

Pull Request Test Coverage Report for Build 6426717105

  • 14 of 14 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.003%) to 96.497%

Totals Coverage Status
Change from base Build 6425158600: 0.003%
Covered Lines: 15428
Relevant Lines: 15988

💛 - Coveralls

@mergify mergify bot merged commit c5b41fc into Qiskit:main Oct 6, 2023
27 checks passed
@abhamra
Copy link
Contributor Author

abhamra commented Oct 6, 2023

@mtreinish @IvanIsCoding Thank you for the help with my first PR!

@IvanIsCoding
Copy link
Collaborator

Congrats on your first contribution to rustworkx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Queue a approved PR for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add graph methods to to clear nodes or edges
4 participants