Skip to content

Commit a715ae7

Browse files
committed
format
1 parent 80f715e commit a715ae7

File tree

8 files changed

+17
-22
lines changed

8 files changed

+17
-22
lines changed

docs/make.jl

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,16 @@ using Documenter
88
using MeasureBase
99

1010
# Doctest setup
11-
DocMeta.setdocmeta!(
12-
MeasureBase,
13-
:DocTestSetup,
14-
:(using MeasureBase);
15-
recursive=true,
16-
)
11+
DocMeta.setdocmeta!(MeasureBase, :DocTestSetup, :(using MeasureBase); recursive = true)
1712

1813
makedocs(
1914
sitename = "MeasureBase",
2015
modules = [MeasureBase],
2116
format = Documenter.HTML(
2217
prettyurls = !("local" in ARGS),
23-
canonical = "https://juliamath.github.io/MeasureBase.jl/stable/"
18+
canonical = "https://juliamath.github.io/MeasureBase.jl/stable/",
2419
),
25-
pages = [
26-
"Home" => "index.md",
27-
"API" => "api.md",
28-
"LICENSE" => "LICENSE.md",
29-
],
20+
pages = ["Home" => "index.md", "API" => "api.md", "LICENSE" => "LICENSE.md"],
3021
doctest = ("fixdoctests" in ARGS) ? :fix : true,
3122
linkcheck = !("nonstrict" in ARGS),
3223
warnonly = ("nonstrict" in ARGS),

src/combinators/conditional.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ condition(μ, constraint) = ConditionalMeasure(μ, constraint)
3737
# end
3838
# end
3939

40-
function Base.:|(
40+
function condition(
4141
μ::ProductMeasure{NamedTuple{M,T}},
4242
constraint::NamedTuple{N},
4343
) where {M,T,N}

src/density-core.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,5 +173,4 @@ end
173173
@inline density_rel(μ, ν, x) = exp(logdensity_rel(μ, ν, x))
174174

175175
# TODO: Do we need this method?
176-
density_def(μ, ν::AbstractMeasure, x) = exp(logdensity_def(μ, ν, x))
177176
density_def(μ, x) = exp(logdensity_def(μ, x))

src/rand.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Base.rand(d::AbstractMeasure) = rand(Random.GLOBAL_RNG, Float64, d)
55
Base.rand(T::Type, μ::AbstractMeasure) = rand(Random.GLOBAL_RNG, T, μ)
66

77
@nospecialize
8-
function Base.rand(rng::AbstractRNG, ::Type{T}, d::M) where {T, M<:AbstractMeasure}
8+
function Base.rand(rng::AbstractRNG, ::Type{T}, d::M) where {T,M<:AbstractMeasure}
99
@error "No method defined for rand(::AbstractRNG, ::Type{T}, $M)"
1010
end
1111
@specialize

src/static.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ Returns the length of `x` as a dynamic or static integer.
4949
"""
5050
maybestatic_length(x) = length(x)
5151
maybestatic_length(x::AbstractUnitRange) = length(x)
52-
function maybestatic_length(::Static.OptionallyStaticUnitRange{<:StaticInteger{A},<:StaticInteger{B}}) where {A,B}
52+
function maybestatic_length(
53+
::Static.OptionallyStaticUnitRange{<:StaticInteger{A},<:StaticInteger{B}},
54+
) where {A,B}
5355
StaticInt{B - A + 1}()
5456
end
5557

src/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,4 @@ StatsBase.entropy(m::AbstractMeasure, b::Real) = entropy(proxy(m), b)
172172
Statistics.mean(m::AbstractMeasure) = mean(proxy(m))
173173
Statistics.std(m::AbstractMeasure) = std(proxy(m))
174174
Statistics.var(m::AbstractMeasure) = var(proxy(m))
175-
Statistics.quantile(m::AbstractMeasure, q) = quantile(proxy(m), q)
175+
Statistics.quantile(m::AbstractMeasure, q) = quantile(proxy(m), q)

test/static.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,21 @@ import FillArrays
1111
@test static(2) isa MeasureBase.IntegerLike
1212
@test true isa MeasureBase.IntegerLike
1313
@test static(true) isa MeasureBase.IntegerLike
14-
14+
1515
@test @inferred(MeasureBase.one_to(7)) isa Base.OneTo
1616
@test @inferred(MeasureBase.one_to(7)) == 1:7
1717
@test @inferred(MeasureBase.one_to(static(7))) isa Static.SOneTo
1818
@test @inferred(MeasureBase.one_to(static(7))) == static(1):static(7)
1919

2020
@test @inferred(MeasureBase.fill_with(4.2, (7,))) == FillArrays.Fill(4.2, 7)
2121
@test @inferred(MeasureBase.fill_with(4.2, (static(7),))) == FillArrays.Fill(4.2, 7)
22-
@test @inferred(MeasureBase.fill_with(4.2, (3, static(7)))) == FillArrays.Fill(4.2, 3, 7)
22+
@test @inferred(MeasureBase.fill_with(4.2, (3, static(7)))) ==
23+
FillArrays.Fill(4.2, 3, 7)
2324
@test @inferred(MeasureBase.fill_with(4.2, (3:7,))) == FillArrays.Fill(4.2, (3:7,))
24-
@test @inferred(MeasureBase.fill_with(4.2, (static(3):static(7),))) == FillArrays.Fill(4.2, (3:7,))
25-
@test @inferred(MeasureBase.fill_with(4.2, (3:7, static(2):static(5)))) == FillArrays.Fill(4.2, (3:7, 2:5))
25+
@test @inferred(MeasureBase.fill_with(4.2, (static(3):static(7),))) ==
26+
FillArrays.Fill(4.2, (3:7,))
27+
@test @inferred(MeasureBase.fill_with(4.2, (3:7, static(2):static(5)))) ==
28+
FillArrays.Fill(4.2, (3:7, 2:5))
2629

2730
@test MeasureBase.maybestatic_length(MeasureBase.one_to(7)) isa Int
2831
@test MeasureBase.maybestatic_length(MeasureBase.one_to(7)) == 7

test/test_docs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ Documenter.DocMeta.setdocmeta!(
88
MeasureBase,
99
:DocTestSetup,
1010
:(using MeasureBase);
11-
recursive=true,
11+
recursive = true,
1212
)
1313
Documenter.doctest(MeasureBase)

0 commit comments

Comments
 (0)