From b4067afbd5f487683d6c0f1e5c8ac835d3373fb6 Mon Sep 17 00:00:00 2001 From: David Grote Date: Tue, 19 May 2020 15:25:51 -0700 Subject: Bug fix in picmi field diagnostics with picmistandard.0.0.8 (#1032) Co-authored-by: Remi Lehe --- Python/pywarpx/picmi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Python/pywarpx/picmi.py') diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index de1bb1363..be583b150 100644 --- a/Python/pywarpx/picmi.py +++ b/Python/pywarpx/picmi.py @@ -655,7 +655,8 @@ class _WarpX_FieldDiagnostic(picmistandard.PICMI_FieldDiagnostic): self.diagnostic.period = self.period self.diagnostic.diag_lo = self.lower_bound self.diagnostic.diag_hi = self.upper_bound - self.diagnostic.coarsening_ratio = (np.array(self.grid.number_of_cells)/np.array(self.number_of_cells)).astype(int) + if self.number_of_cells is not None: + self.diagnostic.coarsening_ratio = (np.array(self.grid.number_of_cells)/np.array(self.number_of_cells)).astype(int) self.diagnostic.fields_to_plot = set() for dataname in self.data_list: -- cgit v1.2.3