33import logging
44import typing as ty
55
6- from nipype .pipeline import Workflow
6+ import nipype .pipeline . engine as pe
77from nipype .pipeline .engine .base import EngineBase
88
99
@@ -26,7 +26,7 @@ def _tag() -> EngineBase:
2626
2727
2828def 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
5151def _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
7676def _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