- SSPTools version:
- Python version:
- Operating System:
Description
Noticed that the code has a lot of divide by zero problems in the computation of the escape routine. I identified 2 ways of avoiding this:
- When Ndot = 0, the escape routine should just not be called
- An additional safety check needs to be included when comparing mto to the bin edges (L244)
What I Did
suggestion:
- Change L149:
derivs_esc = self._derivs_esc(t, y)
to
derivs_esc = self._derivs_esc(t, y) if self.Ndot<0 else np.zeros_like(derivs_sev)
- Change L244:
if (mto > mes[isev]):
to
if (mto > mes[isev]+SMALLNUMBER):
Description
Noticed that the code has a lot of divide by zero problems in the computation of the escape routine. I identified 2 ways of avoiding this:
What I Did
suggestion:
derivs_esc = self._derivs_esc(t, y)
to
derivs_esc = self._derivs_esc(t, y) if self.Ndot<0 else np.zeros_like(derivs_sev)
if (mto > mes[isev]):
to
if (mto > mes[isev]+SMALLNUMBER):