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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 0 additions & 1 deletion .github/workflows/Downgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
with:
version: ${{ matrix.version }}
- uses: julia-actions/julia-downgrade-compat@v1
# if: ${{ matrix.version == '1.6' }}
with:
skip: Pkg,TOML
- uses: julia-actions/julia-buildpkg@v1
Expand Down
41 changes: 19 additions & 22 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,57 +1,54 @@
name = "DiffEqCallbacks"
uuid = "459566f4-90b8-5000-8ac3-15dfb0a30def"
authors = ["Chris Rackauckas <accounts@chrisrackauckas.com>"]
version = "3.9.1"
version = "4.0.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"
DiffEqBase = "6.155.3"
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"
NonlinearSolve = "3.14"
ODEProblemLibrary = "0.1.8"
OrdinaryDiffEq = "6.88"
OrdinaryDiffEqCore = "1"
Parameters = "0.12"
QuadGK = "2.9"
RecipesBase = "1.3.4"
RecursiveArrayTools = "3.9"
SciMLBase = "2.26"
SciMLSensitivity = "7.56"
StaticArrays = "1.8"
RecursiveArrayTools = "3.27"
SciMLBase = "2.54"
SciMLSensitivity = "7.68"
StaticArrays = "1.9.7"
StaticArraysCore = "1.4"
Sundials = "4.19.2"
Test = "1"
Tracker = "0.2.26"
Test = "1.10"
Tracker = "0.2.35"
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"]
4 changes: 3 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"

[compat]
DiffEqCallbacks = "3"
ADTypes = "1.9.0"
DiffEqCallbacks = "4"
Documenter = "1"
OrdinaryDiffEq = "6.88"
Plots = "1.36"
5 changes: 2 additions & 3 deletions docs/src/projection.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ManifoldProjection
Here we solve the harmonic oscillator:

```@example manifold
using OrdinaryDiffEq, DiffEqCallbacks, Plots
using OrdinaryDiffEq, DiffEqCallbacks, Plots, ADTypes
u0 = ones(2)
function f(du, u, p, t)
Expand All @@ -28,14 +28,13 @@ to conserve the sum of squares:
```@example manifold
function g(resid, u, p, t)
resid[1] = u[2]^2 + u[1]^2 - 2
resid[2] = 0
end
```

To build the callback, we just call

```@example manifold
cb = ManifoldProjection(g)
cb = ManifoldProjection(g; autodiff = AutoForwardDiff(), resid_prototype = zeros(1))
```

Using this callback, the Runge-Kutta method `Vern7` conserves energy. Note that the
Expand Down
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
Loading
Loading