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

feat: Add crate::algorithm::iter #830

Closed
wants to merge 7 commits into from
Closed

Conversation

doug-q
Copy link
Collaborator

@doug-q doug-q commented Feb 5, 2024

No description provided.

@doug-q doug-q mentioned this pull request Feb 5, 2024
@doug-q doug-q force-pushed the feat/add-algorithm-iter branch from 4ad2cb6 to fb26620 Compare February 5, 2024 13:38
@doug-q doug-q requested review from acl-cqc and ss2165 February 5, 2024 13:38
@doug-q doug-q force-pushed the feat/add-algorithm-iter branch from 8073d03 to e454dab Compare February 7, 2024 09:04
Copy link

codecov bot commented Feb 7, 2024

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (3314404) 84.12% compared to head (4772158) 84.18%.
Report is 1 commits behind head on main.

Files Patch % Lines
src/algorithm/iter.rs 91.42% 3 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #830      +/-   ##
==========================================
+ Coverage   84.12%   84.18%   +0.05%     
==========================================
  Files          73       74       +1     
  Lines       13920    13996      +76     
  Branches    13920    13996      +76     
==========================================
+ Hits        11710    11782      +72     
+ Misses       1422     1418       -4     
- Partials      788      796       +8     

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

@doug-q doug-q removed request for ss2165 and acl-cqc February 8, 2024 10:56
Copy link
Member

@ss2165 ss2165 left a comment

Choose a reason for hiding this comment

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

  1. Really like the petgraph use
  2. A test of controlflow would be good since that has an alternative logic path
  3. Should these functions be impls on SiblingGraph or HugrView?

@@ -0,0 +1,244 @@
//! Routines for iterating over all nodes in a Hugr, attending to visiting
Copy link
Member

Choose a reason for hiding this comment

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

"attending to visiting"? worth rewording

Comment on lines +223 to +224
h.hugr_mut()
.move_before_sibling(dfg.handle().node(), noop.handle().node())?;
Copy link
Member

Choose a reason for hiding this comment

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

is this testing that hierarchy sibiling order doesn't matter? worth a comment

src/algorithm/iter.rs Outdated Show resolved Hide resolved
src/algorithm/iter.rs Outdated Show resolved Hide resolved
src/algorithm/iter.rs Outdated Show resolved Hide resolved
src/algorithm/iter.rs Outdated Show resolved Hide resolved
src/algorithm/iter.rs Outdated Show resolved Hide resolved
@doug-q
Copy link
Collaborator Author

doug-q commented Feb 12, 2024

3. Should these functions be impls on SiblingGraph or HugrView?

I think it is reasonable to consider adding children, children_postorder, recursive_children, recursive_children_postorder to HugrView, and children, children_postorder to SiblingGraph.

It is unclear whether those functions should take a node, or perhaps multiple variants should be added, with and without the node.

The name children already clashes with a method on HugrView, and it is far from clear that the naming scheme is the right one.

My view is that we should not add them at this time, until we are more certain. I will add comments to this effect, lmk if you disagree.

doug-q and others added 5 commits February 12, 2024 09:19
Co-authored-by: Seyon Sivarajah <[email protected]>
Co-authored-by: Seyon Sivarajah <[email protected]>
Co-authored-by: Seyon Sivarajah <[email protected]>
Co-authored-by: Seyon Sivarajah <[email protected]>
Co-authored-by: Seyon Sivarajah <[email protected]>
@ss2165 ss2165 closed this Jun 5, 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.

2 participants