Add DataStructures v0.17-v0.19 compatibility with version branching #3959
+23
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add backward-compatible support for DataStructures.jl v0.17, v0.18, and v0.19 using compile-time version branching.
Changes
1. Project.toml (line 101)
DataStructures = "0.17, 0.18, 0.19"
2. src/ModelingToolkit.jl (lines 32-37)
IntDisjointSet
directlyIntDisjointSets
and creates type aliasconst IntDisjointSet = IntDisjointSets
3. src/systems/alias_elimination.jl (lines 429-456)
topsort_equations
function:push!(q, x)
andpopfirst!(q)
enqueue!(q, x)
anddequeue!(q)
4. src/systems/connectiongraph.jl (line 458)
IntDisjointSets
usage toIntDisjointSet
to use the version-appropriate type via the aliasTechnical Details
All version branching uses
@static if pkgversion(DataStructures) >= v"0.19"
for compile-time selection, ensuring zero runtime overhead. The version check happens at precompilation time, so the appropriate API is selected based on the installed DataStructures version.Benefits
Testing
Related
This PR supersedes #3864 which only supported v0.19 and dropped v0.18 support.
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com