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

Update scipy.integrate.simps import #3701

Closed
ehogan opened this issue Jul 1, 2024 · 1 comment · Fixed by #3704
Closed

Update scipy.integrate.simps import #3701

ehogan opened this issue Jul 1, 2024 · 1 comment · Fixed by #3704

Comments

@ehogan
Copy link
Contributor

ehogan commented Jul 1, 2024

Describe the bug
From the ESMValCore v2.11.0rc2 testing, the scipy.integrate.simps import has been updated to scipy.integrate.simpson in SciPy v1.14.0 (which is what the environment created for the ESMValCore v2.11.0rc2 testing picked up), see https://docs.scipy.org/doc/scipy/release/1.14.0-notes.html#expired-deprecations:

(rc1-env) % conda list scipy
# packages in environment at /miniforge3/envs/rc1-env:
#
# Name                    Version                   Build  Channel
scipy                     1.13.0          py311h517d4fd_1    conda-forge
(rc2-env) % conda list scipy
# packages in environment at /miniforge3/envs/rc2-env:
#
# Name                    Version                   Build  Channel
scipy                     1.14.0          py311h517d4fd_0    conda-forge

From recipe_cox18nature.yml

  File "/miniforge3/envs/rc2-env/lib/python3.11/site-packages/esmvaltool/diag_scripts/emergent_constraints/__init__.py", line 1676, in <listcomp>
    cum_dens = [integrate.simps(pdf[:idx], data[:idx]) for idx in idx_range]
                ^^^^^^^^^^^^^^^
AttributeError: module 'scipy.integrate' has no attribute 'simps'. Did you mean: 'simpson'?

The imports should be updated to work in both cases 👍

@ehogan
Copy link
Contributor Author

ehogan commented Jul 1, 2024

A PR is on its way! I tested the changes with the rc1 environment and the rc2 environment, then compared the outputs using compare.py; the runs were identical 👍

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

Successfully merging a pull request may close this issue.

1 participant