-
Notifications
You must be signed in to change notification settings - Fork 13
refactor: Direct import of model representation to Python #2683
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
99 commits
Select commit
Hold shift + click to select a range
1d768bb
Import model in python.
zrho 2774544
Allow postponed annotations.
cqc-alec dfab7ff
Use default_factory.
cqc-alec f9c742a
Add dummy function body.
cqc-alec d9390c0
Add stub Hugr.from_model() method.
cqc-alec 7f85ea8
Simplify.
cqc-alec e97027a
Refactor.
cqc-alec fb1fd42
Remove unneeded `parent` argument from `import_node_in_module()`.
cqc-alec bf41995
Implement Hugr.from_model().
cqc-alec c301f45
[?] Don't record links if there's nowhere to record them.
cqc-alec d430fef
Set entrypoint.
cqc-alec c3c00e1
Specify parents of Input and Output nodes.
cqc-alec 27e0376
Rename.
cqc-alec ff30f8f
Add links to hugr.
cqc-alec 2a5c350
Remove outdated comment.
cqc-alec ccf18dc
Add Package.from_model() and use it.
cqc-alec 3af0dfb
Format.
cqc-alec 2835d2f
Lint.
cqc-alec 4dd9905
Lint.
cqc-alec a527789
Remove unused import.
cqc-alec 948263c
Uninherit Term and Op from ABC.
cqc-alec 4bbdd74
Add docstring.
cqc-alec 97efde4
Add docstring.
cqc-alec b669703
Break line.
cqc-alec 21d1292
Raise error from caught error.
cqc-alec a2e5e76
Add docstrings.
cqc-alec 1af9e4f
Make methods private.
cqc-alec 8233fbd
Underscore not-yet-used variables.
cqc-alec 74a89f5
[?] Just keep a single collection of links.
cqc-alec 3af90fa
Fix typo.
cqc-alec 5027575
Import Call nodes.
cqc-alec ddb2972
Special-case Qubit type when importing.
cqc-alec a681d30
Refactor.
cqc-alec 829f099
Add docstring.
cqc-alec 51b6f17
Change data structure used for `ModelImport.linked_ports`.
cqc-alec b85b8fc
Add docstrings.
cqc-alec 9ee5c1e
Fix two bugs.
cqc-alec 2f18e06
Refactor.
cqc-alec 073985f
Add docstrings.
cqc-alec ee128f5
Raise NotImplementedError instead of returning nonsense.
cqc-alec b6efee4
Refactor and add TODO comment.
cqc-alec 4ed1b06
Explicitly set num_outs to 1 when adding Call nodes.
cqc-alec c546f53
Import CFGs.
cqc-alec 8ac0605
Expand TODO.
cqc-alec 6f6eb42
Refactor.
cqc-alec 14eb445
Import "core.load_const" nodes.
cqc-alec 33394a2
Import "core.const.adt" values.
cqc-alec 9ea79b4
Treat a general sum of empty rows as a unit sum when hashing.
cqc-alec 49e0c2c
Set the correct number of outputs when adding Custom nodes.
cqc-alec fc4109b
[?] Use TypeBound.Copyable for Opaque ops.
cqc-alec d481193
Import "core.make_adt" nodes.
cqc-alec 90cbe8e
Set number of outputs on Input nodes.
cqc-alec 4a8b9c8
fixup: index fn_nodes by symbol name
cqc-alec 051e4c3
Raise NotImplementedError for LoadFunc.
cqc-alec 403a90e
Import LoadFunc nodes.
cqc-alec 309dc07
Import qubit as TypeArg.
cqc-alec e9e7f71
Import CallIndirect nodes.
cqc-alec a8adbb3
Import MakeTuple and UnpackTuple nodes.
cqc-alec 81cbeb5
Fix logic.
cqc-alec 4893106
Delay adding edges for function calls.
cqc-alec adf846c
Import params of PolyFuncType.
cqc-alec 7f02688
Refactor.
cqc-alec 1d93539
Set correct number of outputs for Call node.
cqc-alec 90f9420
Import DeclareAlias and DefineAlias.
cqc-alec ce6cd48
Add module-level metadata.
cqc-alec 74a3bf9
Ensure integer value is in signed form for conversion to IntVal.
cqc-alec 9eb4218
Import string constants.
cqc-alec f1e00c4
Import TypeTypeArg.
cqc-alec fab9552
Import static array values.
cqc-alec 5eb7c99
Use different link prefixes in different module children.
cqc-alec 9bf1e5b
Refactor.
cqc-alec 1fc34b6
Make "core.make_adt" imports work when only tag is provided.
cqc-alec 73962b6
Refactor.
cqc-alec a2a741f
Add FIXME comments. How to construct PolyFuncType?
cqc-alec c013cae
Import collections.list.List values.
cqc-alec 787f5a7
Import arithmetic.int.types.int values.
cqc-alec d8b574a
Generalize compat.const_json imports.
cqc-alec 1046dfa
Handle compat.const_json uniformly. (No special case for prelude.stri…
cqc-alec d64be1b
Fix: don't treat empty string as None.
cqc-alec 4834f5c
Add FIXME comment.
cqc-alec b88d5a4
Determine TypeBound for collections.list.List.
cqc-alec 7f30f9c
Always give LoadConst node an output port.
cqc-alec 827fea8
Set number of output ports for TailLoop nodes.
cqc-alec a8e8bee
Always give LoadFunc node an output port.
cqc-alec bb63f47
Set number of output ports on CallIndirect nodes.
cqc-alec 1127655
Special-case import of core.adt in compat.const_json terms.
cqc-alec 992960d
Give more context in error message.
cqc-alec eb124b8
Move FIXME.
cqc-alec 846357d
Import packaged extensions.
cqc-alec fac1b60
Lints.
cqc-alec fa42d0f
Revert unnecessary change.
cqc-alec 0095210
Document return value of ModelImport.import_node_in_dfg().
cqc-alec e68aea9
Refactor.
cqc-alec a452556
Import collections.array.const values.
cqc-alec 0383a41
Rename.
cqc-alec f3b2d12
Merge branch 'main' into ae/model.4
cqc-alec 957ce85
Merge branch 'main' into ae/model.4
cqc-alec 3c98848
Make `link_prefix` nullable and unset it at the end of `import_node_i…
cqc-alec aae3ff8
Merge branch 'main' into ae/model.4
cqc-alec 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
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
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
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.
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.
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.
shouldn't this be a breaking change?
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 think this doesn't count as a breaking change since the
hugr._hugrmodule is underscored.