Skip to content

Commit a388ead

Browse files
Move sparsedifftools dep to an extension
1 parent 8b95291 commit a388ead

File tree

4 files changed

+44
-34
lines changed

4 files changed

+44
-34
lines changed

Project.toml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MultiScaleArrays"
22
uuid = "f9640e96-87f6-5992-9c3b-0743c6a49ffa"
33
authors = ["Chris Rackauckas <[email protected]>"]
4-
version = "1.13.0"
4+
version = "1.14.0"
55

66
[deps]
77
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
@@ -11,10 +11,15 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1111
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
1212
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1313
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
14-
SparseDiffTools = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
1514
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1615
StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0"
1716

17+
[weakdeps]
18+
SparseDiffTools = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
19+
20+
[extensions]
21+
MultiScaleArraysSparseDiffToolsExt = "SparseDiffTools"
22+
1823
[compat]
1924
DiffEqBase = "6.5"
2025
FiniteDiff = "2.3"
@@ -24,7 +29,7 @@ RecursiveArrayTools = "1,2,3"
2429
SparseDiffTools = "1.6, 2"
2530
Statistics = "1"
2631
StochasticDiffEq = "6.13"
27-
julia = "1.6"
32+
julia = "1.10"
2833

2934
[extras]
3035
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
module MultiScaleArraysSparseDiffToolsExt
2+
3+
using MultiScaleArrays, SparseDiffTools
4+
5+
function MultiScaleArrays.add_node_jac_config!(cache, config::SparseDiffTools.ForwardColorJacCache, i, x,
6+
node...)
7+
@assert cache.jac_config.colorvec isa UnitRange
8+
cache.jac_config = SparseDiffTools.ForwardColorJacCache(cache.uf, cache.uprev,
9+
config.chunksize)
10+
nothing
11+
end
12+
13+
function MultiScaleArrays.add_node_jac_config!(cache, config::SparseDiffTools.ForwardColorJacCache, i, x)
14+
@assert cache.jac_config.colorvec isa UnitRange
15+
cache.jac_config = SparseDiffTools.ForwardColorJacCache(cache.uf, cache.uprev,
16+
config.chunksize)
17+
nothing
18+
end
19+
20+
function MultiScaleArrays.remove_node_jac_config!(cache, config::SparseDiffTools.ForwardColorJacCache, i, x,
21+
node...)
22+
@assert cache.jac_config.colorvec isa UnitRange
23+
cache.jac_config = SparseDiffTools.ForwardColorJacCache(cache.uf, cache.uprev,
24+
config.chunksize)
25+
nothing
26+
end
27+
28+
function MultiScaleArrays.remove_node_jac_config!(cache, config::SparseDiffTools.ForwardColorJacCache, i, x)
29+
@assert cache.jac_config.colorvec isa UnitRange
30+
cache.jac_config = SparseDiffTools.ForwardColorJacCache(cache.uf, cache.uprev,
31+
config.chunksize)
32+
nothing
33+
end
34+
35+
end

src/MultiScaleArrays.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ abstract type AbstractMultiScaleArrayLeaf{B} <: AbstractMultiScaleArray{B} end
172172
abstract type AbstractMultiScaleArrayHead{B} <: AbstractMultiScaleArray{B} end
173173

174174
using DiffEqBase, Statistics, LinearAlgebra, FiniteDiff
175-
import OrdinaryDiffEq, StochasticDiffEq, ForwardDiff, SparseDiffTools
175+
import OrdinaryDiffEq, StochasticDiffEq, ForwardDiff
176176

177177
Base.show(io::IO, x::AbstractMultiScaleArray) = invoke(show, Tuple{IO, Any}, io, x)
178178
Base.show(io::IO, ::MIME"text/plain", x::AbstractMultiScaleArray) = show(io, x)

src/diffeq.jl

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -113,36 +113,6 @@ function remove_node_non_user_cache!(integrator::DiffEqBase.AbstractODEIntegrato
113113
nothing
114114
end
115115

116-
function add_node_jac_config!(cache, config::SparseDiffTools.ForwardColorJacCache, i, x,
117-
node...)
118-
@assert cache.jac_config.colorvec isa UnitRange
119-
cache.jac_config = SparseDiffTools.ForwardColorJacCache(cache.uf, cache.uprev,
120-
config.chunksize)
121-
nothing
122-
end
123-
124-
function add_node_jac_config!(cache, config::SparseDiffTools.ForwardColorJacCache, i, x)
125-
@assert cache.jac_config.colorvec isa UnitRange
126-
cache.jac_config = SparseDiffTools.ForwardColorJacCache(cache.uf, cache.uprev,
127-
config.chunksize)
128-
nothing
129-
end
130-
131-
function remove_node_jac_config!(cache, config::SparseDiffTools.ForwardColorJacCache, i, x,
132-
node...)
133-
@assert cache.jac_config.colorvec isa UnitRange
134-
cache.jac_config = SparseDiffTools.ForwardColorJacCache(cache.uf, cache.uprev,
135-
config.chunksize)
136-
nothing
137-
end
138-
139-
function remove_node_jac_config!(cache, config::SparseDiffTools.ForwardColorJacCache, i, x)
140-
@assert cache.jac_config.colorvec isa UnitRange
141-
cache.jac_config = SparseDiffTools.ForwardColorJacCache(cache.uf, cache.uprev,
142-
config.chunksize)
143-
nothing
144-
end
145-
146116
function add_node_jac_config!(cache, config::FiniteDiff.JacobianCache, i, x)
147117
#add_node!(cache.x1, fill!(similar(x, eltype(cache.x1)),0))
148118
add_node!(config.fx, recursivecopy(x))

0 commit comments

Comments
 (0)