From a7b8b21d92596a27dd53d69818b2d20dc6680d69 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Mon, 25 Aug 2025 15:21:46 +0530 Subject: [PATCH 1/2] feat: integrate callback saving into integrator init and finalize --- src/SSA_stepper.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/SSA_stepper.jl b/src/SSA_stepper.jl index f497ff40..cb71298b 100644 --- a/src/SSA_stepper.jl +++ b/src/SSA_stepper.jl @@ -155,6 +155,9 @@ function DiffEqBase.solve!(integrator::SSAIntegrator) end DiffEqBase.finalize!(integrator.opts.callback, integrator.u, integrator.t, integrator) + if integrator.save_end + SciMLBase.save_final_discretes!(integrator, integrator.opts.callback) + end if integrator.sol.retcode === ReturnCode.Default integrator.sol = DiffEqBase.solution_new_retcode(integrator.sol, ReturnCode.Success) @@ -246,6 +249,9 @@ function DiffEqBase.__init(jump_prob::JumpProblem, save_end, cur_saveat, opts, _tstops, 1, false, true, alias_tstops, false) cb.initialize(cb, integrator.u, prob.tspan[1], integrator) DiffEqBase.initialize!(opts.callback, integrator.u, prob.tspan[1], integrator) + if save_start + SciMLBase.save_discretes_if_enabled!(integrator, opts.callback; skip_duplicates = true) + end integrator end From dd09f9e46a1d1a819e43781ad0bf78c9453b6014 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Tue, 9 Sep 2025 14:47:12 +0530 Subject: [PATCH 2/2] build: bump SciMLBase, DiffEqBase, OrdinaryDiffEqCore, StochasticDiffEq compats --- Project.toml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index aeb49f86..487314e0 100644 --- a/Project.toml +++ b/Project.toml @@ -36,7 +36,7 @@ Adapt = "4" Aqua = "0.8" ArrayInterface = "7.15" DataStructures = "0.18, 0.19" -DiffEqBase = "6.181" +DiffEqBase = "6.186" DiffEqCallbacks = "4.7" DocStringExtensions = "0.9" ExplicitImports = "1" @@ -47,18 +47,19 @@ KernelAbstractions = "0.9" LinearAlgebra = "1" LinearSolve = "3" OrdinaryDiffEq = "6" +OrdinaryDiffEqCore = "1.32.0" Pkg = "1" PoissonRandom = "0.4" Random = "1" RecursiveArrayTools = "3.32" Reexport = "1.2" SafeTestsets = "0.1" -SciMLBase = "2.95" +SciMLBase = "2.115" Setfield = "1.1" StableRNGs = "1" StaticArrays = "1.9" Statistics = "1" -StochasticDiffEq = "6" +StochasticDiffEq = "6.82" SymbolicIndexingInterface = "0.3.35" Test = "1" UnPack = "1.0.2" @@ -72,6 +73,7 @@ FastBroadcast = "7034ab61-46d4-4ed7-9d0f-46aef9175898" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" +OrdinaryDiffEqCore = "bbf590c4-e513-4bbe-9b18-05decba2e5d8" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"