From ab175704c90e7b6c70dd525aa0df7086f6f5f388 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Sun, 26 Apr 2026 18:47:50 -0400 Subject: [PATCH 1/3] Bump compat for OrdinaryDiffEq v7 / SciMLBase v3 ecosystem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - DiffEqBase: "6" → "6, 7" (DiffEqBase v7 ships as sublibrary in OrdinaryDiffEq v7 monorepo) - OrdinaryDiffEq: add compat "6, 7" (was in [extras]/[targets] but lacked explicit compat bound) - Catalyst: "15" → "14, 15, 16" (allow v16 which is current) - SteadyStateDiffEq: add compat "1, 2" (was in test deps without compat bound) - Sundials: add compat "4, 5, 6" (was in test deps without compat bound) No source code changes needed: the codebase uses only DiffEqBase APIs (ODEProblem, SteadyStateProblem, ODEFunction, NullParameters) that are unchanged in v7, and tests already use the forward-compatible sol.u[i] indexing (not sol[i]) required by RecursiveArrayTools v4. Refs: SciML/OrdinaryDiffEq.jl#3562, SciML/OrdinaryDiffEq.jl#3565 Co-Authored-By: Chris Rackauckas --- Project.toml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 06f6433..e724d17 100644 --- a/Project.toml +++ b/Project.toml @@ -12,11 +12,14 @@ RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [compat] -Catalyst = "15" -DiffEqBase = "6" +Catalyst = "14, 15, 16" +DiffEqBase = "6, 7" MacroTools = "^0.5.5" +OrdinaryDiffEq = "6, 7" Reexport = "1" RuntimeGeneratedFunctions = "0.5" +SteadyStateDiffEq = "1, 2" +Sundials = "4, 5, 6" julia = "1.10" [extras] From f16599494400eac4ed54a0e518ff64c40fb3b528 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Sun, 26 Apr 2026 19:05:44 -0400 Subject: [PATCH 2/3] Revert Catalyst compat to "15" only Catalyst v16 dropped the ModelingToolkit re-export in favor of ModelingToolkitBase, which broke calls to ModelingToolkit.value, ModelingToolkit.scalarize and ModelingToolkit.varmap_to_vars in src/indexhandlers.jl and src/fspsystem.jl. Migrating to Catalyst v16 is out of scope for this OrdinaryDiffEq v7 ecosystem bump; revert that compat change and leave Catalyst at "15". Co-Authored-By: Chris Rackauckas --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index e724d17..25cb60c 100644 --- a/Project.toml +++ b/Project.toml @@ -12,7 +12,7 @@ RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [compat] -Catalyst = "14, 15, 16" +Catalyst = "15" DiffEqBase = "6, 7" MacroTools = "^0.5.5" OrdinaryDiffEq = "6, 7" From 5c509ea16cc74b3d17cb59a913e3a2f03a265699 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Fri, 8 May 2026 16:21:09 -0400 Subject: [PATCH 3/3] Fix Julia 1.12 incompatibility in MacroTools.prettify call Julia 1.12 removed the `mt` field from `Base.MethodList`, breaking `MacroTools.prettify`'s `unresolve` step (FluxML/MacroTools.jl#216). The fix on MacroTools master is unreleased, so define a local `_prettify` that mirrors `MacroTools.prettify` but uses `nameof(f)` on Julia 1.12+ instead of `methods(f).mt.name`. Use it in place of `MacroTools.prettify` in `build_rhs_ex` and `build_rhs_ex_ss`. Co-Authored-By: Chris Rackauckas Co-Authored-By: Claude Opus 4.7 (1M context) --- src/FiniteStateProjection.jl | 19 +++++++++++++++++++ src/build_rhs.jl | 2 +- src/build_rhs_ss.jl | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/FiniteStateProjection.jl b/src/FiniteStateProjection.jl index 5f2f82e..96b6507 100644 --- a/src/FiniteStateProjection.jl +++ b/src/FiniteStateProjection.jl @@ -14,6 +14,25 @@ RuntimeGeneratedFunctions.init(@__MODULE__) export FSPSystem, DefaultIndexHandler, SteadyState +# Julia 1.12 removed the `mt` field on `Base.MethodList`, breaking +# `MacroTools.prettify`'s `unresolve` step (FluxML/MacroTools.jl#216). +# Replicate `MacroTools.prettify` locally with a 1.12-safe `unresolve` +# so generated CME RHS expressions can still be tidied for display. +_unresolve1(x) = x +@static if VERSION >= v"1.12-" + _unresolve1(f::Function) = nameof(f) +else + _unresolve1(f::Function) = methods(f).mt.name +end +_unresolve(ex) = MacroTools.prewalk(_unresolve1, ex) +function _prettify(ex; lines = false, alias = true) + ex = lines ? ex : MacroTools.striplines(ex) + ex = MacroTools.flatten(ex) + ex = _unresolve(ex) + ex = MacroTools.resyntax(ex) + return alias ? MacroTools.alias_gensyms(ex) : ex +end + abstract type AbstractIndexHandler end include("fspsystem.jl") diff --git a/src/build_rhs.jl b/src/build_rhs.jl index 045c7c5..2332580 100644 --- a/src/build_rhs.jl +++ b/src/build_rhs.jl @@ -104,7 +104,7 @@ function build_rhs_ex(sys::FSPSystem; striplines::Bool = false) striplines && (ex = MacroTools.striplines(ex)) - ex = ex |> MacroTools.flatten |> MacroTools.prettify + ex = ex |> MacroTools.flatten |> _prettify return ex end diff --git a/src/build_rhs_ss.jl b/src/build_rhs_ss.jl index 66dca46..ba2c2dd 100644 --- a/src/build_rhs_ss.jl +++ b/src/build_rhs_ss.jl @@ -43,7 +43,7 @@ function build_rhs_ex_ss(sys::FSPSystem; striplines::Bool = false) striplines && (ex = MacroTools.striplines(ex)) - ex = ex |> MacroTools.flatten |> MacroTools.prettify + ex = ex |> MacroTools.flatten |> _prettify return ex end