From b235ffb45feb1113b2f2b3e259d8cf425874dfaa Mon Sep 17 00:00:00 2001 From: Nikolas Siccha Date: Thu, 19 Mar 2026 15:12:33 +0100 Subject: [PATCH 1/2] Export rand_momentum as public API (fixes #411) rand_momentum is used by downstream packages (e.g. Pathfinder.jl) that define custom metric types and need to implement their own rand_momentum method. Exporting it avoids dependence on an undocumented internal. --- src/AdvancedHMC.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AdvancedHMC.jl b/src/AdvancedHMC.jl index 5db7644c..b321cadf 100644 --- a/src/AdvancedHMC.jl +++ b/src/AdvancedHMC.jl @@ -40,7 +40,7 @@ struct GaussianKinetic <: AbstractKinetic end export GaussianKinetic include("metric.jl") -export UnitEuclideanMetric, DiagEuclideanMetric, DenseEuclideanMetric +export UnitEuclideanMetric, DiagEuclideanMetric, DenseEuclideanMetric, rand_momentum include("hamiltonian.jl") export Hamiltonian From 2dcdd663a3fc49f83584fff8513450d8069c8971 Mon Sep 17 00:00:00 2001 From: Nikolas Siccha Date: Mon, 23 Mar 2026 09:19:54 +0100 Subject: [PATCH 2/2] Bump version to 0.8.5, add HISTORY.md entry Per review feedback: add changelog entry and version bump for the rand_momentum export. Co-Authored-By: Claude Sonnet 4.6 --- HISTORY.md | 6 ++++++ Project.toml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index a9daf473..74dbe0fc 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,11 @@ # AdvancedHMC Changelog +## 0.8.5 + + - `rand_momentum(rng, metric, kinetic, θ)` is now part of the public API (exported). + Packages that extend AdvancedHMC with custom metric types can implement this method + without depending on an internal symbol. + ## 0.8.4 - Introduces an experimental way to improve the *diagonal* mass matrix adaptation using gradient information (similar to [nutpie](https://github.com/pymc-devs/nutpie)), diff --git a/Project.toml b/Project.toml index f38dda02..86905b6a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "AdvancedHMC" uuid = "0bf59076-c3b1-5ca4-86bd-e02cd72cde3d" -version = "0.8.4" +version = "0.8.5" [deps] AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"