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

sol.retcode == :Success is not recognized correctly #1916

Closed
Denis-Titov opened this issue Mar 26, 2023 · 7 comments
Closed

sol.retcode == :Success is not recognized correctly #1916

Denis-Titov opened this issue Mar 26, 2023 · 7 comments

Comments

@Denis-Titov
Copy link

Denis-Titov commented Mar 26, 2023

I run the following code from the readme:

f(u,p,t) = 1.01*u
u0=1/2
tspan = (0.0,1.0)
prob = ODEProblem(f,u0,tspan)
sol = solve(prob,Tsit5(),reltol=1e-8,abstol=1e-8)
sol.retcode == :Success #false
Symbol(sol.retcode) == :Success #true

sol.retcode == :Success is false even though Symbol(sol.retcode) == :Success is true

This used to work correctly but stopped working now.

I used Julia 1.9.0-rc1 and DifferentialEquations v7.7.0

@oscardssmith
Copy link
Contributor

It's been deprecated for a while and should now be sol.retcode == ReturnCode.Success.

@ChrisRackauckas
Copy link
Member

That's not in the README? I don't see any sol.retcode in the README? Let me know if there's a spot that's still using the old check but I can't find it.

@Denis-Titov
Copy link
Author

I saw sol.retcode != :Success in documentation here: https://docs.sciml.ai/DiffEqDocs/stable/basics/faq/#My-ODE-is-solving-really-slow

And that's why I started using sol.retcode == :Success, which stopped working.
Sorry sol.retcode is not in README. I meant the ODE example is from README not sol.retcode part

@ChrisRackauckas
Copy link
Member

Cool fixed SciML/DiffEqDocs.jl@3d5ee28

@hhuber2512
Copy link

Hello,

There's another usage of

sol.retcode != :Success

in the SciML documentation, here: https://docs.sciml.ai/DiffEqParamEstim/stable/methods/optimization_based_methods/

It also comes up in the Turing.jl documentation, when they're discussing Bayesian inference with Differential Equations: https://turinglang.org/v0.25/tutorials/10-bayesian-differential-equations/

@ChrisRackauckas
Copy link
Member

in the SciML documentation, here: https://docs.sciml.ai/DiffEqParamEstim/stable/methods/optimization_based_methods/

Thanks, just fixed that one.

@ChrisRackauckas
Copy link
Member

It's been deprecated for a while and should now be sol.retcode == ReturnCode.Success.

SciMLBase.successful_retcode(sol). See https://docs.sciml.ai/SciMLBase/stable/interfaces/Solutions/#Return-Code-Traits

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

4 participants