From 6602341bec9b7930e6b83e424e0a9576d8dcf8d8 Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Fri, 3 Jan 2025 12:44:12 +0100 Subject: [PATCH 01/18] Bump minimum supported Julia version to LTS --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 4b017f91..c733161c 100644 --- a/Project.toml +++ b/Project.toml @@ -64,7 +64,7 @@ StatsBase = "0.33.7, 0.34" Transducers = "0.4.81" Turing = "0.31.4, 0.32, 0.33, 0.34, 0.35" UnPack = "1" -julia = "1.6" +julia = "1.10" [extras] Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" From 56f577312dfe63854c59ab389816bfc7a5d006f5 Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Fri, 3 Jan 2025 12:45:15 +0100 Subject: [PATCH 02/18] Run CI on LTS --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index fee253ca..62209613 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: version: - - '1.6' + - 'lts' - '1' - 'pre' os: @@ -68,7 +68,7 @@ jobs: include: - version: '1' downgrade: false - - version: '1.7' + - version: 'lts' downgrade: true steps: - uses: actions/checkout@v4 From e7fab42ec0d4c53ace1556091264e2b93606ea7e Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Fri, 3 Jan 2025 13:04:58 +0100 Subject: [PATCH 03/18] Bump Optimization lower bound to 3.21 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index c733161c..a2485f60 100644 --- a/Project.toml +++ b/Project.toml @@ -50,7 +50,7 @@ LogDensityProblems = "2.1.0" LogDensityProblemsAD = "1.7.0" MCMCChains = "6.0.2" Optim = "1.7.2" -Optimization = "3.16.0, 4" +Optimization = "3.21, 4" OptimizationOptimJL = "0.1.7, 0.2, 0.3, 0.4" PDMats = "0.11.26" PSIS = "0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9" From 2b9c97e4f29d495175690950edf572bb1a9f02d5 Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Fri, 3 Jan 2025 13:05:13 +0100 Subject: [PATCH 04/18] Bump Optimization dependencies for compatibility --- Project.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index a2485f60..c05173f8 100644 --- a/Project.toml +++ b/Project.toml @@ -37,13 +37,13 @@ PathfinderDynamicHMCExt = "DynamicHMC" PathfinderTuringExt = ["Accessors", "DynamicPPL", "MCMCChains", "Turing"] [compat] -ADTypes = "0.2, 1" +ADTypes = "0.2.5, 1" Accessors = "0.1.12" Distributions = "0.25.87" DynamicHMC = "3.4.0" DynamicPPL = "0.25.2, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32" Folds = "0.2.9" -ForwardDiff = "0.10.19" +ForwardDiff = "0.10.26" IrrationalConstants = "0.1.1, 0.2" LinearAlgebra = "1.6" LogDensityProblems = "2.1.0" @@ -57,8 +57,8 @@ PSIS = "0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9" ProgressLogging = "0.1.4" Random = "1.6" Requires = "1.1" -ReverseDiff = "1.4.5" -SciMLBase = "1.95.0, 2" +ReverseDiff = "1.14" +SciMLBase = "2.16.3, 2" Statistics = "1.6" StatsBase = "0.33.7, 0.34" Transducers = "0.4.81" From a4320b3254bbc6f8af9fa24dd30a6314a8acb3ca Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Fri, 3 Jan 2025 13:07:53 +0100 Subject: [PATCH 05/18] Remove workaround for old Optimization versions --- src/optimize.jl | 67 +++++++++++++++--------------------------------- test/optimize.jl | 19 +++++--------- 2 files changed, 28 insertions(+), 58 deletions(-) diff --git a/src/optimize.jl b/src/optimize.jl index 84e6677d..b07da9d6 100644 --- a/src/optimize.jl +++ b/src/optimize.jl @@ -98,54 +98,29 @@ struct OptimizationCallback{X,FX,∇FX,ID,CB} fail_on_nonfinite::Bool end -@static if isdefined(Optimization, :OptimizationState) - # Optimization v3.21.0 and later - function (cb::OptimizationCallback)(state::Optimization.OptimizationState, args...) - @unpack ( - xs, fxs, ∇fxs, progress_name, progress_id, maxiters, callback, fail_on_nonfinite - ) = cb - ret = callback !== nothing && callback(state, args...) - iteration = state.iter - Base.@logmsg ProgressLogging.ProgressLevel progress_name progress = - iteration / maxiters _id = progress_id - - x = copy(state.u) - fx = -state.objective - ∇fx = state.grad === nothing ? nothing : -state.grad - - # some backends mutate x, so we must copy it - push!(xs, x) - push!(fxs, fx) - push!(∇fxs, ∇fx) - - if fail_on_nonfinite && !ret - ret = (isnan(fx) || fx == Inf || (∇fx !== nothing && any(!isfinite, ∇fx)))::Bool - end - - return ret +function (cb::OptimizationCallback)(state::Optimization.OptimizationState, args...) + @unpack ( + xs, fxs, ∇fxs, progress_name, progress_id, maxiters, callback, fail_on_nonfinite + ) = cb + ret = callback !== nothing && callback(state, args...) + iteration = state.iter + Base.@logmsg ProgressLogging.ProgressLevel progress_name progress = iteration / maxiters _id = + progress_id + + x = copy(state.u) + fx = -state.objective + ∇fx = state.grad === nothing ? nothing : -state.grad + + # some backends mutate x, so we must copy it + push!(xs, x) + push!(fxs, fx) + push!(∇fxs, ∇fx) + + if fail_on_nonfinite && !ret + ret = (isnan(fx) || fx == Inf || (∇fx !== nothing && any(!isfinite, ∇fx)))::Bool end -else - # Optimization v3.20.X and earlier - function (cb::OptimizationCallback)(x, nfx, args...) - @unpack ( - xs, fxs, ∇fxs, progress_name, progress_id, maxiters, callback, fail_on_nonfinite - ) = cb - ret = callback !== nothing && callback(x, nfx, args...) - iteration = length(cb.xs) - Base.@logmsg ProgressLogging.ProgressLevel progress_name progress = - iteration / maxiters _id = progress_id - - # some backends mutate x, so we must copy it - push!(xs, copy(x)) - push!(fxs, -nfx) - push!(∇fxs, nothing) - if fail_on_nonfinite && !ret - ret = (isnan(nfx) || nfx == -Inf)::Bool - end - - return ret - end + return ret end struct OptimizationTrace{P,L} diff --git a/test/optimize.jl b/test/optimize.jl index 40a7eb49..9d882781 100644 --- a/test/optimize.jl +++ b/test/optimize.jl @@ -73,18 +73,13 @@ end (isdefined(Optimization, :OptimizationState) && !isfinite(gval)) ) ) - if isdefined(Optimization, :OptimizationState) - # Optimization v3.21.0 and later - callback = (state, args...) -> cbfail - state = Optimization.OptimizationState(; - iter=0, u=x, objective=-fval, grad=-∇f(x) - ) - cb_args = (state, -fval) - else - # Optimization v3.20.X and earlier - callback = (x, fx, args...) -> cbfail - cb_args = (x, -fval) - end + + callback = (state, args...) -> cbfail + state = Optimization.OptimizationState(; + iter=0, u=x, objective=-fval, grad=-∇f(x) + ) + cb_args = (state, -fval) + cb = Pathfinder.OptimizationCallback( xs, fxs, From b2d564e7bf3461a21678e91d32178a89420f54f0 Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Fri, 3 Jan 2025 13:50:36 +0100 Subject: [PATCH 06/18] Add missing compat bound for OptimizationNLopt --- Project.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index c05173f8..897c5f3d 100644 --- a/Project.toml +++ b/Project.toml @@ -51,14 +51,15 @@ LogDensityProblemsAD = "1.7.0" MCMCChains = "6.0.2" Optim = "1.7.2" Optimization = "3.21, 4" +OptimizationNLopt = "0.2, 0.3" OptimizationOptimJL = "0.1.7, 0.2, 0.3, 0.4" PDMats = "0.11.26" PSIS = "0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9" ProgressLogging = "0.1.4" Random = "1.6" Requires = "1.1" -ReverseDiff = "1.14" -SciMLBase = "2.16.3, 2" +ReverseDiff = "1.15" +SciMLBase = "2.30" Statistics = "1.6" StatsBase = "0.33.7, 0.34" Transducers = "0.4.81" From d9f892b818fb936fbc567f8a34433367eee243cb Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Fri, 3 Jan 2025 13:55:41 +0100 Subject: [PATCH 07/18] Drop support for old OptimizationOptimJL version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 897c5f3d..b50604de 100644 --- a/Project.toml +++ b/Project.toml @@ -52,7 +52,7 @@ MCMCChains = "6.0.2" Optim = "1.7.2" Optimization = "3.21, 4" OptimizationNLopt = "0.2, 0.3" -OptimizationOptimJL = "0.1.7, 0.2, 0.3, 0.4" +OptimizationOptimJL = "0.2, 0.3, 0.4" PDMats = "0.11.26" PSIS = "0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9" ProgressLogging = "0.1.4" From 9ef0a88fa02f0dd2626089d7f0e56063b96253d0 Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Fri, 3 Jan 2025 14:10:57 +0100 Subject: [PATCH 08/18] Bump OptimizationOptimJL compat --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index b50604de..7fd61fde 100644 --- a/Project.toml +++ b/Project.toml @@ -52,7 +52,7 @@ MCMCChains = "6.0.2" Optim = "1.7.2" Optimization = "3.21, 4" OptimizationNLopt = "0.2, 0.3" -OptimizationOptimJL = "0.2, 0.3, 0.4" +OptimizationOptimJL = "0.2.1, 0.3, 0.4" PDMats = "0.11.26" PSIS = "0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9" ProgressLogging = "0.1.4" From c32c83db29e6fa2d5effa856613df64cfffdde33 Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Fri, 3 Jan 2025 14:17:25 +0100 Subject: [PATCH 09/18] Match package bounds --- test/integration/AdvancedHMC/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/AdvancedHMC/Project.toml b/test/integration/AdvancedHMC/Project.toml index d90ca4f6..c0de5cd7 100644 --- a/test/integration/AdvancedHMC/Project.toml +++ b/test/integration/AdvancedHMC/Project.toml @@ -18,7 +18,7 @@ TransformedLogDensities = "f9bc47f6-f3f8-4f3b-ab21-f8bc73906f26" [compat] AdvancedHMC = "0.6" Distributions = "0.25.87" -ForwardDiff = "0.10.19" +ForwardDiff = "0.10.26" LogDensityProblems = "2.1.0" LogDensityProblemsAD = "1.7" MCMCDiagnosticTools = "0.3" From 2e453b14cd9ffb03e974e4b39491206972fe19c9 Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Fri, 3 Jan 2025 14:19:21 +0100 Subject: [PATCH 10/18] Match package bounds in docs compat --- docs/Project.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Project.toml b/docs/Project.toml index 194eb4de..1175c472 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -19,17 +19,17 @@ TransformedLogDensities = "f9bc47f6-f3f8-4f3b-ab21-f8bc73906f26" Turing = "fce5fe82-541a-59a6-adf8-730c64b5f9a0" [compat] -ADTypes = "0.2, 1" +ADTypes = "0.2.5, 1" AdvancedHMC = "0.6" Documenter = "1" DocumenterCitations = "1.2" DocumenterInterLinks = "1" DynamicHMC = "3.4.0" -ForwardDiff = "0.10.19" +ForwardDiff = "0.10.26" LogDensityProblems = "2.1.0" LogDensityProblemsAD = "1.7" Pathfinder = "0.9" -ReverseDiff = "1.4.5" +ReverseDiff = "1.15" StatsFuns = "1" StatsPlots = "0.14.21, 0.15" TransformVariables = "0.6.2, 0.7, 0.8" From 2c289d1c547138830c2bb008ce96beac9220d69a Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Fri, 3 Jan 2025 14:47:45 +0100 Subject: [PATCH 11/18] Bump StatsPlots compat --- docs/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Project.toml b/docs/Project.toml index 1175c472..bd371380 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -31,7 +31,7 @@ LogDensityProblemsAD = "1.7" Pathfinder = "0.9" ReverseDiff = "1.15" StatsFuns = "1" -StatsPlots = "0.14.21, 0.15" +StatsPlots = "0.15.2" TransformVariables = "0.6.2, 0.7, 0.8" TransformedLogDensities = "1.0.2" Turing = "0.31.4, 0.32, 0.33, 0.34, 0.35" From af1fc70887a4d93b4d5c25444ddffb8a65378950 Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Fri, 3 Jan 2025 14:50:30 +0100 Subject: [PATCH 12/18] Change stdlib compats to 1 --- Project.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index 7fd61fde..13ddc9e3 100644 --- a/Project.toml +++ b/Project.toml @@ -45,7 +45,7 @@ DynamicPPL = "0.25.2, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32" Folds = "0.2.9" ForwardDiff = "0.10.26" IrrationalConstants = "0.1.1, 0.2" -LinearAlgebra = "1.6" +LinearAlgebra = "1" LogDensityProblems = "2.1.0" LogDensityProblemsAD = "1.7.0" MCMCChains = "6.0.2" @@ -56,11 +56,11 @@ OptimizationOptimJL = "0.2.1, 0.3, 0.4" PDMats = "0.11.26" PSIS = "0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9" ProgressLogging = "0.1.4" -Random = "1.6" +Random = "1" Requires = "1.1" ReverseDiff = "1.15" SciMLBase = "2.30" -Statistics = "1.6" +Statistics = "1" StatsBase = "0.33.7, 0.34" Transducers = "0.4.81" Turing = "0.31.4, 0.32, 0.33, 0.34, 0.35" From 1564583f6db6238b159b19fbb1f97463513e326e Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Fri, 3 Jan 2025 14:50:41 +0100 Subject: [PATCH 13/18] Bump integration test julia bounds --- test/integration/AdvancedHMC/Project.toml | 2 +- test/integration/DynamicHMC/Project.toml | 2 +- test/integration/Turing/Project.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/integration/AdvancedHMC/Project.toml b/test/integration/AdvancedHMC/Project.toml index c0de5cd7..0665164d 100644 --- a/test/integration/AdvancedHMC/Project.toml +++ b/test/integration/AdvancedHMC/Project.toml @@ -28,4 +28,4 @@ Statistics = "1" StatsFuns = "1" TransformVariables = "0.6.2, 0.7, 0.8" TransformedLogDensities = "1.0.2" -julia = "1.6" +julia = "1.10" diff --git a/test/integration/DynamicHMC/Project.toml b/test/integration/DynamicHMC/Project.toml index bb77e6c2..adac8366 100644 --- a/test/integration/DynamicHMC/Project.toml +++ b/test/integration/DynamicHMC/Project.toml @@ -24,4 +24,4 @@ Statistics = "1" StatsFuns = "1" TransformVariables = "0.6.2, 0.7, 0.8" TransformedLogDensities = "1.0.2" -julia = "1.6" +julia = "1.10" diff --git a/test/integration/Turing/Project.toml b/test/integration/Turing/Project.toml index 1938c556..2c8158cd 100644 --- a/test/integration/Turing/Project.toml +++ b/test/integration/Turing/Project.toml @@ -10,4 +10,4 @@ Turing = "fce5fe82-541a-59a6-adf8-730c64b5f9a0" LogDensityProblems = "2.1.0" Pathfinder = "0.9" Turing = "0.31.4, 0.32, 0.33, 0.34, 0.35" -julia = "1.6" +julia = "1.10" From 2c13db94fbe8bf3dcc376767c194f20d45e4fee6 Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Fri, 3 Jan 2025 14:55:32 +0100 Subject: [PATCH 14/18] Fix deprecation warning --- src/woodbury.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/woodbury.jl b/src/woodbury.jl index 3da91cde..4579ce7d 100644 --- a/src/woodbury.jl +++ b/src/woodbury.jl @@ -292,7 +292,7 @@ function Base.AbstractMatrix{T}(W::WoodburyPDMat) where {T} F = pdfactorize(W) Fnew = WoodburyPDFactorization( convert(AbstractMatrix{T}, F.U), - convert(AbstractMatrix{T}, F.Q), + convert(LinearAlgebra.AbstractQ{T}, F.Q), convert(AbstractMatrix{T}, F.V), ) return WoodburyPDMat( From 1f3a5299c0d63c9177923e6bffc26a9f2b7a8f42 Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Fri, 3 Jan 2025 15:02:02 +0100 Subject: [PATCH 15/18] Remove Unpack as dependency --- Project.toml | 2 -- src/Pathfinder.jl | 1 - src/optimize.jl | 5 ++--- src/singlepath.jl | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Project.toml b/Project.toml index 13ddc9e3..2248f811 100644 --- a/Project.toml +++ b/Project.toml @@ -23,7 +23,6 @@ SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" Transducers = "28d57a85-8fef-5791-bfe6-a80928e7c999" -UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" [weakdeps] Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" @@ -64,7 +63,6 @@ Statistics = "1" StatsBase = "0.33.7, 0.34" Transducers = "0.4.81" Turing = "0.31.4, 0.32, 0.33, 0.34, 0.35" -UnPack = "1" julia = "1.10" [extras] diff --git a/src/Pathfinder.jl b/src/Pathfinder.jl index 5ba23927..5f3cf5dd 100644 --- a/src/Pathfinder.jl +++ b/src/Pathfinder.jl @@ -19,7 +19,6 @@ using SciMLBase: SciMLBase using Statistics: Statistics using StatsBase: StatsBase using Transducers: Transducers -using UnPack: @unpack export PathfinderResult, MultiPathfinderResult export pathfinder, multipathfinder diff --git a/src/optimize.jl b/src/optimize.jl index b07da9d6..5fce392d 100644 --- a/src/optimize.jl +++ b/src/optimize.jl @@ -99,9 +99,8 @@ struct OptimizationCallback{X,FX,∇FX,ID,CB} end function (cb::OptimizationCallback)(state::Optimization.OptimizationState, args...) - @unpack ( - xs, fxs, ∇fxs, progress_name, progress_id, maxiters, callback, fail_on_nonfinite - ) = cb + (; xs, fxs, ∇fxs, progress_name, progress_id, maxiters, callback, fail_on_nonfinite) = + cb ret = callback !== nothing && callback(state, args...) iteration = state.iter Base.@logmsg ProgressLogging.ProgressLevel progress_name progress = iteration / maxiters _id = diff --git a/src/singlepath.jl b/src/singlepath.jl index a8bb7f27..58944c84 100644 --- a/src/singlepath.jl +++ b/src/singlepath.jl @@ -202,7 +202,7 @@ function pathfinder( kwargs..., ) end - @unpack ( + (; itry, success, optim_prob, From cbc7c5ef8bef4a74430c4df7e14179bae2357f0b Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Fri, 3 Jan 2025 15:08:22 +0100 Subject: [PATCH 16/18] Bump StatsBase compat To bring in bugfix in `histrange` --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 2248f811..dd03b63a 100644 --- a/Project.toml +++ b/Project.toml @@ -60,7 +60,7 @@ Requires = "1.1" ReverseDiff = "1.15" SciMLBase = "2.30" Statistics = "1" -StatsBase = "0.33.7, 0.34" +StatsBase = "0.33.17, 0.34" Transducers = "0.4.81" Turing = "0.31.4, 0.32, 0.33, 0.34, 0.35" julia = "1.10" From bc988b3e7f8966ed24d0fbab47bd3b9aa88ecd8e Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Fri, 3 Jan 2025 15:13:28 +0100 Subject: [PATCH 17/18] Remove unnecessary version checks --- test/elbo.jl | 6 +----- test/multipath.jl | 6 +----- test/singlepath.jl | 12 ++---------- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/test/elbo.jl b/test/elbo.jl index 0d24e210..4faf2f7f 100644 --- a/test/elbo.jl +++ b/test/elbo.jl @@ -34,11 +34,7 @@ using Transducers logp(x) = logpdf(target_dist, x[1]) σs = [1e-3, 0.05, σ_target, 1.0, 1.1, 1.2, 5.0, 10.0] dists = Normal.(0, σs) - if VERSION ≥ v"1.7.0" - executors = [SequentialEx(), ThreadedEx()] - else - executors = [SequentialEx()] - end + executors = [SequentialEx(), ThreadedEx()] @testset "$executor" for executor in executors rng = Random.seed!(Random.default_rng(), 42) lopt, estimates = @inferred Pathfinder.maximize_elbo( diff --git a/test/multipath.jl b/test/multipath.jl index 42ab3c93..7088be77 100644 --- a/test/multipath.jl +++ b/test/multipath.jl @@ -22,11 +22,7 @@ using Transducers d = MvNormal(μ, Σ) logp(x) = logpdf(d, x) ℓ = build_logdensityproblem(logp, dim, 2) - rngs = if VERSION ≥ v"1.7" - [MersenneTwister(), Random.default_rng()] - else - [MersenneTwister()] - end + rngs = [MersenneTwister(), Random.default_rng()] seed = 76 @testset for rng in rngs executor = rng isa MersenneTwister ? SequentialEx() : ThreadedEx() diff --git a/test/singlepath.jl b/test/singlepath.jl index 0e21ec69..aa03fcea 100644 --- a/test/singlepath.jl +++ b/test/singlepath.jl @@ -16,11 +16,7 @@ using Transducers # here pathfinder finds the exact solution after 1 iteration logp(x) = -sum(abs2, x) / 2 ndraws = 100 - rngs = if VERSION ≥ v"1.7" - [MersenneTwister(), Random.default_rng()] - else - [MersenneTwister()] - end + rngs = [MersenneTwister(), Random.default_rng()] seed = 42 @testset for dim in [1, 5, 10, 100], rng in rngs executor = rng isa MersenneTwister ? SequentialEx() : ThreadedEx() @@ -83,11 +79,7 @@ using Transducers dim = 5 ℓ = build_logdensityproblem(logp, dim, 2) ndraws_elbo = 100 - rngs = if VERSION ≥ v"1.7" - [MersenneTwister(), Random.default_rng()] - else - [MersenneTwister()] - end + rngs = [MersenneTwister(), Random.default_rng()] x = randn(dim) seed = 38 optimizer = Optim.LBFGS(; m=6) From fb18d4827d9e5df109c63620f2825491997e412b Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Fri, 3 Jan 2025 15:15:03 +0100 Subject: [PATCH 18/18] Increment patch number --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index dd03b63a..7d36694b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Pathfinder" uuid = "b1d3bc72-d0e7-4279-b92f-7fa5d6d2d454" authors = ["Seth Axen and contributors"] -version = "0.9.8" +version = "0.9.9" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"