Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: move to v4 #233

Merged
merged 9 commits into from
Sep 27, 2024
Merged
3 changes: 2 additions & 1 deletion .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
style = "sciml"
format_markdown = true
format_markdown = true
annotate_untyped_fields_with_any = false
23 changes: 10 additions & 13 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,41 +1,36 @@
name = "DiffEqCallbacks"
uuid = "459566f4-90b8-5000-8ac3-15dfb0a30def"
authors = ["Chris Rackauckas <accounts@chrisrackauckas.com>"]
version = "3.9.1"
version = "3.10.0"

[deps]
ConcreteStructs = "2569d6c7-a4a2-43d3-a901-331e8e4be471"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"

[weakdeps]
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
OrdinaryDiffEqCore = "bbf590c4-e513-4bbe-9b18-05decba2e5d8"
Sundials = "c3572dad-4567-51f8-b174-8c6c989267f4"

[compat]
ADTypes = "1.9.0"
Aqua = "0.8"
DataInterpolations = "4.6"
ConcreteStructs = "0.2.3"
DataInterpolations = "4.6, 5, 6"
DataStructures = "0.18.13"
DiffEqBase = "6.154"
DifferentiationInterface = "0.6.1"
ForwardDiff = "0.10.36"
Functors = "0.4"
LinearAlgebra = "1.10"
Markdown = "1.10"
NonlinearSolve = "3.7.2"
ODEProblemLibrary = "0.1.5"
OrdinaryDiffEq = "6.88"
OrdinaryDiffEqCore = "1"
Parameters = "0.12"
QuadGK = "2.9"
RecipesBase = "1.3.4"
RecursiveArrayTools = "3.9"
Expand All @@ -50,8 +45,10 @@ Zygote = "0.6.69"
julia = "1.10"

[extras]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
ODEProblemLibrary = "fdc4e326-1af4-4b90-96e7-779fcce2daa5"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Expand All @@ -64,4 +61,4 @@ Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[targets]
test = ["Aqua", "DataInterpolations", "OrdinaryDiffEq", "ODEProblemLibrary", "Test", "QuadGK", "SciMLSensitivity", "StaticArrays", "Tracker", "Zygote", "NonlinearSolve"]
test = ["ADTypes", "Aqua", "DataInterpolations", "ForwardDiff", "NonlinearSolve", "ODEProblemLibrary", "OrdinaryDiffEq", "QuadGK", "SciMLSensitivity", "StaticArrays", "Test", "Tracker", "Zygote"]
29 changes: 17 additions & 12 deletions src/DiffEqCallbacks.jl
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
module DiffEqCallbacks

using DiffEqBase, RecursiveArrayTools, DataStructures, RecipesBase, LinearAlgebra,
StaticArraysCore, NonlinearSolve, ForwardDiff, Functors

import Base.Iterators

using Markdown

using Parameters: @unpack

import SciMLBase

using DiffEqBase: get_tstops, get_tstops_array, get_tstops_max
using ConcreteStructs: @concrete
using DataStructures: DataStructures, BinaryMaxHeap, BinaryMinHeap
using DiffEqBase: DiffEqBase, get_tstops, get_tstops_array, get_tstops_max
using DifferentiationInterface: DifferentiationInterface, Constant
using Functors: fmap
using LinearAlgebra: LinearAlgebra, adjoint, axpy!, copyto!, mul!, ldiv!
using Markdown: @doc_str
using RecipesBase: @recipe
using RecursiveArrayTools: RecursiveArrayTools, DiffEqArray, copyat_or_push!
using SciMLBase: SciMLBase, CallbackSet, DiscreteCallback, NonlinearFunction,
NonlinearLeastSquaresProblem, NonlinearProblem, RODEProblem,
ReturnCode, SDEProblem, add_tstop!, check_error, get_du,
get_proposed_dt, get_tmp_cache, init, reinit!,
set_proposed_dt!, solve!, terminate!, u_modified!
using StaticArraysCore: StaticArraysCore

const DI = DifferentiationInterface

include("functor_helpers.jl")
include("autoabstol.jl")
Expand Down
2 changes: 1 addition & 1 deletion src/iterative_and_periodic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function (S::PeriodicCallbackAffect)(integrator)
end

function add_next_tstop!(integrator, S)
@unpack Δt, t0, index = S
(; Δt, t0, index) = S

# Schedule next call to `f` using `add_tstops!`, but be careful not to keep integrating forever
tnew = t0[] + (index[] + 1) * Δt
Expand Down
Loading
Loading