ComposablePass¶
- class hugr.passes.composable.ComposablePass(*args, **kwargs)[source]¶
Bases:
ProtocolA Protocol which represents a composable Hugr transformation.
Methods
Run the pass to transform a HUGR, returning a PassResult.
Perform another composable pass after this pass.
Set the scope configuration for the pass.
Attributes
Returns the name of the pass.
- run(hugr: Hugr, *, inplace: bool = True) PassResult[source]¶
Run the pass to transform a HUGR, returning a PassResult.
See
implement_pass_run()for a helper function to implement this method.
- then(other: ComposablePass) ComposablePass[source]¶
Perform another composable pass after this pass.
- with_scope(scope: PassScope) ComposablePass[source]¶
Set the scope configuration for the pass.
As of hugr 0.14.*, this configuration is only guidance, and may be ignored by the pass.
In the future, passes will be required to respect the scope configuration.