Skip to content

Commit 1e3312a

Browse files
committed
suppress plotting for single pipeline call
1 parent 4ff6c42 commit 1e3312a

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

miv/core/operator/chainable.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ class BaseChainingMixin:
6868

6969
def __init__(self, *args, **kwargs):
7070
super().__init__(*args, **kwargs)
71+
self.pipeline_called = False
7172
self._downstream_list: list[_Chainable] = []
7273
self._upstream_list: list[_Chainable] = []
7374

miv/core/operator/operator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,5 +167,5 @@ def run(
167167
self._execute()
168168
cache_called = self.cacher.cache_called
169169
# TODO
170-
if not skip_plot and not cache_called:
170+
if not skip_plot and not cache_called and not self.pipeline_called:
171171
self.plot(show=False, save_path=True, dry_run=dry_run)

miv/core/pipeline.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,17 @@ def run(
6565
print("Running: ", node)
6666
if hasattr(node, "cacher"):
6767
node.cacher.cache_policy = "OFF" if no_cache else "AUTO"
68-
node.run(dry_run=dry_run, save_path=working_directory, skip_plot=skip_plot)
68+
69+
# in case of error, add message
70+
try:
71+
node.pipeline_called = False
72+
node.run(
73+
dry_run=dry_run, save_path=working_directory, skip_plot=skip_plot
74+
)
75+
node.pipeline_called = True
76+
except Exception as e:
77+
raise Exception(f'Error while running the operator "{node.tag}"') from e
78+
6979
if verbose:
7080
print(f"Finished: {time.time() - stime:.03f} sec")
7181
if verbose:

0 commit comments

Comments
 (0)