InScope

class hugr.passes.scope.InScope(*values)[source]

Bases: Enum

Whether a pass may modify a particular node.

Attributes

YES

The pass may modify the node arbitrarily, including changing its interface, behaviour, and/or removing it altogether

PRESERVE_INTERFACE

The pass may modify the interior of the node - its OpType, and its descendants - but must maintain the same ports (including static and ControlFlow ports), function name and visibility, and execution behaviour.

NO

The pass may not modify this node

NO = 'NO'

The pass may not modify this node

PRESERVE_INTERFACE = 'PRES_INT'

The pass may modify the interior of the node - its OpType, and its descendants - but must maintain the same ports (including static and ControlFlow ports), function name and visibility, and execution behaviour.

For the module root, this is equivalent to NO.

YES = 'YES'

The pass may modify the node arbitrarily, including changing its interface, behaviour, and/or removing it altogether