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

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed typo that gave wrong npl and ntp values
  • Loading branch information
daminton committed Nov 11, 2022
1 parent d166719 commit 4bd9b6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/swiftest/swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -1864,9 +1864,9 @@ def _combine_and_fix_dsnew(self,dsnew):
self.ds = xr.combine_by_coords([self.ds, dsnew])

def get_nvals(ds):
if "Gmass" in dsnew:
if "Gmass" in ds:
ds['ntp'] = ds['id'].where(np.isnan(ds['Gmass'])).count(dim="id")
ds['npl'] = ds['id'].where(np.invert(np.isnan(ds['Gmass']))).count(dim="id") - 1
ds['npl'] = ds['id'].where(~(np.isnan(ds['Gmass']))).count(dim="id") - 1
else:
ds['ntp'] = ds['id'].count(dim="id")
ds['npl'] = xr.full_like(ds['ntp'],0)
Expand Down

0 comments on commit 4bd9b6a

Please sign in to comment.