Skip to content

Commit 336f998

Browse files
committed
STY: Use pe.Workflow
1 parent 9f777df commit 336f998

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

niworkflows/engine/splicer.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import logging
44
import typing as ty
55

6-
from nipype.pipeline import Workflow
6+
import nipype.pipeline.engine as pe
77
from nipype.pipeline.engine.base import EngineBase
88

99

@@ -26,7 +26,7 @@ def _tag() -> EngineBase:
2626

2727

2828
def splice_workflow(
29-
root_wf: Workflow,
29+
root_wf: pe.Workflow,
3030
replacements: dict[str, EngineBase],
3131
*,
3232
write_graph: bool = False,
@@ -49,7 +49,7 @@ def splice_workflow(
4949

5050

5151
def _get_substitutions(
52-
workflow: Workflow,
52+
workflow: pe.Workflow,
5353
replacements: dict[str, EngineBase],
5454
) -> dict[EngineBase, EngineBase]:
5555
""" "Query tags in workflow, and return a list of substitutions to make"""
@@ -61,20 +61,20 @@ def _get_substitutions(
6161
return substitutions
6262

6363

64-
def _fetch_tags(wf: Workflow) -> dict[str, EngineBase]:
64+
def _fetch_tags(wf: pe.Workflow) -> dict[str, EngineBase]:
6565
"""Query all nodes in a workflow and return a dictionary of tags and nodes."""
6666
tagged = {}
6767
for node in wf._graph.nodes:
6868
if hasattr(node, '_tag'):
6969
tagged[node._tag] = node
70-
if isinstance(node, Workflow):
70+
if isinstance(node, pe.Workflow):
7171
inner_tags = _fetch_tags(node)
7272
tagged.update(inner_tags)
7373
return tagged
7474

7575

7676
def _splice_components(
77-
workflow: Workflow,
77+
workflow: pe.Workflow,
7878
substitutions: dict[EngineBase, EngineBase],
7979
debug: bool = False,
8080
) -> tuple[list, list]:
@@ -106,10 +106,10 @@ def _splice_components(
106106
node_removals.add(src)
107107
node_adds.add(alt_src)
108108
edge_connects.append((alt_src, dst, edge_data))
109-
elif isinstance(dst, Workflow) and dst not in _expanded_workflows:
109+
elif isinstance(dst, pe.Workflow) and dst not in _expanded_workflows:
110110
_expanded_workflows.add(dst)
111111
_splice_components(dst, substitutions, debug=debug)
112-
elif isinstance(src, Workflow) and src not in _expanded_workflows:
112+
elif isinstance(src, pe.Workflow) and src not in _expanded_workflows:
113113
_expanded_workflows.add(src)
114114
_splice_components(src, substitutions, debug=debug)
115115

0 commit comments

Comments
 (0)