ModelExport¶
- class hugr.model.export.ModelExport(hugr: Hugr)[source]¶
Bases:
object
Helper to export a Hugr.
Methods
Export entrypoint metadata if the node is the module entrypoint.
Export the metadata of the node via the JSON compatibility constructor.
Export the node with the given node id.
Export the children of a node as a control flow region.
Export the children of a node as a dataflow region.
Export a module node as a module region.
Export a symbol.
Find and export the constant that a node is connected to, if any.
Find the symbol name of the function that a node is connected to, if any.
Return the name of the link that a given port is connected to.
- export_entrypoint_meta(node: Node) list[Term] [source]¶
Export entrypoint metadata if the node is the module entrypoint.
- export_json_meta(node: Node) list[Term] [source]¶
Export the metadata of the node via the JSON compatibility constructor.
- export_node(node: Node, virtual_input_links: Sequence[str] = []) Node | None [source]¶
Export the node with the given node id.
- export_region_cfg(node: Node) Region [source]¶
Export the children of a node as a control flow region.
- export_region_dfg(node: Node, entrypoint_meta=False) Region [source]¶
Export the children of a node as a dataflow region.
- export_symbol(name: str, visibility: Literal['Public', 'Private'], param_types: Sequence[TypeParam], body: Type) Symbol [source]¶
Export a symbol.
- find_const_input(node: Node) Term | None [source]¶
Find and export the constant that a node is connected to, if any.