From 9184e5e5c5d2ff7c358a1356fe57d9899bae22a7 Mon Sep 17 00:00:00 2001 From: Rupert Nash Date: Wed, 29 Jun 2022 11:07:32 +0100 Subject: [PATCH] gmytool: rationalise the pipeline debugging --- .../HlbGmyTool/Model/OutputGeneration.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/geometry-tool/HlbGmyTool/Model/OutputGeneration.py b/geometry-tool/HlbGmyTool/Model/OutputGeneration.py index 89cc6d272..21d4db2e9 100644 --- a/geometry-tool/HlbGmyTool/Model/OutputGeneration.py +++ b/geometry-tool/HlbGmyTool/Model/OutputGeneration.py @@ -262,7 +262,7 @@ def __init__(self, profile): GeometryGenerator object. """ super().__init__() - + self.DebugPipelineDirectory = None self._profile = profile self.generator = self.genext.PolyDataGenerator() @@ -297,15 +297,12 @@ def _Preprocess(self): shifter.Update() self.ClippedSurface = shifter.GetOutput() - # Uncomment this an insert the output path to debug pipeline construction - # write = StageWriter('path/to/folder').WriteOutput - # i = 0 - # for alg in getpipeline(shifter): - # print(i) - # i += 1 - # print(alg) - # write(alg) - + # If the attribute has been set, write all the stages of the + # pipeline to the folder. + if self.DebugPipelineDirectory is not None: + sw = StageWriter(self.DebugPipelineDirectory) + for alg in getpipeline(shifter): + sw.WriteOutput(alg) @abstractmethod def _RoundUpSites(self, nSites):