Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Fixed issues getting dump_cadence set properly on the Python side
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Dec 1, 2022
1 parent 1e75a0e commit 5b1355f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions python/swiftest/swiftest/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"SEED",
"INTERACTION_LOOPS",
"ENCOUNTER_CHECK",
"TSTART")
"TSTART",
"DUMP_CADENCE")

# This list defines features that are booleans, so must be converted to/from string when writing/reading from file
bool_param = ["RESTART",
Expand All @@ -46,7 +47,7 @@
"YARKOVSKY",
"YORP"]

int_param = ["ISTEP_OUT", "ISTEP_DUMP"]
int_param = ["ISTEP_OUT", "DUMP_CADENCE"]
float_param = ["T0", "TSTART", "TSTOP", "DT", "CHK_RMIN", "CHK_RMAX", "CHK_EJECT", "CHK_QMIN", "DU2M", "MU2KG",
"TU2S", "MIN_GMFRAG", "GMTINY"]

Expand Down Expand Up @@ -409,7 +410,7 @@ def write_labeled_param(param, param_file_name):
'TSTOP',
'DT',
'ISTEP_OUT',
'ISTEP_DUMP',
'DUMP_CADENCE',
'NC_IN',
'PL_IN',
'TP_IN',
Expand Down
4 changes: 2 additions & 2 deletions python/swiftest/swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,10 +628,10 @@ def set_simulation_time(self,

if dump_cadence is None:
dump_cadence = self.param.pop("DUMP_CADENCE", 1)
self.param['DUMP_CADENCE'] = dump_cadence
else:
update_list.append("dump_cadence")

self.param['DUMP_CADENCE'] = dump_cadence

time_dict = self.get_simulation_time(update_list, verbose=verbose)

return time_dict
Expand Down

0 comments on commit 5b1355f

Please sign in to comment.