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

Commit

Permalink
Updated the save method to ensure that the init_cond Dataset gets upd…
Browse files Browse the repository at this point in the history
…ated on a save
  • Loading branch information
daminton committed Feb 25, 2024
1 parent ba7edc5 commit 6c796ec
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -2269,8 +2269,6 @@ def add_solar_system_body(self,
if dsnew['id'].max(dim='name') > 0 and dsnew['name'].size > 0:
self.save(verbose=False)

self.init_cond = self.data.copy(deep=True)

return

def set_ephemeris_date(self,
Expand Down Expand Up @@ -2605,7 +2603,6 @@ def input_to_clm_array(val, n):

dsnew = self._combine_and_fix_dsnew(dsnew)
self.save(verbose=False)
self.init_cond = self.data.copy(deep=True)

return

Expand Down Expand Up @@ -3067,6 +3064,7 @@ def save(self,

if not self.simdir.exists():
self.simdir.mkdir(parents=True, exist_ok=True)
self.init_cond = self.data.copy(deep=True)

if codename == "Swiftest":
infile_name = Path(self.simdir) / param['NC_IN']
Expand All @@ -3083,7 +3081,7 @@ def save(self,

return

def initial_conditions_from_bin(self,
def initial_conditions_from_data(self,
framenum: int=-1,
new_param: os.PathLike=None,
new_param_file: os.PathLike="param.new.in",
Expand Down

0 comments on commit 6c796ec

Please sign in to comment.