From a8a2dbd33e666cd90794b91ed55e126ea889576b Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Wed, 3 Sep 2025 12:04:39 +1200 Subject: [PATCH 1/2] Re-enable support for DataStructures@0.18 --- Project.toml | 2 +- src/Nonlinear/ReverseAD/Coloring/Coloring.jl | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 32571c94dc..f3b9c9e884 100644 --- a/Project.toml +++ b/Project.toml @@ -23,7 +23,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" BenchmarkTools = "1" CodecBzip2 = "0.6, 0.7, 0.8" CodecZlib = "0.6, 0.7" -DataStructures = "0.19" +DataStructures = "0.18, 0.19" ForwardDiff = "0.10, 1" JSON3 = "1" JSONSchema = "1" diff --git a/src/Nonlinear/ReverseAD/Coloring/Coloring.jl b/src/Nonlinear/ReverseAD/Coloring/Coloring.jl index d6b77e17e6..9ad45f5dc2 100644 --- a/src/Nonlinear/ReverseAD/Coloring/Coloring.jl +++ b/src/Nonlinear/ReverseAD/Coloring/Coloring.jl @@ -186,6 +186,15 @@ function _merge_trees(eg, eg1, S) return end +# Work-around a deprecation in DataStructures@0.19 +function _IntDisjointSet(n) + @static if isdefined(DataStructures, :IntDisjointSet) + return DataStructures.IntDisjointSet(n) + else + return DataStructures.IntDisjointSets(n) + end +end + """ acyclic_coloring(g::UndirectedGraph) @@ -206,7 +215,7 @@ function acyclic_coloring(g::UndirectedGraph) firstVisitToTree = fill(_Edge(0, 0, 0), _num_edges(g)) color = fill(0, _num_vertices(g)) # disjoint set forest of edges in the graph - S = DataStructures.IntDisjointSet(_num_edges(g)) + S = _IntDisjointSet(_num_edges(g)) @inbounds for v in 1:_num_vertices(g) n_neighbor = _num_neighbors(v, g) start_neighbor = _start_neighbors(v, g) From 3211cceb9f04466c570403ea2e18c927b862d1e8 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Wed, 3 Sep 2025 15:48:40 +1200 Subject: [PATCH 2/2] Skip coverage --- src/Nonlinear/ReverseAD/Coloring/Coloring.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nonlinear/ReverseAD/Coloring/Coloring.jl b/src/Nonlinear/ReverseAD/Coloring/Coloring.jl index 9ad45f5dc2..f847ce4ef0 100644 --- a/src/Nonlinear/ReverseAD/Coloring/Coloring.jl +++ b/src/Nonlinear/ReverseAD/Coloring/Coloring.jl @@ -191,7 +191,7 @@ function _IntDisjointSet(n) @static if isdefined(DataStructures, :IntDisjointSet) return DataStructures.IntDisjointSet(n) else - return DataStructures.IntDisjointSets(n) + return DataStructures.IntDisjointSets(n) # COV_EXCL_LINE end end