-
Notifications
You must be signed in to change notification settings - Fork 8
feat: PersistentHugr implements HugrView #2202
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/persistenthugr #2202 +/- ##
=======================================================
+ Coverage 82.14% 82.24% +0.09%
=======================================================
Files 234 235 +1
Lines 41393 41984 +591
Branches 37492 38083 +591
=======================================================
+ Hits 34004 34528 +524
- Misses 5422 5479 +57
- Partials 1967 1977 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@@ -93,6 +93,22 @@ impl<N: HugrNode> OutputBoundaryMap<N> { | |||
.into_iter() | |||
} | |||
|
|||
/// The keys of the map. | |||
/// | |||
/// These will be either outgoing or incoming ports, depending on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes me wonder - is this really an OutputBoundaryMap, rather than just a BoundaryMap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was deleted by the SimpleReplacement simplification PR (#2208)
fn from_portgraph(&self, node: portgraph::NodeIndex) -> N { | ||
let node = node.into(); | ||
self.iter() | ||
.find_map(|(&k, &v)| (v == node).then_some(k)) | ||
.expect("Portgraph node not found in map") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we fine with doing a linear search here?
Do you think it's not worth it having a pair of maps instead?
Closes #2095