mrJean1 / PyGeodesy

Pure Python geodesy tools
https://mrjean1.github.io/PyGeodesy/
297 stars 58 forks source link

scipy has deprecated interp2d #78

Closed j-carson closed 1 year ago

j-carson commented 1 year ago

Class GeoidPGM uses scipy interp2d function, which has been deprecated

Use of function https://github.com/mrJean1/PyGeodesy/blob/840f4ed496452e15e8eb2fe02f4a8d044f880c37/pygeodesy/geoids.py#L208C19-L208C19

scipy deprecation transition guide http://scipy.github.io/devdocs/notebooks/interp_transition_guide.html

mrJean1 commented 1 year ago

RectBivariateSpline, one of the recommended replacements for interp2d is already supported in class GeoidGPM, see keyword argument kind.

Should support for interp2d be removed altogether or replaced with an other recommendation?

j-carson commented 1 year ago

Honestly I am new to this package, so I was looking at all the kinds and discovered this one was based on deprecated functionality. It seems that the interp2d option should at least be deprecated in PyGeodesy? What happens when the function is removed from scipy is up to you as the maintainer, I think.

mrJean1 commented 1 year ago

Thank you for reporting. Here the proposed resolution for the classes GeoidPGM and GeoidG2012B, forthcoming in PyGeodesy 23.10.06.

PyGeodesy continues to support scipy.interpolate.interp2d but issues a DeprecationWarning when used with scipy 1.10 or later. Once interp2d is missing in scipy.interpolate, PyGeodesy throws an error.

An enhancement may be, replace scipy.interpolate.interp2d support in PyGeodesy with something equivalent like -.RegularGridInterpolator.

Lastly, see env variable PYGEODESY_WARNINGS and function DeprecationWarnings for more details.

j-carson commented 1 year ago

Thank you! That sounds like a very reasonable resolution to me.

mrJean1 commented 1 year ago

Great. Thank you again. Closing the issue.