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

add module root node in Hugr::new #2

Merged
merged 4 commits into from
Apr 13, 2023
Merged

add module root node in Hugr::new #2

merged 4 commits into from
Apr 13, 2023

Conversation

ss2165
Copy link
Member

@ss2165 ss2165 commented Apr 5, 2023

HUGR should have one root node always - might as well create this with new

@ss2165 ss2165 requested a review from aborgna-q April 5, 2023 13:02
@ss2165 ss2165 force-pushed the feature/new-module branch from 69e90d7 to 7ced3f2 Compare April 5, 2023 13:04
@acl-cqc
Copy link
Contributor

acl-cqc commented Apr 11, 2023

I was thinking the same idea, so this looks good to me. Not sure why CI is failing - IIUC the same "errors" show up as warnings when I build branch main.

@aborgna-q
Copy link
Collaborator

aborgna-q commented Apr 11, 2023

The CI is pretty pedantic rn.
The links from the warning are broken because the types have not been imported in the module. They need an explicit link as in

//! system (outside the `types` module), which also parses nested [`OpDef`]s.
//!
//! [`OpDef`]: crate::ops::custom::OpDef

Edit: The error was already happening in main, but Github Actions was down when that change was pushed. I put a fix for the CI error in #3.

@aborgna-q
Copy link
Collaborator

aborgna-q commented Apr 11, 2023

I made roots optional to allow for partial hugrs meant for rewriting. I'm not yet up to date with the current definition for that.

@aborgna-q aborgna-q mentioned this pull request Apr 11, 2023
@acl-cqc
Copy link
Contributor

acl-cqc commented Apr 11, 2023

I made roots optional to allow for partial hugrs meant for rewriting. I'm not yet up to date with the current definition for that.

Replacements are a forest of nodes. Whilst they could all be stored in a single HUGR I'm not sure how much sense that makes, they could just be a list (there is a ParentsMap as well, right).

src/hugr.rs Outdated Show resolved Hide resolved
src/builder/base.rs Outdated Show resolved Hide resolved
@aborgna-q aborgna-q added the enhancement New feature or request label Apr 11, 2023
@ss2165 ss2165 force-pushed the feature/new-module branch from 7ced3f2 to 53b1a23 Compare April 11, 2023 15:43
@aborgna-q
Copy link
Collaborator

Wait for #4 before merging this.

@ss2165 ss2165 force-pushed the feature/new-module branch from e9eeafb to 0508cc0 Compare April 13, 2023 09:45
@ss2165 ss2165 merged commit 9e5926d into main Apr 13, 2023
@ss2165 ss2165 deleted the feature/new-module branch April 13, 2023 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants