Skip to content

Commit 945c9de

Browse files
committed
Remove Symbolics from test dependencies
Removes Symbolics from the main test target to avoid dependency conflicts with DataStructures v0.19 and the symbolic stack. The only test using Symbolics was nonfulldiagonal_sparse.jl, which used Symbolics.jacobian_sparsity to compute a sparsity pattern. This has been replaced with a hardcoded sparsity pattern that was pre-computed using the same function, preserving identical test behavior. This allows packages depending on newer versions of DataStructures and other dependencies to work without conflicts from the symbolic stack (Symbolics/DynamicPolynomials/MultivariatePolynomials). 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 1443dae commit 945c9de

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
206206
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
207207

208208
[targets]
209-
test = ["ComponentArrays", "Symbolics", "AlgebraicMultigrid", "IncompleteLU", "DiffEqCallbacks", "DifferentiationInterface", "DiffEqDevTools", "ODEProblemLibrary", "ElasticArrays", "JLArrays", "Random", "SafeTestsets", "StructArrays", "Test", "Unitful", "Pkg", "NLsolve", "RecursiveFactorization", "SparseConnectivityTracer", "SparseMatrixColorings", "Statistics"]
209+
test = ["ComponentArrays", "AlgebraicMultigrid", "IncompleteLU", "DiffEqCallbacks", "DifferentiationInterface", "DiffEqDevTools", "ODEProblemLibrary", "ElasticArrays", "JLArrays", "Random", "SafeTestsets", "StructArrays", "Test", "Unitful", "Pkg", "NLsolve", "RecursiveFactorization", "SparseConnectivityTracer", "SparseMatrixColorings", "Statistics"]

test/interface/nonfulldiagonal_sparse.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using OrdinaryDiffEq, SparseArrays, LinearSolve, LinearAlgebra
22
using SimpleUnPack
33
using ComponentArrays
4-
using Symbolics
54

65
function enclosethetimedifferential(parameters::NamedTuple)::Function
76
@info "Enclosing the time differential"
@@ -124,9 +123,12 @@ odeprob = ODEProblem(dudt,
124123
(0, 2.1),
125124
parameters.prior);
126125
du0 = copy(odeprob.u0);
127-
jac_sparsity = Symbolics.jacobian_sparsity((du, u) -> dudt(du, u, parameters.prior, 0.0),
128-
du0,
129-
odeprob.u0);
126+
# Hardcoded sparsity pattern for 15 spatial points + 3 state variables (18x18 matrix)
127+
# Previously computed using: Symbolics.jacobian_sparsity((du, u) -> dudt(du, u, parameters.prior, 0.0), du0, odeprob.u0)
128+
# This avoids the dependency on Symbolics in tests
129+
I = [1, 2, 16, 18, 1, 2, 3, 18, 2, 3, 4, 18, 3, 4, 5, 18, 4, 5, 6, 18, 5, 6, 7, 18, 6, 7, 8, 18, 7, 8, 9, 18, 8, 9, 10, 18, 9, 10, 11, 18, 10, 11, 12, 18, 11, 12, 13, 18, 12, 13, 14, 18, 13, 14, 15, 18, 14, 15, 17, 18, 1, 16, 17, 15, 17, 18, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18]
130+
J = [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18]
131+
jac_sparsity = sparse(I, J, ones(Bool, length(I)), 18, 18);
130132
f = ODEFunction(dudt;
131133
jac_prototype = float.(jac_sparsity));
132134
sparseodeprob = ODEProblem(f,

0 commit comments

Comments
 (0)