ComposedPass

class hugr.passes.composable.ComposedPass(*passes: ComposablePass)[source]

Bases: ComposablePass

A sequence of composable passes.

Methods

run

Run the pass to transform a HUGR, returning a PassResult.

then

Perform another composable pass after this pass.

with_scope

Set the scope configuration for the composed pass.

Attributes

name

Returns the name of the pass.

passes

property name: str

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

Perform another composable pass after this pass.

with_scope(scope: PassScope) ComposedPass[source]

Set the scope configuration for the composed pass.