Skip to content

Commit cc5fc62

Browse files
Fix retcode comparison to use SciMLBase.successful_retcode
The retcode comparison `sol.retcode != :Success` was comparing a `SciMLBase.ReturnCode.T` enum value against a Symbol, which always evaluates to `true` (they are different types). This caused the `DataDrivenProblem(::DESolution)` constructor to always throw an AssertionError, even for successful solves. Replace with `DiffEqBase.SciMLBase.successful_retcode(sol)` which is the modern SciML API for checking solution success. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d1fb364 commit cc5fc62

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/problem/type.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ function DataDrivenProblem(
518518
sol::T; use_interpolation = false,
519519
kwargs...
520520
) where {T <: DiffEqBase.DESolution}
521-
if sol.retcode != :Success
521+
if !DiffEqBase.SciMLBase.successful_retcode(sol)
522522
throw(AssertionError("The solution is not successful. Abort."))
523523
return
524524
end

0 commit comments

Comments
 (0)