Skip to content

Commit

Permalink
Removed np.roots usage
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSkyentist committed Feb 21, 2024
1 parent d07617c commit 22562ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions grizli/grismconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1741,7 +1741,7 @@ def _eval_model(self, model, x0, y0, t, get_coeffs=False):
_c.append(m(x0, y0))

if get_coeffs:
value = _c[::-1]
value = _c
else:
value = np.polynomial.Polynomial(_c)(t)

Expand All @@ -1752,8 +1752,8 @@ def _root_inverse_model(self, model, x0, y0, dx, **kwargs):
"""Inverse values interpolated from the forward model using polynomial roots"""
coeffs = self._eval_model(model, x0, y0, 0, get_coeffs=True)
if hasattr(coeffs, '__len__'):
coeffs[-1] -= dx
value = np.roots(coeffs)[-1]
coeffs[0] -= dx
value = np.polynomial.Polynomial(coeffs).roots()[-1]
else:
value = coeffs

Expand Down

0 comments on commit 22562ea

Please sign in to comment.