From dd1ed5bb289a48ca62e2422b566f5f0c9eda81d4 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Mon, 13 Jul 2026 12:45:23 -0400 Subject: [PATCH] Require public Symbolics code generation API Raise the Symbolics floor to 7.32 and cover ODEProblem code generation so downgrade testing cannot select a release that predates the public low-level code generation API. Co-Authored-By: Chris Rackauckas --- Project.toml | 2 +- lib/ModelingToolkitBase/Project.toml | 2 +- lib/ModelingToolkitBase/test/simple_mtkcompile.jl | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 0387dc853b..b0472b927b 100644 --- a/Project.toml +++ b/Project.toml @@ -122,7 +122,7 @@ StaticArrays = "1.9.14" StochasticDiffEq = "6.82.0, 7" SymbolicIndexingInterface = "0.3.46" SymbolicUtils = "4.31" -Symbolics = "7.30" +Symbolics = "7.32" UnPack = "0.1, 1.0" julia = "1.10" BenchmarkTools = "1" diff --git a/lib/ModelingToolkitBase/Project.toml b/lib/ModelingToolkitBase/Project.toml index 18530f5e0f..93f8d07167 100644 --- a/lib/ModelingToolkitBase/Project.toml +++ b/lib/ModelingToolkitBase/Project.toml @@ -188,7 +188,7 @@ StochasticDiffEq = "6.82.0, 7" Sundials = "6" SymbolicIndexingInterface = "0.3.39" SymbolicUtils = "4.35.3" -Symbolics = "7.30" +Symbolics = "7.32" TaskLocalValues = "0.1.3" Test = "1" Tracker = "0.2.30" diff --git a/lib/ModelingToolkitBase/test/simple_mtkcompile.jl b/lib/ModelingToolkitBase/test/simple_mtkcompile.jl index 970d94116c..a959732d0c 100644 --- a/lib/ModelingToolkitBase/test/simple_mtkcompile.jl +++ b/lib/ModelingToolkitBase/test/simple_mtkcompile.jl @@ -1,6 +1,13 @@ using ModelingToolkitBase using ModelingToolkitBase: t_nounits as t, D_nounits as D +@testset "Problem code generation" begin + @variables x(t) + @mtkcompile sys = System([D(x) ~ 2x + 1], t) + prob = ODEProblem(sys, [x => 1.0], (0.0, 1.0)) + @test prob.f(prob.u0, prob.p, 0.0) == [3.0] +end + @testset "User-provided `observed` is respected" begin @variables x(t) y(t) z(t) @mtkcompile sys = System([D(x) ~ 2x, z ~ y + x], t; observed = [y ~ 2x + 3])