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

Commit

Permalink
Merge branch '10-fix-problem-causing-gr-test-to-fail' into oblate_coo…
Browse files Browse the repository at this point in the history
…rd_rot
  • Loading branch information
daminton committed Feb 28, 2024
2 parents 6849057 + adfb7c5 commit 3eb912f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,11 @@ def run(self,
return

# Save initial conditions
if not self.restart:
if self.restart:
self.save(framenum=-1)
else:
self.clean()
self.save()
self.save(framenum=0)

# Write out the current parameter set before executing run
self.write_param(verbose=False,**kwargs)
Expand Down Expand Up @@ -2952,7 +2954,7 @@ def read_output_file(self,
param_tmp['BIN_OUT'] = self.simdir / self.param['NC_IN']
self.init_cond = io.swiftest2xr(param_tmp, verbose=False, dask=dask)
else:
self.init_cond = self.data.isel(time=0)
self.init_cond = self.data.isel(time=[0]).copy(deep=True)

if self.read_encounters:
self.read_encounter_file(dask=dask)
Expand Down Expand Up @@ -3124,7 +3126,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)
self.init_cond = self.data.isel(time=[framenum]).copy(deep=True)

if codename == "Swiftest":
infile_name = Path(self.simdir) / param['NC_IN']
Expand Down

0 comments on commit 3eb912f

Please sign in to comment.