From 456052c041dc18d0cce0cbef6c296cd7c47563f6 Mon Sep 17 00:00:00 2001 From: Florian Rupprecht Date: Wed, 6 Dec 2023 16:46:30 -0500 Subject: [PATCH 1/3] Option-forked nodeblock missing resource name reporting --- CPAC/pipeline/cpac_pipeline.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/CPAC/pipeline/cpac_pipeline.py b/CPAC/pipeline/cpac_pipeline.py index 9cfbf87145..74ca2965a2 100644 --- a/CPAC/pipeline/cpac_pipeline.py +++ b/CPAC/pipeline/cpac_pipeline.py @@ -1130,10 +1130,20 @@ def connect_pipeline(wf, cfg, rpool, pipeline_blocks): f"after node block '{previous_nb.get_name()}':" ) if previous_nb else 'at beginning:' # Alert user to block that raises error - e.args = ( - 'When trying to connect node block ' - f"'{NodeBlock(block).get_name()}' " - f"to workflow '{wf}' {previous_nb_str} {e.args[0]}",) + if isinstance(block, list): + node_block_names = str([NodeBlock(b).get_name() for b in block]) + e.args = ( + f'When trying to {e.args} connect one of the node blocks ' + f"'{node_block_names}' " + f"to workflow '{wf}' {previous_nb_str} {e.args[0]}", + ) + else: + node_block_names = NodeBlock(block).get_name() + e.args = ( + f'When trying to {e.args} connect node block ' + f"'{node_block_names}' " + f"to workflow '{wf}' {previous_nb_str} {e.args[0]}", + ) if cfg.pipeline_setup['Debugging']['verbose']: verbose_logger = getLogger('engine') verbose_logger.debug(e.args[0]) From 002525d932fe775cabdd5fd79ceabe3f62c8c741 Mon Sep 17 00:00:00 2001 From: Florian Rupprecht Date: Wed, 6 Dec 2023 16:49:31 -0500 Subject: [PATCH 2/3] Remove debug test output --- CPAC/pipeline/cpac_pipeline.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CPAC/pipeline/cpac_pipeline.py b/CPAC/pipeline/cpac_pipeline.py index 74ca2965a2..8204520d51 100644 --- a/CPAC/pipeline/cpac_pipeline.py +++ b/CPAC/pipeline/cpac_pipeline.py @@ -1133,14 +1133,14 @@ def connect_pipeline(wf, cfg, rpool, pipeline_blocks): if isinstance(block, list): node_block_names = str([NodeBlock(b).get_name() for b in block]) e.args = ( - f'When trying to {e.args} connect one of the node blocks ' + f'When trying to connect one of the node blocks ' f"'{node_block_names}' " f"to workflow '{wf}' {previous_nb_str} {e.args[0]}", ) else: node_block_names = NodeBlock(block).get_name() e.args = ( - f'When trying to {e.args} connect node block ' + f'When trying to connect node block ' f"'{node_block_names}' " f"to workflow '{wf}' {previous_nb_str} {e.args[0]}", ) From c364dce5460fd6f1bf534f00c00154acf181b957 Mon Sep 17 00:00:00 2001 From: Florian Rupprecht Date: Wed, 6 Dec 2023 17:14:55 -0500 Subject: [PATCH 3/3] Avoid double quotes --- CPAC/pipeline/cpac_pipeline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CPAC/pipeline/cpac_pipeline.py b/CPAC/pipeline/cpac_pipeline.py index 8204520d51..4e4e7f9a71 100644 --- a/CPAC/pipeline/cpac_pipeline.py +++ b/CPAC/pipeline/cpac_pipeline.py @@ -1134,7 +1134,7 @@ def connect_pipeline(wf, cfg, rpool, pipeline_blocks): node_block_names = str([NodeBlock(b).get_name() for b in block]) e.args = ( f'When trying to connect one of the node blocks ' - f"'{node_block_names}' " + f"{node_block_names} " f"to workflow '{wf}' {previous_nb_str} {e.args[0]}", ) else: