Skip to content

Commit 948d24a

Browse files
committed
Define API as public on Julia >= 1.11
1 parent 8eb5aae commit 948d24a

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/LogDensityProblems.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,21 @@ using ArgCheck: @argcheck
1616
using DocStringExtensions: SIGNATURES, TYPEDEF
1717
using Random: AbstractRNG, default_rng
1818

19+
# https://github.com/JuliaLang/julia/pull/50105
20+
@static if VERSION >= v"1.11.0-DEV.469"
21+
eval(
22+
Expr(
23+
:public,
24+
:capabilities,
25+
:LogDensityOrder,
26+
:dimension,
27+
:logdensity,
28+
:logdensity_and_gradient,
29+
:logdensity_gradient_and_hessian,
30+
)
31+
)
32+
end
33+
1934
####
2035
#### interface for problems
2136
####

test/runtests.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,18 @@ end
9090
@test 50 length(failures) 100
9191
@test all(x -> all(x .< 0), failures)
9292
end
93+
94+
####
95+
#### public API
96+
####
97+
98+
@testset "public API" begin
99+
if isdefined(Base, :ispublic)
100+
@test Base.ispublic(LogDensityProblems, :capabilities)
101+
@test Base.ispublic(LogDensityProblems, :LogDensityOrder)
102+
@test Base.ispublic(LogDensityProblems, :dimension)
103+
@test Base.ispublic(LogDensityProblems, :logdensity)
104+
@test Base.ispublic(LogDensityProblems, :logdensity_and_gradient)
105+
@test Base.ispublic(LogDensityProblems, :logdensity_gradient_and_hessian)
106+
end
107+
end

0 commit comments

Comments
 (0)