Right now calling GuppyModule.compile throws an error if the module has already been compiled.
In some cases we may want to use a module multiple times, for example when generating multiple circuits from it.
Currently the work around is to manually keep the HUGR around, but it would be more straightforward if we can keep a reference to compiled hugr in the module.
@guppy(module)
def my_func():
pass
@guppy(module)
def my_other_func():
pass
make_circuit(module, "my_func")
make_circuit(module, "my_other_func") # This cannot access the hugr anymore
Right now calling
GuppyModule.compile
throws an error if the module has already been compiled.In some cases we may want to use a module multiple times, for example when generating multiple circuits from it. Currently the work around is to manually keep the HUGR around, but it would be more straightforward if we can keep a reference to compiled hugr in the module.