diff --git a/dace/sdfg/state.py b/dace/sdfg/state.py index 6e9e516fe8..dec1e282d5 100644 --- a/dace/sdfg/state.py +++ b/dace/sdfg/state.py @@ -2077,15 +2077,8 @@ def add_state(self, label=None, is_start_block=False, parent_sdfg=None) -> SDFGS self.add_node(state, is_start_block=is_start_block) return state - # ============================================================================= - # = Graph traversal methods =================================================== - # ============================================================================= - - #def all_nodes_recursive(self) -> Iterator[Tuple[SomeNodeT, SomeGraphT]]: - # for node in self.nodes(): - # yield node, self - # if isinstance(node, (ScopeBlock, SDFGState)): - # yield from node.all_nodes_recursive() + ################################################################### + # Traversal methods def all_cfgs_recursive(self, recurse_into_sdfgs=True) -> Iterator['ControlFlowGraph']: """ Iterate over this and all nested CFGs. """ @@ -2112,6 +2105,9 @@ def all_states_recursive(self) -> Iterator[SDFGState]: elif isinstance(block, ControlFlowGraph): yield from block.all_states_recursive() + ################################################################### + # Getters & setters, overrides + @property def start_block(self): """ Returns the starting block of this ControlFlowGraph. """ @@ -2176,12 +2172,6 @@ def to_json(self, parent=None): graph_json.update(block_json) return graph_json - #def all_nodes_recursive(self): - # for node in self.nodes(): - # yield node, self - # if isinstance(node, (ScopeBlock, BlockGraphView)): - # yield from node.all_nodes_recursive() - def __str__(self): return ControlFlowBlock.__str__(self)