-
Notifications
You must be signed in to change notification settings - Fork 13
feat: add toposort to HUGR-py #2367
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
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
7719f06
add initial implementation
CalMacCQ 75b85b6
add initial (failing) test
CalMacCQ d329829
add docstring
CalMacCQ 465c65f
use a visit dict
CalMacCQ 1b0dd30
use decendants method
CalMacCQ 609dd38
fix: only reduce degree if nodes are connected
CalMacCQ 9967cb1
add a type annotation for mypy
CalMacCQ b8d89fb
use hugr.children() not hugr.decendants()
CalMacCQ 709646e
Merge branch 'main' into cm/hugrpy-toposort
CalMacCQ 655a717
use agustins suggestion with helper methods
CalMacCQ 17eb2f7
improve test
CalMacCQ f5df896
make mypy happy
CalMacCQ f1ba64e
Use suggestion for handling non-local edges
CalMacCQ 71c952d
fix syntax error
CalMacCQ 7cfeb57
error on cycles
CalMacCQ f95b0a1
fix handling of input node
CalMacCQ 7f98f0d
add comments and rename
CalMacCQ 3fca6fc
add a test for cycle detection
CalMacCQ 69e214b
refactor tests with a helper
CalMacCQ 5cb41a1
Use a set to validate toposort
CalMacCQ d6a0074
use pytest fixture
CalMacCQ 5041582
call validate inside helper
CalMacCQ e532c48
fix use of validate
CalMacCQ 79f7b4a
expand docstring
CalMacCQ b686973
Merge branch 'main' into cm/hugrpy-toposort
CalMacCQ 08ba648
add doctest
CalMacCQ bbdfc63
try to fix doctest
CalMacCQ 95bc63b
update test and rename method
CalMacCQ a9c6f25
finally fix test
CalMacCQ e1cdb47
Update hugr-py/src/hugr/hugr/base.py
CalMacCQ File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.