From 47e3c88905c4fb3812850e097dd5a3c28b8ea953 Mon Sep 17 00:00:00 2001 From: MintoDA1 <51412913+MintoDA1@users.noreply.github.com> Date: Tue, 3 Oct 2023 10:12:32 -0500 Subject: [PATCH] Fixed bug that was preventing initial conditions file from being saved when new bodys are added in multiple add_solar_system_body calls --- swiftest/simulation_class.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/swiftest/simulation_class.py b/swiftest/simulation_class.py index 0f8bea50c..eee68f963 100644 --- a/swiftest/simulation_class.py +++ b/swiftest/simulation_class.py @@ -2177,10 +2177,8 @@ def add_solar_system_body(self, dsnew = init_cond.vec2xr(self.param,**kwargs) dsnew = self._combine_and_fix_dsnew(dsnew) - if dsnew['npl'] > 0 or dsnew['ntp'] > 0: + if dsnew['id'].max(dim='name') > 0 and dsnew['name'].size > 0: self.save(verbose=False) - - self.init_cond = self.data.copy(deep=True)