Skip to content

Commit b227268

Browse files
authored
Fix bug with --skip-fields in default regression analysis (BLAST-WarpX#6129)
1 parent bcdc0aa commit b227268

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Regression/Checksum/checksum.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,13 @@ def read_output_file(self, do_fields=True, do_particles=True):
140140
# Load time series
141141
ts = OpenPMDTimeSeries(self.output_file)
142142
data = {}
143-
# Compute number of MR levels
144-
# TODO This calculation of nlevels assumes that the last element
145-
# of level_fields is by default on the highest MR level.
146-
level_fields = [field for field in ts.avail_fields if "lvl" in field]
147-
nlevels = 0 if level_fields == [] else int(level_fields[-1][-1])
148143
# Compute checksum for field quantities
149144
if do_fields:
145+
# Compute number of MR levels
146+
# TODO This calculation of nlevels assumes that the last element
147+
# of level_fields is by default on the highest MR level.
148+
level_fields = [field for field in ts.avail_fields if "lvl" in field]
149+
nlevels = 0 if level_fields == [] else int(level_fields[-1][-1])
150150
for lev in range(nlevels + 1):
151151
# Create list of fields specific to level lev
152152
grid_fields = []

0 commit comments

Comments
 (0)