From a03ec50b605d51375d41fbddfcf62341408c9664 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Mon, 25 Aug 2025 15:17:18 +0530 Subject: [PATCH 1/3] feat: integrate callback saving into integrator init and finalize --- src/integrators/integrator_utils.jl | 1 + src/solve.jl | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/integrators/integrator_utils.jl b/src/integrators/integrator_utils.jl index 8519932b8..c39ecdea3 100644 --- a/src/integrators/integrator_utils.jl +++ b/src/integrators/integrator_utils.jl @@ -234,6 +234,7 @@ end copyat_or_push!(integrator.sol.u, integrator.saveiter, integrator.u[integrator.opts.save_idxs], Val{false}) end + SciMLBase.save_final_discretes!(integrator, integrator.opts.callback) end if (!isnothing(integrator.W) && integrator.W.curt != integrator.t) || (!isnothing(integrator.P) && integrator.P.curt != integrator.t) diff --git a/src/solve.jl b/src/solve.jl index a57e545b7..841d7476a 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -791,4 +791,8 @@ function initialize_callbacks!(integrator, initialize_save = true) # reset this as it is now handled so the integrators should proceed as normal integrator.u_modified = false + + if initialize_save + SciMLBase.save_discretes_if_enabled!(integrator, integrator.opts.callback; skip_duplicates = true) + end end From 1d95cbf6553b200fabae0a0a23dd823669ad7012 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Wed, 3 Sep 2025 11:55:33 +0530 Subject: [PATCH 2/3] build: bump SciMLBase, DiffEqBase, OrdinaryDiffEqCore compats --- Project.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index d71f7fd4d..37a64a969 100644 --- a/Project.toml +++ b/Project.toml @@ -38,7 +38,7 @@ ADTypes = "1" Adapt = "3, 4" ArrayInterface = "6, 7" DataStructures = "0.18, 0.19" -DiffEqBase = "6.154" +DiffEqBase = "6.187" DiffEqNoiseProcess = "5.13" DocStringExtensions = "0.8, 0.9" FastPower = "1" @@ -51,14 +51,14 @@ Logging = "1.6" MuladdMacro = "0.2.1" NLsolve = "4" OrdinaryDiffEq = "6.87" -OrdinaryDiffEqCore = "1.12.1" +OrdinaryDiffEqCore = "1.32.0" OrdinaryDiffEqDifferentiation = "1.9" OrdinaryDiffEqNonlinearSolve = "1" Random = "1.6" RandomNumbers = "1.5.3" RecursiveArrayTools = "2, 3" Reexport = "0.2, 1.0" -SciMLBase = "2.71" +SciMLBase = "2.115" SciMLOperators = "0.2.9, 0.3, 0.4, 1" SparseArrays = "1.6" StaticArrays = "0.11, 0.12, 1.0" From f3a767add22e9333b0a1e562e5335365931c2e37 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Wed, 3 Sep 2025 14:12:10 +0530 Subject: [PATCH 3/3] test: fix world age issue in ito reversal test --- Project.toml | 1 + test/reversal_tests.jl | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index 37a64a969..a17f4997d 100644 --- a/Project.toml +++ b/Project.toml @@ -48,6 +48,7 @@ JumpProcesses = "9" LevyArea = "1.0.0" LinearAlgebra = "1.6" Logging = "1.6" +ModelingToolkit = "10" MuladdMacro = "0.2.1" NLsolve = "4" OrdinaryDiffEq = "6.87" diff --git a/test/reversal_tests.jl b/test/reversal_tests.jl index 90358f3f6..3ba8d5979 100644 --- a/test/reversal_tests.jl +++ b/test/reversal_tests.jl @@ -124,10 +124,10 @@ end else prob_forward = remake(prob, noise = W_forward, u0 = vec(prob.u0)) end - sys = modelingtoolkitize(prob_forward) + sys = complete(modelingtoolkitize(prob_forward)) sys2 = stochastic_integral_transform(sys, -1 // 1) - fdrift = eval(generate_rhs(sys2)[i]) - fdif = eval(generate_diffusion_function(sys2)[i]) + fdrift = generate_rhs(sys2; expression = Val{false})[i] + fdif = generate_diffusion_function(sys2; expression = Val{false})[i] for solver in Ito_solver println("solver: ", solver)