ExecutablePackage#

class hugr.package.ExecutablePackage(package: Package, module_index: int, node: Node)[source]#

Bases: FuncDefnPointer

PackagePointer with a defined entrypoint node.

Parameters:
  • package – Package pointed to.

  • module_index – Index of the module in the package.

  • node – Node containing the entry point function definition.

Methods

to_executable_package

Create an executable package from a module containing a main function.

Attributes

entry_point_node

Get the entry point node of the package.

func_defn

Function definition.

module

Hugr definition of the module.

node_op

Get the operation of the node.

node

Node pointed to.

module_index

Index of the module in the package.

package

Package pointed to.

property entry_point_node: Node#

Get the entry point node of the package.

property func_defn: FuncDefn#

Function definition.

property module: Hugr#

Hugr definition of the module.

module_index: int#

Index of the module in the package.

node: Node#

Node pointed to.

property node_op: OpType#

Get the operation of the node.

package: Package#

Package pointed to.

to_executable_package() ExecutablePackage#

Create an executable package from a module containing a main function.

Raises:

ValueError – If the module does not contain a main function.