Skip to content

Commit 3c1b06e

Browse files
committed
Fix deprecated DataStructures.jl functions for v0.19 compatibility
- Replace enqueue! with push! - Replace dequeue! with popfirst! - Replace IntDisjointSets with IntDisjointSet - Import IntDisjointSet to fix compilation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 83bfa78 commit 3c1b06e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/ModelingToolkit.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ using LinearAlgebra, SparseArrays
2929
using InteractiveUtils
3030
using JumpProcesses
3131
using DataStructures
32+
import DataStructures: IntDisjointSet
3233
using Base.Threads
3334
using Latexify, Unitful, ArrayInterface
3435
using Setfield, ConstructionBase

src/systems/alias_elimination.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,20 +426,20 @@ function topsort_equations(eqs, unknowns; check = true)
426426

427427
q = Queue{Int}(neqs)
428428
for (i, d) in enumerate(degrees)
429-
d == 0 && enqueue!(q, i)
429+
d == 0 && push!(q, i)
430430
end
431431

432432
idx = 0
433433
ordered_eqs = similar(eqs, 0)
434434
sizehint!(ordered_eqs, neqs)
435435
while !isempty(q)
436-
𝑠eq = dequeue!(q)
436+
𝑠eq = popfirst!(q)
437437
idx += 1
438438
push!(ordered_eqs, eqs[𝑠eq])
439439
var = assigns[𝑠eq]
440440
for 𝑑eq in 𝑑neighbors(graph, var)
441441
degree = degrees[𝑑eq] = degrees[𝑑eq] - 1
442-
degree == 0 && enqueue!(q, 𝑑eq)
442+
degree == 0 && push!(q, 𝑑eq)
443443
end
444444
end
445445

src/systems/connectiongraph.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ function connectionsets(graph::ConnectionGraph)
452452
invmap = graph.invmap
453453

454454
# union all of the hyperedges
455-
disjoint_sets = IntDisjointSets(length(invmap))
455+
disjoint_sets = IntDisjointSet(length(invmap))
456456
for edge_i in 𝑠vertices(bigraph)
457457
hyperedge = 𝑠neighbors(bigraph, edge_i)
458458
isempty(hyperedge) && continue

0 commit comments

Comments
 (0)