diff --git a/python/lsst/pipe/base/pipeline_graph/visualization/_mermaid.py b/python/lsst/pipe/base/pipeline_graph/visualization/_mermaid.py index f42ab482..db44d53e 100644 --- a/python/lsst/pipe/base/pipeline_graph/visualization/_mermaid.py +++ b/python/lsst/pipe/base/pipeline_graph/visualization/_mermaid.py @@ -115,18 +115,19 @@ def show_mermaid( # Render nodes. for node_key, node_data in xgraph.nodes.items(): - if node_key.node_type in (NodeType.TASK, NodeType.TASK_INIT): - # Render a task or task-init node. - _render_task_node(node_key, node_data, options, stream) - elif node_key.node_type == NodeType.DATASET_TYPE: - # Render a dataset-type node with possible overflow handling. - overflow_ref, node_overflow_ids = _render_dataset_type_node( - node_key, node_data, options, stream, overflow_ref - ) - if node_overflow_ids: - overflow_ids.extend(node_overflow_ids) - else: - raise AssertionError(f"Unexpected node type: {node_key.node_type}") + match node_key.node_type: + case NodeType.TASK | NodeType.TASK_INIT: + # Render a task or task-init node. + _render_task_node(node_key, node_data, options, stream) + case NodeType.DATASET_TYPE: + # Render a dataset-type node with possible overflow handling. + overflow_ref, node_overflow_ids = _render_dataset_type_node( + node_key, node_data, options, stream, overflow_ref + ) + if node_overflow_ids: + overflow_ids += node_overflow_ids + case _: + raise AssertionError(f"Unexpected node type: {node_key.node_type}") # Collect edges for printing and track which ones are prerequisite # so we can apply dashed styling after printing them.