From cdf3aec1702b7a4fd873f0626a5bfc47677843c2 Mon Sep 17 00:00:00 2001 From: Carlos Cueto Date: Wed, 8 May 2024 18:00:58 +0100 Subject: [PATCH] Make dumping of problem components conditional --- stride/problem/problem.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/stride/problem/problem.py b/stride/problem/problem.py index e1bb0094..398a07bd 100644 --- a/stride/problem/problem.py +++ b/stride/problem/problem.py @@ -161,10 +161,14 @@ def dump(self, *args, **kwargs): kwargs['project_name'] = kwargs.get('project_name', self.name) kwargs['path'] = kwargs.get('path', self.output_folder) - self.medium.dump(*args, **kwargs) - self.transducers.dump(*args, **kwargs) - self.geometry.dump(*args, **kwargs) - self.acquisitions.dump(*args, **kwargs) + if kwargs.pop('dump_medium', True): + self.medium.dump(*args, **kwargs) + if kwargs.pop('dump_transducers', True): + self.transducers.dump(*args, **kwargs) + if kwargs.pop('dump_geometry', True): + self.geometry.dump(*args, **kwargs) + if kwargs.pop('dump_acquisitions', True): + self.acquisitions.dump(*args, **kwargs) def plot(self, **kwargs): """