From 835f3cee646f6e7b9f679b66ea3463023225860c Mon Sep 17 00:00:00 2001 From: "Kevin Z. Zhu" <86268612+KZhu-ME@users.noreply.github.com> Date: Thu, 5 Aug 2021 17:23:24 -0700 Subject: Fixed bug where specifying write_dir for particle diagnostic did not work (#2167) --- Python/pywarpx/picmi.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Python/pywarpx/picmi.py') diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index f4d7a34ed..f9495d2b5 100644 --- a/Python/pywarpx/picmi.py +++ b/Python/pywarpx/picmi.py @@ -1034,6 +1034,11 @@ class ParticleDiagnostic(picmistandard.PICMI_ParticleDiagnostic): self.diagnostic.openpmd_backend = self.openpmd_backend self.diagnostic.intervals = self.period + if self.write_dir is not None or self.file_prefix is not None: + write_dir = (self.write_dir or 'diags') + file_prefix = (self.file_prefix or self.name) + self.diagnostic.file_prefix = write_dir + '/' + file_prefix + # --- Use a set to ensure that fields don't get repeated. variables = set() -- cgit v1.2.3