Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of deprecated interp2d in spectral_model.py #22

Closed
shimwell opened this issue Mar 8, 2024 · 1 comment · Fixed by #31
Closed

Use of deprecated interp2d in spectral_model.py #22

shimwell opened this issue Mar 8, 2024 · 1 comment · Fixed by #31

Comments

@shimwell
Copy link
Collaborator

shimwell commented Mar 8, 2024

I'm getting a warning with newer versions of scipy due to the use of interp2d, perhaps this is something to fix as interp2d will be removed in scipy 1.12.0 (released in January).

/home/j/miniforge/envs/openmc-dev/lib/python3.10/site-packages/NeSST/spectral_model.py:280: DeprecationWarning: `interp2d` is deprecated!
  `interp2d` is deprecated in SciPy 1.10 and will be removed in SciPy 1.12.0.
  
  For legacy code, nearly bug-for-bug compatible replacements are
  `RectBivariateSpline` on regular grids, and `bisplrep`/`bisplev` for
  scattered 2D data.
  
  In new code, for regular grids use `RegularGridInterpolator` instead.
  For scattered data, prefer `LinearNDInterpolator` or
  `CloughTocher2DInterpolator`.
  
  For more details see
  `https://gist.github.com/ev-br/8544371b40f414b7eaf3fe6217209bff`

link to scipy docs.

https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp2d.html

@aidancrilly
Copy link
Owner

aidancrilly commented Mar 10, 2024

So I have attempted an update for this in the interp2d_replacement branch.

I also tried to replace interp1d as they are warning that it is considered legacy, but it has an axis functionality which isn't in the new scipy.interpolate functions as far as I can tell.

Will do some proper testing to check it hasn't changed anything, the example notebook looks pretty much unchanged but I'll be more thorough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants