Skip to content

Commit 4469024

Browse files
authored
feat: Add re-exports for ComposablePass definitions (#1941)
Adds re-exports for `ComposablePass` and `PassScope` definitions, to help with migrating before we remove them from `hugr`. See #1705.
1 parent 85e112a commit 4469024

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

‎tket-py/tket/passes/composable.py‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""A Protocol for a composable pass."""
2+
3+
from hugr.passes.composable import (
4+
ComposablePass,
5+
ComposedPass,
6+
PassName,
7+
PassResult,
8+
implement_pass_run,
9+
)
10+
11+
__all__ = [
12+
"ComposablePass",
13+
"ComposedPass",
14+
"PassName",
15+
"PassResult",
16+
"implement_pass_run",
17+
]

‎tket-py/tket/passes/scope.py‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"""Scope configuration for a pass.
2+
3+
A `PassScope` defines the parts of a HUGR that a pass should be applied to, and
4+
which parts is it allowed to modify. Each variant defines three properties: `root`,
5+
`preserve_interface` and `recursive`.
6+
7+
From these, `regions` and `in_scope` can be derived.
8+
9+
A pass will always optimize the entrypoint region, unless the entrypoint is the
10+
module root.
11+
"""
12+
13+
from hugr.passes.scope import (
14+
ABCEnumMeta,
15+
GlobalScope,
16+
InScope,
17+
LocalScope,
18+
PassScope,
19+
PassScopeBase,
20+
)
21+
22+
__all__ = [
23+
"ABCEnumMeta",
24+
"GlobalScope",
25+
"InScope",
26+
"LocalScope",
27+
"PassScope",
28+
"PassScopeBase",
29+
]

0 commit comments

Comments
 (0)