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

[Fix] expired scipy deprecations, sp.sqrt #616

Merged

Conversation

Moritz-Alexander-Kern
Copy link
Member

@Moritz-Alexander-Kern Moritz-Alexander-Kern commented Jan 25, 2024

This pull request (PR) replaces the usage of the sp.sqrt function with np.sqrt.

The deprecation of sp.sqrt expired earlier than expected. Originally, it was planned to be removed with the release of scipy 2.0.0, but with scipy version greater than 1.10.1, unit tests are failing.

Deprecation was introduced in scipy 1.4.0:

https://docs.scipy.org/doc/scipy/release/1.4.0-notes.html#scipy-deprecations

Quote from the scipy release notes:

Support for NumPy functions exposed via the root SciPy namespace is deprecated and will be removed in 2.0.0. For example, if you use scipy.rand or scipy.diag, you should change your code to directly use numpy.random.default_rng or numpy.diag, respectively. They remain available in the currently continuing Scipy 1.x release series.

Further deprecations fixed:

  • DeprecationWarning: 'scipy.integrate.simps' is deprecated in favour of 'scipy.integrate.simpson' and will be removed in SciPy 1.14.0
  • DeprecationWarning: Importing gaussian from 'scipy.signal' is deprecated since SciPy 1.1.0 and will raise an error in SciPy 1.13.0. Please use 'scipy.signal.windows.gaussian' or the convenience function 'scipy.signal.get_window' instead.
  • DeprecationWarning: 'scipy.integrate.cumtrapz' is deprecated in favour of 'scipy.integrate.cumulative_trapezoid' and will be removed in SciPy 1.14.0
  • DeprecationWarning: You are passing x=[0. ... ] as a positional argument. Please change your invocation to use keyword arguments. From SciPy 1.14, passing these as positional arguments will result in an error. F = simpson(I, x=xlin)

@coveralls
Copy link
Collaborator

coveralls commented Jan 25, 2024

Coverage Status

coverage: 88.234% (-0.001%) from 88.235%
when pulling 0f70fb4 on INM-6:fix/scipy_deprecations_expired
into e2df1b9 on NeuralEnsemble:master.

@Moritz-Alexander-Kern Moritz-Alexander-Kern changed the title [Fix] expired scipy deprecations [Fix] expired scipy deprecations, sp.sqrt Jan 25, 2024
@Moritz-Alexander-Kern Moritz-Alexander-Kern added this to the v1.1.0 milestone Jan 25, 2024
@pep8speaks
Copy link

pep8speaks commented Jan 25, 2024

Hello @Moritz-Alexander-Kern! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 284:9: E741 ambiguous variable name 'I'
Line 296:9: E741 ambiguous variable name 'I'

Comment last updated at 2024-01-25 15:53:34 UTC

Copy link
Collaborator

@kohlerca kohlerca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me. I confirm that the deprecation warnings and errors related to the new SciPy version are fixed.

@Moritz-Alexander-Kern Moritz-Alexander-Kern removed the request for review from mdenker March 20, 2024 11:16
@Moritz-Alexander-Kern Moritz-Alexander-Kern merged commit dd3146c into NeuralEnsemble:master Mar 20, 2024
14 of 15 checks passed
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 this pull request may close these issues.

4 participants