Skip to content

Commit 18ea3f1

Browse files
torfjeldedevmotion
andauthored
Add AbstractModel implementation of LogDensityProblems interface (#110)
* added AbstractModel implementing the interface of LogDensityProblems * version bump and add LogDensityProblems as a dep * Update Project.toml Co-authored-by: David Widmann <[email protected]> * removed forwarding of methods for LogDensityModel * Apply suggestions from code review Co-authored-by: David Widmann <[email protected]> * bump julia compat to 1.6 Co-authored-by: David Widmann <[email protected]>
1 parent 6ef1dcb commit 18ea3f1

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
version:
16-
- '1.3'
16+
- '1.6'
1717
- '1'
1818
- nightly
1919
os:
@@ -31,7 +31,7 @@ jobs:
3131
arch: x86
3232
- os: macOS-latest
3333
arch: x86
34-
- version: '1.3'
34+
- version: '1.6'
3535
num_threads: 2
3636
include:
3737
- version: '1'

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ uuid = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
33
keywords = ["markov chain monte carlo", "probablistic programming"]
44
license = "MIT"
55
desc = "A lightweight interface for common MCMC methods."
6-
version = "4.1.3"
6+
version = "4.2"
77

88
[deps]
99
BangBang = "198e06fe-97b7-11e9-32a5-e1d131e6ad66"
@@ -25,7 +25,7 @@ ProgressLogging = "0.1"
2525
StatsBase = "0.32, 0.33"
2626
TerminalLoggers = "0.1"
2727
Transducers = "0.4.30"
28-
julia = "1.3"
28+
julia = "1.6"
2929

3030
[extras]
3131
Atom = "c52e3926-4ff0-5f6e-af25-54175e0327b1"

src/AbstractMCMC.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,6 @@ include("interface.jl")
8484
include("sample.jl")
8585
include("stepper.jl")
8686
include("transducer.jl")
87+
include("logdensityproblems.jl")
8788

8889
end # module AbstractMCMC

src/logdensityproblems.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""
2+
LogDensityModel <: AbstractMCMC.AbstractModel
3+
4+
Wrapper around something that implements the LogDensityProblem.jl interface.
5+
6+
Note that this does _not_ implement the LogDensityProblems.jl interface itself,
7+
but it simply useful for indicating to the `sample` and other `AbstractMCMC` methods
8+
that the wrapped object implements the LogDensityProblems.jl interface.
9+
10+
# Fields
11+
- `logdensity`: The object that implements the LogDensityProblems.jl interface.
12+
"""
13+
struct LogDensityModel{L} <: AbstractModel
14+
logdensity::L
15+
end

0 commit comments

Comments
 (0)