Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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(hugr-py): CFG builder #1192
feat(hugr-py): CFG builder #1192
Changes from 2 commits
2a6fb56
8611316
b7e9dc5
2a7e7e6
c8c3bcf
58a03b3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 16 in hugr-py/src/hugr/_cfg.py
Codecov / codecov/patch
hugr-py/src/hugr/_cfg.py#L16
Check warning on line 12 in hugr-py/src/hugr/_dfg.py
Codecov / codecov/patch
hugr-py/src/hugr/_dfg.py#L12
Check warning on line 46 in hugr-py/src/hugr/_dfg.py
Codecov / codecov/patch
hugr-py/src/hugr/_dfg.py#L46
Check warning on line 89 in hugr-py/src/hugr/_dfg.py
Codecov / codecov/patch
hugr-py/src/hugr/_dfg.py#L87-L89
Check warning on line 31 in hugr-py/src/hugr/_hugr.py
Codecov / codecov/patch
hugr-py/src/hugr/_hugr.py#L30-L31
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.
Fixed in #1194
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.
It might be nicer to add an optional
hugr
argument toCfg.__init__
? If supplied, the CFG is inserted into the given Hugr, otherwise a new one is created.Alternatively, it could be a classmethod
Cfg.new_nested(hugr, input_types, output_types)
or something similar?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.
I like the class method idea, I'll try it out on #1194
Check warning on line 156 in hugr-py/src/hugr/_ops.py
Codecov / codecov/patch
hugr-py/src/hugr/_ops.py#L156
Check warning on line 174 in hugr-py/src/hugr/_ops.py
Codecov / codecov/patch
hugr-py/src/hugr/_ops.py#L174