diff --git a/Project.toml b/Project.toml index 4c127c90a..37dc143fa 100644 --- a/Project.toml +++ b/Project.toml @@ -35,6 +35,7 @@ ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47" SBMLImporter = "210efffb-c3c8-456d-a807-6f55560b12fe" SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" +SciMLLogging = "a6db7da4-7206-11f0-1eab-35f2a5dbe1d1" Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" StyledStrings = "f489334b-da3d-4c2e-b8f0-e476e12c162b" @@ -78,10 +79,10 @@ Aqua = "0.8" ArrayInterface = "7.7" Bijectors = "0.13, 0.15" CSV = "0.10" -Catalyst = "16" +Catalyst = "16, 17" ComponentArrays = "0.15" DataFrames = "1" -DiffEqBase = "6.183.0" +DiffEqBase = "6.183.0, 7" DiffEqCallbacks = "4" Distributed = "1" Distributions = "0.25" @@ -104,10 +105,10 @@ Optim = "2" Optimization = "5" OptimizationLBFGSB = "1.4.0" OptimizationOptimJL = "0.4" -OrdinaryDiffEqBDF = "1.0" -OrdinaryDiffEqRosenbrock = "1.0" -OrdinaryDiffEqSDIRK = "1.0" -OrdinaryDiffEqTsit5 = "1.9.0" +OrdinaryDiffEqBDF = "1.0, 2" +OrdinaryDiffEqRosenbrock = "1.0, 2" +OrdinaryDiffEqSDIRK = "1.0, 2" +OrdinaryDiffEqTsit5 = "1.9.0, 2" PEtabSelect = "0.1" Plots = "1" PreallocationTools = "1" @@ -119,7 +120,8 @@ ReverseDiff = "1" RuntimeGeneratedFunctions = "0.5" SBMLImporter = "4" SafeTestsets = "0.1" -SciMLBase = "2" +SciMLBase = "2, 3" +SciMLLogging = "1" SciMLSensitivity = "7.81" Setfield = "1.1" StableRNGs = "1.0.4" diff --git a/src/PEtab.jl b/src/PEtab.jl index 0039909d0..f2a925f7f 100644 --- a/src/PEtab.jl +++ b/src/PEtab.jl @@ -36,9 +36,26 @@ import SciMLBase.remake import StatsBase.describe import DiffEqBase import QuasiMonteCarlo: LatinHypercubeSample, SamplingAlgorithm +import SciMLLogging RuntimeGeneratedFunctions.init(@__MODULE__) +# Compat: SciMLBase v3 renamed `SciMLAlgorithm` → `AbstractSciMLAlgorithm`. +@static if isdefined(SciMLBase, :SciMLAlgorithm) + using SciMLBase: SciMLAlgorithm +else + const SciMLAlgorithm = SciMLBase.AbstractSciMLAlgorithm +end + +# Compat helper: SciMLBase v3 / DiffEqBase v7 no longer accept `Bool` for the +# `verbose` kwarg of `solve`; they require a verbosity object from +# SciMLLogging. On older versions, `Bool` still works. +@static if isdefined(DiffEqBase, :DEVerbosity) + _verbose_kwarg(b::Bool) = b ? SciMLLogging.Standard() : SciMLLogging.None() +else + _verbose_kwarg(b::Bool) = b +end + const DistInput = Union{Real, Symbolics.Num} const ModelSystem = Union{ODESystem, ReactionSystem, ODEProblem} const NonlinearAlg = Union{Nothing, NonlinearSolve.AbstractNonlinearSolveAlgorithm} diff --git a/src/solve/solve.jl b/src/solve/solve.jl index d75f8ea76..2687a98a4 100644 --- a/src/solve/solve.jl +++ b/src/solve/solve.jl @@ -233,7 +233,8 @@ function _solve( cbs::SciMLBase.DECallback )::ODESolution return solve( - oprob, solver, abstol = abstol, reltol = reltol, verbose = verbose, + oprob, solver, abstol = abstol, reltol = reltol, + verbose = _verbose_kwarg(verbose), force_dtmin = force_dtmin, maxiters = maxiters, saveat = tsave, dense = dense, callback = cbs ) diff --git a/src/solve/steady_state.jl b/src/solve/steady_state.jl index ae4b24483..fc6b5cdc7 100644 --- a/src/solve/steady_state.jl +++ b/src/solve/steady_state.jl @@ -53,7 +53,8 @@ function _solve_ss( ) return solve( _oprob, solver, abstol = abstol, reltol = reltol, maxiters = maxiters, - saveat = tsave, dense = false, callback = _cbs, verbose = verbose + saveat = tsave, dense = false, callback = _cbs, + verbose = _verbose_kwarg(verbose) ) end