From 0fb3afd6d474006a1976e37d99f79fa2ecb4074c Mon Sep 17 00:00:00 2001 From: jClugstor Date: Wed, 8 Apr 2026 11:07:37 -0400 Subject: [PATCH 1/7] add SciMLLogging integration --- Project.toml | 2 ++ src/ODEInterfaceDiffEq.jl | 2 ++ src/solve.jl | 17 ++++++++++------- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Project.toml b/Project.toml index 894a9ed..20d223c 100644 --- a/Project.toml +++ b/Project.toml @@ -12,6 +12,7 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" ODEInterface = "54ca160b-1b9f-5127-a996-1867f4bc2a2c" Reexport = "189a3867-3050-52da-a836-e630ba90ab69" SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" +SciMLLogging = "a6db7da4-7206-11f0-1eab-35f2a5dbe1d1" [compat] Compat = "2.2, 3.0, 4" @@ -21,6 +22,7 @@ FunctionWrappers = "1.0" ODEInterface = "0.5" Reexport = "0.2, 1.0" SciMLBase = "1.73, 2" +SciMLLogging = "1.9.1" julia = "1.6" [extras] diff --git a/src/ODEInterfaceDiffEq.jl b/src/ODEInterfaceDiffEq.jl index f6b5005..fde3f19 100644 --- a/src/ODEInterfaceDiffEq.jl +++ b/src/ODEInterfaceDiffEq.jl @@ -14,6 +14,8 @@ module ODEInterfaceDiffEq using LinearAlgebra: I using SciMLBase: CallbackSet, ReturnCode, VectorContinuousCallback, check_keywords, warn_compat + using SciMLLogging: SciMLLogging, @SciMLMessage + import DiffEqBase: DEVerbosity, DEFAULT_VERBOSE, _process_verbose_param import DiffEqBase: solve, initialize!, savevalues! diff --git a/src/solve.jl b/src/solve.jl index 80a721f..f1fcad3 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -15,13 +15,15 @@ function DiffEqBase.__solve( ) where {uType, tuptType, isinplace, AlgType <: ODEInterfaceAlgorithm} tType = eltype(tuptType) + verbose_spec = _process_verbose_param(verbose) isstiff = alg isa ODEInterfaceImplicitAlgorithm - if verbose + if SciMLLogging.verbosity_to_bool(verbose_spec) warned = !isempty(kwargs) && check_keywords(alg, kwargs, warnlist) if !(prob.f isa DiffEqBase.AbstractParameterizedFunction) && isstiff if DiffEqBase.has_tgrad(prob.f) - @warn("Explicit t-gradient given to this stiff solver is ignored.") + @SciMLMessage("Explicit t-gradient given to this stiff solver is ignored.", + verbose_spec, :mismatched_input_output_type) warned = true end end @@ -120,7 +122,8 @@ function DiffEqBase.__solve( o[:OUTPUTFCN] = outputfcn if !(callbacks_internal.continuous_callbacks isa Tuple{}) || !isempty(saveat) if alg isa Union{ddeabm, ddebdf} - @warn("saveat and continuous callbacks ignored for ddeabm and ddebdf") + @SciMLMessage("saveat and continuous callbacks ignored for ddeabm and ddebdf", + verbose_spec, :dense_output_saveat) o[:OUTPUTMODE] = ODEInterface.OUTPUTFCN_WODENSE else o[:OUTPUTMODE] = ODEInterface.OUTPUTFCN_DENSE @@ -238,16 +241,16 @@ function DiffEqBase.__solve( if retcode < 0 if retcode == -1 - verbose && @warn("Input is not consistent.") + @SciMLMessage("Input is not consistent.", verbose_spec, :inconsistent_input) return_retcode = ReturnCode.Failure elseif retcode == -2 - verbose && @warn("Interrupted. Larger maxiters is needed.") + @SciMLMessage("Interrupted. Larger maxiters is needed.", verbose_spec, :max_iters) return_retcode = ReturnCode.MaxIters elseif retcode == -3 - verbose && @warn("Step size went too small.") + @SciMLMessage("Step size went too small.", verbose_spec, :dt_min_unstable) return_retcode = ReturnCode.DtLessThanMin elseif retcode == -4 - verbose && @warn("Interrupted. Problem is probably stiff.") + @SciMLMessage("Interrupted. Problem is probably stiff.", verbose_spec, :stiff_detection) return_retcode = ReturnCode.Unstable end else From 22981c642b7918fd4e2ed2145e67e1d660e99022 Mon Sep 17 00:00:00 2001 From: jClugstor Date: Thu, 9 Apr 2026 13:33:17 -0400 Subject: [PATCH 2/7] explicit _process_verbose_params --- src/ODEInterfaceDiffEq.jl | 2 +- src/solve.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ODEInterfaceDiffEq.jl b/src/ODEInterfaceDiffEq.jl index fde3f19..425f883 100644 --- a/src/ODEInterfaceDiffEq.jl +++ b/src/ODEInterfaceDiffEq.jl @@ -15,7 +15,7 @@ module ODEInterfaceDiffEq using SciMLBase: CallbackSet, ReturnCode, VectorContinuousCallback, check_keywords, warn_compat using SciMLLogging: SciMLLogging, @SciMLMessage - import DiffEqBase: DEVerbosity, DEFAULT_VERBOSE, _process_verbose_param + import DiffEqBase: DEVerbosity, DEFAULT_VERBOSE import DiffEqBase: solve, initialize!, savevalues! diff --git a/src/solve.jl b/src/solve.jl index f1fcad3..241ef9d 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -15,7 +15,7 @@ function DiffEqBase.__solve( ) where {uType, tuptType, isinplace, AlgType <: ODEInterfaceAlgorithm} tType = eltype(tuptType) - verbose_spec = _process_verbose_param(verbose) + verbose_spec = DiffEqBase._process_verbose_param(verbose) isstiff = alg isa ODEInterfaceImplicitAlgorithm if SciMLLogging.verbosity_to_bool(verbose_spec) From b6128e8aaa4e5313196baef122bbbf0ebd3c7a2e Mon Sep 17 00:00:00 2001 From: jClugstor Date: Thu, 9 Apr 2026 13:36:24 -0400 Subject: [PATCH 3/7] runic format --- src/solve.jl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/solve.jl b/src/solve.jl index 241ef9d..3b421d6 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -22,8 +22,10 @@ function DiffEqBase.__solve( warned = !isempty(kwargs) && check_keywords(alg, kwargs, warnlist) if !(prob.f isa DiffEqBase.AbstractParameterizedFunction) && isstiff if DiffEqBase.has_tgrad(prob.f) - @SciMLMessage("Explicit t-gradient given to this stiff solver is ignored.", - verbose_spec, :mismatched_input_output_type) + @SciMLMessage( + "Explicit t-gradient given to this stiff solver is ignored.", + verbose_spec, :mismatched_input_output_type + ) warned = true end end @@ -122,8 +124,10 @@ function DiffEqBase.__solve( o[:OUTPUTFCN] = outputfcn if !(callbacks_internal.continuous_callbacks isa Tuple{}) || !isempty(saveat) if alg isa Union{ddeabm, ddebdf} - @SciMLMessage("saveat and continuous callbacks ignored for ddeabm and ddebdf", - verbose_spec, :dense_output_saveat) + @SciMLMessage( + "saveat and continuous callbacks ignored for ddeabm and ddebdf", + verbose_spec, :dense_output_saveat + ) o[:OUTPUTMODE] = ODEInterface.OUTPUTFCN_WODENSE else o[:OUTPUTMODE] = ODEInterface.OUTPUTFCN_DENSE From ffeb62cf2087a20cd123d9b1ad18c082cc259867 Mon Sep 17 00:00:00 2001 From: jClugstor Date: Mon, 13 Apr 2026 10:16:30 -0400 Subject: [PATCH 4/7] bump DiffEqBase lower bound --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 20d223c..dbcf48d 100644 --- a/Project.toml +++ b/Project.toml @@ -17,7 +17,7 @@ SciMLLogging = "a6db7da4-7206-11f0-1eab-35f2a5dbe1d1" [compat] Compat = "2.2, 3.0, 4" DataStructures = "0.18, 0.19" -DiffEqBase = "6.122" +DiffEqBase = "6.217" FunctionWrappers = "1.0" ODEInterface = "0.5" Reexport = "0.2, 1.0" From cf98c47d9e6064acb145bb56ccd3ba2e8248c4ae Mon Sep 17 00:00:00 2001 From: jClugstor Date: Thu, 16 Apr 2026 13:46:47 -0400 Subject: [PATCH 5/7] test --- src/ODEInterfaceDiffEq.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ODEInterfaceDiffEq.jl b/src/ODEInterfaceDiffEq.jl index 425f883..9252004 100644 --- a/src/ODEInterfaceDiffEq.jl +++ b/src/ODEInterfaceDiffEq.jl @@ -15,7 +15,7 @@ module ODEInterfaceDiffEq using SciMLBase: CallbackSet, ReturnCode, VectorContinuousCallback, check_keywords, warn_compat using SciMLLogging: SciMLLogging, @SciMLMessage - import DiffEqBase: DEVerbosity, DEFAULT_VERBOSE + import DiffEqBase: DEFAULT_VERBOSE, DEVerbosity import DiffEqBase: solve, initialize!, savevalues! From 3cf9f681db57bab88814a9bbc1f8e703cccddadf Mon Sep 17 00:00:00 2001 From: jClugstor Date: Thu, 16 Apr 2026 14:17:41 -0400 Subject: [PATCH 6/7] remove stale import --- src/ODEInterfaceDiffEq.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ODEInterfaceDiffEq.jl b/src/ODEInterfaceDiffEq.jl index 9252004..ae590f1 100644 --- a/src/ODEInterfaceDiffEq.jl +++ b/src/ODEInterfaceDiffEq.jl @@ -15,7 +15,7 @@ module ODEInterfaceDiffEq using SciMLBase: CallbackSet, ReturnCode, VectorContinuousCallback, check_keywords, warn_compat using SciMLLogging: SciMLLogging, @SciMLMessage - import DiffEqBase: DEFAULT_VERBOSE, DEVerbosity + import DiffEqBase: DEVerbosity import DiffEqBase: solve, initialize!, savevalues! From 3981c636a4051b369aaf2cf2ee6f21c4dbc8eff9 Mon Sep 17 00:00:00 2001 From: jClugstor Date: Thu, 16 Apr 2026 14:51:16 -0400 Subject: [PATCH 7/7] remove if verbose check --- src/solve.jl | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/solve.jl b/src/solve.jl index 3b421d6..c7bd374 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -18,19 +18,17 @@ function DiffEqBase.__solve( verbose_spec = DiffEqBase._process_verbose_param(verbose) isstiff = alg isa ODEInterfaceImplicitAlgorithm - if SciMLLogging.verbosity_to_bool(verbose_spec) - warned = !isempty(kwargs) && check_keywords(alg, kwargs, warnlist) - if !(prob.f isa DiffEqBase.AbstractParameterizedFunction) && isstiff - if DiffEqBase.has_tgrad(prob.f) - @SciMLMessage( - "Explicit t-gradient given to this stiff solver is ignored.", - verbose_spec, :mismatched_input_output_type - ) - warned = true - end + warned = !isempty(kwargs) && check_keywords(alg, kwargs, warnlist) + if !(prob.f isa DiffEqBase.AbstractParameterizedFunction) && isstiff + if DiffEqBase.has_tgrad(prob.f) + @SciMLMessage( + "Explicit t-gradient given to this stiff solver is ignored.", + verbose_spec, :mismatched_input_output_type + ) + warned = true end - warned && warn_compat() end + warned && warn_compat() callbacks_internal = CallbackSet(callback)