Skip to content

Commit

Permalink
Add support for Pigeons.sample_iid!
Browse files Browse the repository at this point in the history
  • Loading branch information
sefffal committed Feb 2, 2024
1 parent a9e79fe commit 7a42345
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 0 additions & 6 deletions docs/src/pma.md
Expand Up @@ -211,12 +211,6 @@ pairplot(
PairPlots.MarginConfidenceLimits()
),
labels=Dict(:mass=>"mass [Mⱼᵤₚ]", :a=>"sma. [au]"),
axis = (;
a = (;
scale=Makie.pseudolog10,
ticks=2 .^ (0:1:6)
)
)
)
```

Expand Down
9 changes: 9 additions & 0 deletions ext/OctofitterPigeonsExt.jl
Expand Up @@ -13,6 +13,15 @@ function Pigeons.initialization(model::Octofitter.LogDensityModel, rng::Abstract
return initial_θ_t
end

# Valid for reference model only
function Pigeons.sample_iid!(model_reference::Octofitter.LogDensityModel, replica, shared)
# This could in theory be done without any array allocations
θ = sample_priors(replica.rng, model_reference.system)
θ_t = model_reference.link(θ)
replica.state .= θ_t
end



"""
octofit_pigeons(model; nrounds, n_chains=[auto])
Expand Down

2 comments on commit 7a42345

@sefffal
Copy link
Owner Author

@sefffal sefffal commented on 7a42345 Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/100158

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v2.1.0 -m "<description of version>" 7a42345a226b73bcdc3935402c3644be1d838f44
git push origin v2.1.0

Please sign in to comment.