Skip to content

Commit

Permalink
clip rescale factor to avoid overflow warning (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkeegan authored Aug 25, 2021
1 parent 00443f5 commit df22b9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sme_contrib/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def _get_dcdt(self, result):
def _rescale(self, result):
c = self._get_conc(result)
dcdt = self._get_dcdt(result)
scale_factor = 1.0 / np.amax(c)
scale_factor = 1.0 / np.clip(np.amax(c), 1e-100, 1e100)
return scale_factor * c, scale_factor * dcdt

def _obj_func(self, params, verbose=False):
Expand Down

0 comments on commit df22b9c

Please sign in to comment.