diff --git a/miv/core/operator/chainable.py b/miv/core/operator/chainable.py index ab71ed3e..e466c544 100644 --- a/miv/core/operator/chainable.py +++ b/miv/core/operator/chainable.py @@ -68,6 +68,7 @@ class BaseChainingMixin: def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) + self.pipeline_called = False self._downstream_list: list[_Chainable] = [] self._upstream_list: list[_Chainable] = [] diff --git a/miv/core/operator/operator.py b/miv/core/operator/operator.py index 00f27c85..32d18598 100644 --- a/miv/core/operator/operator.py +++ b/miv/core/operator/operator.py @@ -167,5 +167,5 @@ def run( self._execute() cache_called = self.cacher.cache_called # TODO - if not skip_plot and not cache_called: + if not skip_plot and not cache_called and not self.pipeline_called: self.plot(show=False, save_path=True, dry_run=dry_run) diff --git a/miv/core/pipeline.py b/miv/core/pipeline.py index 0efe0049..32f23a2d 100644 --- a/miv/core/pipeline.py +++ b/miv/core/pipeline.py @@ -65,7 +65,17 @@ def run( print("Running: ", node) if hasattr(node, "cacher"): node.cacher.cache_policy = "OFF" if no_cache else "AUTO" - node.run(dry_run=dry_run, save_path=working_directory, skip_plot=skip_plot) + + # in case of error, add message + try: + node.pipeline_called = False + node.run( + dry_run=dry_run, save_path=working_directory, skip_plot=skip_plot + ) + node.pipeline_called = True + except Exception as e: + raise Exception(f'Error while running the operator "{node.tag}"') from e + if verbose: print(f"Finished: {time.time() - stime:.03f} sec") if verbose: