Skip to content

Commit

Permalink
Avoid settign p0 to None during assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
faridyagubbayli committed Jan 23, 2025
1 parent 36b7e9a commit e7e5e8a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kwave/ksource.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ def p0(self):

@p0.setter
def p0(self, val):
print(val.sum())
# check size and contents
if len(val) == 0 or np.sum(val != 0) == 0:
if len(val) == 0:
# if the initial pressure is empty, remove field
self._p0 = None
else:
Expand Down

0 comments on commit e7e5e8a

Please sign in to comment.