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

interp2d` is deprecated in SciPy 1.10 and will be removed in SciPy 1.12.0. #98

Open
scottstanie opened this issue Feb 25, 2023 · 2 comments

Comments

@scottstanie
Copy link
Contributor

Low priority, but let's change the iono.py interpolation code so we get rid of the DeprecationWarning

$ pytest

tests/test_ionex.py::test_get_ionex_value
  /Users/staniewi/repos/COMPASS/src/compass/utils/iono.py:156: 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`

    tec_val = interpolate.interp2d(
@vbrancat
Copy link
Contributor

vbrancat commented Aug 2, 2023

@scottstanie Has this been addressed? I believe we have taken care of this as I do not see this message when processing.

@scottstanie
Copy link
Contributor Author

Nope I think the code will still start erroring with scipy 1.13. Try running pytest tests/test_ionex.py.

https://scipy.github.io/devdocs/notebooks/interp_transition_guide.html

$ pytest  tests/test_ionex.py
================================================================================================ test session starts =================================================================================================
platform darwin -- Python 3.10.9, pytest-7.1.2, pluggy-1.0.0
Using --randomly-seed=350643922
rootdir: /Users/staniewi/repos/COMPASS
plugins: anyio-3.6.1, randomly-3.10.1, xdist-3.1.0, dash-2.7.0, hypothesis-6.56.4, cov-3.0.0
collected 2 items

tests/test_ionex.py ..                                                                                                                                                                                         [100%]

================================================================================================== warnings summary ==================================================================================================
../../miniconda3/envs/mapping/lib/python3.10/site-packages/matplotlib/__init__.py:152
../../miniconda3/envs/mapping/lib/python3.10/site-packages/matplotlib/__init__.py:152
../../miniconda3/envs/mapping/lib/python3.10/site-packages/matplotlib/__init__.py:152
../../miniconda3/envs/mapping/lib/python3.10/site-packages/matplotlib/__init__.py:152
../../miniconda3/envs/mapping/lib/python3.10/site-packages/matplotlib/__init__.py:152
  /Users/staniewi/miniconda3/envs/mapping/lib/python3.10/site-packages/matplotlib/__init__.py:152: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    if LooseVersion(module.__version__) < minver:

../../miniconda3/envs/mapping/lib/python3.10/site-packages/setuptools/_distutils/version.py:346
../../miniconda3/envs/mapping/lib/python3.10/site-packages/setuptools/_distutils/version.py:346
../../miniconda3/envs/mapping/lib/python3.10/site-packages/setuptools/_distutils/version.py:346
../../miniconda3/envs/mapping/lib/python3.10/site-packages/setuptools/_distutils/version.py:346
../../miniconda3/envs/mapping/lib/python3.10/site-packages/setuptools/_distutils/version.py:346
  /Users/staniewi/miniconda3/envs/mapping/lib/python3.10/site-packages/setuptools/_distutils/version.py:346: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    other = LooseVersion(other)

tests/test_ionex.py::test_get_ionex_value
  /Users/staniewi/repos/COMPASS/src/compass/utils/iono.py:157: 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`

    tec_val = interpolate.interp2d(

tests/test_ionex.py::test_get_ionex_value
  /Users/staniewi/repos/COMPASS/src/compass/utils/iono.py:157: 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`

    tec_val = interpolate.interp2d(

tests/test_ionex.py: 13 warnings
  /Users/staniewi/repos/COMPASS/src/compass/utils/iono.py:181: 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`

    interpolate.interp2d(

tests/test_ionex.py::test_get_ionex_value
  /Users/staniewi/repos/COMPASS/src/compass/utils/iono.py:123: 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`

    tec_val0 = interpfs[ind0](lon0, lat)

tests/test_ionex.py::test_get_ionex_value
  /Users/staniewi/repos/COMPASS/src/compass/utils/iono.py:124: 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`

    tec_val1 = interpfs[ind1](lon1, lat)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

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

No branches or pull requests

2 participants