Skip to content

Commit bb54e3b

Browse files
donmKristofferC
authored andcommitted
Get docstring without @doc to avoid error when compiling (#116)
* Get docstring without @doc to avoid error when compiling Fixes #113. * Add comment with link to upstream @doc issue
1 parent 19fdbfc commit bb54e3b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/metrics.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,13 @@ function eval_end(dist::RenyiDivergence, s::Tuple{T,T,T,T}) where {T <: Real}
332332
end
333333
end
334334

335-
# Combine docs with RenyiDivergence
336-
@doc (@doc RenyiDivergence) renyi_divergence
337-
338335
renyi_divergence(a::AbstractArray, b::AbstractArray, q::Real) = evaluate(RenyiDivergence(q), a, b)
336+
# Combine docs with RenyiDivergence. Fetching the docstring with @doc causes
337+
# problems during package compilation; see
338+
# https://github.com/JuliaLang/julia/issues/31640
339+
let docstring = Base.Docs.getdoc(RenyiDivergence)
340+
@doc docstring renyi_divergence
341+
end
339342

340343
# JSDivergence
341344
@inline function eval_op(::JSDivergence, ai::T, bi::T) where {T}

0 commit comments

Comments
 (0)