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: Link and neighbour iterators counting self-loops twice #132

Merged
merged 3 commits into from
Jun 3, 2024

Conversation

aborgna-q
Copy link
Collaborator

The all_links iterator for both Portgraph and Multiportgraph, and all_neighbours for the latter yielded self-loops twice.

This in turn caused insert_graph to try inserting repeated links, as reported in #130.

This PR fixes the error and adds tests for that.

Fixes #130.

drive-by: Add missing checks in the pre-commit hook.

@aborgna-q aborgna-q requested a review from zrho May 31, 2024 13:54
@aborgna-q aborgna-q force-pushed the ab/insert-graph-self-loops branch from b0e5c67 to f96c5b5 Compare May 31, 2024 13:54
Copy link

codecov bot commented May 31, 2024

Codecov Report

Attention: Patch coverage is 94.63415% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 80.17%. Comparing base (99a2bfc) to head (f96c5b5).

Files Patch % Lines
src/portgraph.rs 88.23% 3 Missing and 3 partials ⚠️
src/multiportgraph.rs 94.50% 0 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #132      +/-   ##
==========================================
+ Coverage   79.38%   80.17%   +0.79%     
==========================================
  Files          21       21              
  Lines        5016     5176     +160     
  Branches     5016     5176     +160     
==========================================
+ Hits         3982     4150     +168     
+ Misses        962      949      -13     
- Partials       72       77       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aborgna-q aborgna-q added this pull request to the merge queue Jun 3, 2024
Merged via the queue into main with commit 9f61318 Jun 3, 2024
11 checks passed
@aborgna-q aborgna-q deleted the ab/insert-graph-self-loops branch June 3, 2024 11:20
@hugrbot hugrbot mentioned this pull request May 31, 2024
github-merge-queue bot pushed a commit that referenced this pull request Jun 3, 2024
## 🤖 New release
* `portgraph`: 0.12.0 -> 0.12.1

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

## [0.12.1](v0.12.0...v0.12.1)
- 2024-06-03

### Bug Fixes
- Link and neighbour iterators counting self-loops twice
([#132](#132))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

Co-authored-by: hugrbot <[email protected]>
github-merge-queue bot pushed a commit to CQCL/hugr that referenced this pull request Jun 3, 2024
Updates `portgraph` to include the fix in
CQCL/portgraph#132.
Uncomments the previously-failing mentioned in #1143.

Fixes #1143.
@hugrbot hugrbot mentioned this pull request Jun 3, 2024
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.

insert_graph fails with self-edges
2 participants