Repository navigation
Allow OrderedCollections 2 (and Parameters 0.13) - #87
Open
matthew-liu-1 wants to merge 1 commit into
Open
matthew-liu-1 wants to merge 1 commit into
matthew-liu-1 wants to merge 1 commit into
Conversation
OrderedCollections 2.0.1 is available. Parameters 0.13.1 is the first Parameters release that allows it. This change widens both compat entries and bumps the patch version. The resolver keeps OrderedCollections 1.x until StanBase also allows version 2. This change is therefore safe to merge on its own.
matthew-liu-1
force-pushed
the
compat/orderedcollections-2
branch
from
September 30, 2026 03:19
ee7f5bf to
42029d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Widens two compat bounds so StanSample can be used in environments that need
OrderedCollections 2, and bumps the patch version to 7.10.4.
Parametershas to move together withOrderedCollections: everyParameters0.12.x release caps
OrderedCollectionsto 1.x, so 0.13.1 is the only release inthe 0.12–0.13 range that admits OrderedCollections 2. That indirection is why
widening
OrderedCollectionsalone is not enough.This is safe to merge on its own: the resolver simply keeps OrderedCollections
1.x until StanBase allows 2 as well (companion PR in StanJulia/StanBase.jl), so
merging this alone changes nothing for existing users.
Motivation
@bparbhu — for context on why we're asking for this: we're trying to run
MLJLinearModels at head, which needs OrderedCollections 2 in the resolved
environment. StanSample and StanBase are currently the StanJulia-side pins that
prevent our environment from getting there (along with StanOptimize, which has the
same
Parameters = "0.12"cap — companion PR filed there too).Why no code changes are needed
OrderedDictis only ever constructed or used as a type parameter:src/utils/reshape.jl(OrderedDict{String, Variable}),src/utils/namedtuples.jl(OrderedDict()),src/utils/particles.jlandext/MonteCarloMeasurementsExt.jl(OrderedDict{Symbol, …}).Parametersis imported insrc/StanSample.jl:24but no macro from it is usedanywhere in
src/orext/— no@with_kw,@unpack,@pack!,reconstructortype2dict. The only other matches for "Parameters" in thesource are docstring prose.
OrderedCollections 2.0's breaking changes are: removal of the deprecated
similar(::OrderedDict)/similar(::OrderedSet)/sort(::Dict)methods,removal of deprecated
OrderedSetindexing,convert(OrderedDict, ::AbstractDict)on an unordered dict now throwing instead of warning,
first/laston an emptycollection throwing
ArgumentError, and a changed internalOrderedDictstructlayout (new
live,firstlive,lastlivefields). None of these are reachablefrom the usage above.
Testing
Julia 1.10.12, Linux x86_64, CmdStan 2.36.0.
Full test suite under OrderedCollections 2.0.1 + Parameters 0.13.1:
260 passed, 0 failed, exit code 0.
StanSample and its
AxisKeys,InferenceObjectsandMonteCarloMeasurementsextensions all precompile cleanly against OrderedCollections 2.0.1.
One caveat: the
MCMCChainsextensionMCMCChainsis capped at"5.6, 6"here, but every MCMCChains release —including 7.7.0 — caps
OrderedCollectionsto 1.x, so the extension cannot reachOrderedCollections 2 regardless of what this PR does, and widening that bound here
would not help; it needs a compat widening in MCMCChains itself.
That widening is already open as TuringLang/MCMCChains.jl#511
(
OrderedCollections"1.4"→"1.4, 2"), with a green test matrix. Once itmerges and registers, the
MCMCChainsbound here can be revisited in a follow-up.In the meantime I left the
MCMCChainsbound untouched and excluded the two testfiles that
using MCMCChains(test/test_mcmcchains/,test/test_chris_two_step/)from the OrderedCollections 2 run. Since MCMCChains is a weak dependency, this does
not affect users who don't load it.