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

BUG: integrate: expose ODEintWarning #19224

Merged
merged 1 commit into from Sep 23, 2023
Merged

BUG: integrate: expose ODEintWarning #19224

merged 1 commit into from Sep 23, 2023

Conversation

j-bowhay
Copy link
Member

@j-bowhay j-bowhay commented Sep 11, 2023

Reference issue

closes #17771

What does this implement/fix?

ODEintWarning is not currently exposed in the scpy.integrate namespace which means it is not possible to filter ODEintWarning during the execution of odeint without importing it from the deprecated scipy.integrate.odepack namespace. It was suggested by @WarrenWeckesser that this should be exposed in the integrate namespace.

Additional information

@j-bowhay j-bowhay added defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.integrate labels Sep 11, 2023
@mdhaber
Copy link
Contributor

mdhaber commented Sep 11, 2023

This looks fine to me, but since it is about the old odeint API, I can see arguments for leaving it out and marking gh-17771 as wontfix. Since it's about a new public feature, better ask the mailing list.

@j-bowhay
Copy link
Member Author

Email sent. There did seem to be support for exposing ODEintWarning in the original issue from @WarrenWeckesser

Sorry this issue dropped off my radar. I'd say, if we create a custom warning and raise it in public functions--so users will be exposed to that warning--then the warning itself should also be available as part of the public API. So I think we should update the API so that from scipy.integrate import ODEintWarning works. This would be consistent with other warnings that are currently in public namespaces, such as scipy.integrate.IntegrationWarning, scipy.stats.ConstantInputWarning, scipy.optimize.OptimizationWarning, etc.

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

LGTM, I think this is fine to expose.

@rgommers rgommers added this to the 1.12.0 milestone Sep 23, 2023
Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

A few folks are in favor and no one saw an issue (no answers to the mailing list message), so in it goes. Thanks Jake & all

@rgommers rgommers merged commit 9d12e2c into scipy:main Sep 23, 2023
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.integrate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: cannot import ODEintWarning from scipy.integrate
3 participants