Skip to content

Commit cc005fd

Browse files
fix: add missing OrderedSet/unwrap imports in CasADi/Pyomo dynamic-opt exts
The `__init__` workaround added in 4888437 to fix a Julia 1.10 method invalidation bug calls `OrderedSet{SymbolicT}()` and `unwrap(...)`, but neither name is imported in `MTKCasADiDynamicOptExt` or `MTKPyomoDynamicOptExt`. This causes the extensions to fail to load on Julia 1.10 with `UndefVarError: OrderedSet not defined`, breaking the LTS Extensions test job (`Rocket launch` test in `test/extensions/dynamic_optimization.jl` is the visible failure). `MTKInfiniteOptExt` had the same workaround but with the proper `using OrderedCollections: OrderedSet` and `using Symbolics: unwrap` imports, so it loads fine. Mirror those imports here. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
1 parent 282f1fb commit cc005fd

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

lib/ModelingToolkitBase/ext/MTKCasADiDynamicOptExt.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ using CasADi
44
using DiffEqBase
55
using UnPack
66
using NaNMath
7-
using Symbolics: SymbolicT
7+
using OrderedCollections: OrderedSet
8+
using Symbolics: SymbolicT, unwrap
89
const MTK = ModelingToolkitBase
910

1011
function __init__()

lib/ModelingToolkitBase/ext/MTKPyomoDynamicOptExt.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ using DiffEqBase
55
using UnPack
66
using NaNMath
77
using Setfield
8+
using OrderedCollections: OrderedSet
9+
using Symbolics: SymbolicT, unwrap
810
import SymbolicUtils as SU
911
const MTK = ModelingToolkitBase
1012

0 commit comments

Comments
 (0)