Skip to content

Commit

Permalink
make format
Browse files Browse the repository at this point in the history
  • Loading branch information
bvdmitri committed Oct 4, 2023
1 parent 9521e08 commit ce762b3
Show file tree
Hide file tree
Showing 18 changed files with 50 additions and 51 deletions.
2 changes: 1 addition & 1 deletion test/distributions/dirichlet_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ end
)
end
end
end
end
54 changes: 27 additions & 27 deletions test/distributions/distributions_setuptests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,50 @@ using ExponentialFamily, Distributions, LinearAlgebra, TinyHugeNumbers
using Test, ForwardDiff, Random, StatsFuns, StableRNGs, FillArrays

import ExponentialFamily:
ExponentialFamilyDistribution,
getnaturalparameters,
getconditioner,
compute_logscale,
logpartition,
basemeasure,
ExponentialFamilyDistribution,
getnaturalparameters,
getconditioner,
compute_logscale,
logpartition,
basemeasure,
insupport,
sufficientstatistics,
fisherinformation,
pack_parameters,
unpack_parameters,
sufficientstatistics,
fisherinformation,
pack_parameters,
unpack_parameters,
isbasemeasureconstant,
ConstantBaseMeasure,
MeanToNatural,
NaturalToMean,
NaturalParametersSpace,
default_prod_rule,
fastcholesky,
ConstantBaseMeasure,
MeanToNatural,
NaturalToMean,
NaturalParametersSpace,
default_prod_rule,
fastcholesky,
mirrorlog,
deep_eltype,
sampletype,
samplefloattype,
promote_sampletype,
deep_eltype,
sampletype,
samplefloattype,
promote_sampletype,
promote_samplefloattype,
paramfloattype,
convert_paramfloattype,
paramfloattype,
convert_paramfloattype,
FactorizedJoint,
promote_variate_type,
invscatter,
location,
locationdim

import Distributions:
variate_form,
value_support
import Distributions:
variate_form,
value_support

import SpecialFunctions:
import SpecialFunctions:
logbeta,
loggamma,
digamma,
logfactorial,
besseli

import HCubature:
import HCubature:
hquadrature

import DomainSets:
Expand Down
2 changes: 1 addition & 1 deletion test/distributions/erlang_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ end
)
end
end
end
end
2 changes: 1 addition & 1 deletion test/distributions/gamma_family/gamma_family_setuptests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ function compare_basic_statistics(left, right)
@test mean(xtlog, left) mean(xtlog, right)

return true
end
end
2 changes: 1 addition & 1 deletion test/distributions/gamma_family/gamma_shape_scale_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ end
@test prod(strategy, GammaShapeRate(2, 2), GammaShapeScale(1, 2)) == GammaShapeRate(2, 5 / 2)
@test prod(strategy, GammaShapeRate(2, 2), GammaShapeScale(2, 2)) == GammaShapeRate(3, 5 / 2)
end
end
end
2 changes: 1 addition & 1 deletion test/distributions/gamma_inverse_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ end
)

run_test_fisherinformation_against_hessian(d; assume_no_allocations = false, assume_ours_faster = false)
run_test_fisherinformation_against_jacobian(d; assume_no_allocations = false, assume_ours_faster = false)
run_test_fisherinformation_against_jacobian(d; assume_no_allocations = false)

(α, β) = params(MeanParametersSpace(), d)

Expand Down
2 changes: 1 addition & 1 deletion test/distributions/lognormal_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ end
@test !isproper(NaturalParametersSpace(), LogNormal, [1.0])
@test !isproper(NaturalParametersSpace(), LogNormal, [-1.0, 0.0])
@test !isproper(NaturalParametersSpace(), LogNormal, [1.0, 1.0])
end
end
2 changes: 1 addition & 1 deletion test/distributions/mv_normal_wishart_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ end
)
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ function check_basic_statistics(left::MultivariateNormalDistributionsFamily, rig
@test all(weightedmean_invcov(left) .≈ weightedmean_invcov(right))
@test all(weightedmean_precision(left) .≈ weightedmean_precision(right))
end
end
end
2 changes: 1 addition & 1 deletion test/distributions/normal_family/normal_family_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -334,4 +334,4 @@ end
@test sort(eigvals(fi_dist)) sort(abs.(eigvals(approxFisherInformation))) rtol = 1e-1
@test sort(svd(fi_dist).S) sort(svd(approxFisherInformation).S) rtol = 1e-1
end
end
end
2 changes: 1 addition & 1 deletion test/distributions/vonmises_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ end
)
end
end
end
end
2 changes: 1 addition & 1 deletion test/distributions/weibull_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ end
@test first(hquadrature(x -> pdf(res, tan(x * pi / 2)) * (pi / 2) * (1 / cos(pi * x / 2))^2, 0.0, 1.0))
1.0
end
end
end
2 changes: 1 addition & 1 deletion test/distributions/wishart_inverse_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,4 @@ end
)
end
end
end
end
2 changes: 1 addition & 1 deletion test/distributions/wishart_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ end
)
end
end
end
end
14 changes: 7 additions & 7 deletions test/distributions_setuptests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ using Test, ExponentialFamily, Distributions, StaticArrays, StableRNGs, LinearAl

import Distributions: variate_form, value_support

import ExponentialFamily:
deep_eltype,
sampletype,
samplefloattype,
promote_sampletype,
import ExponentialFamily:
deep_eltype,
sampletype,
samplefloattype,
promote_sampletype,
promote_samplefloattype,
paramfloattype,
convert_paramfloattype,
paramfloattype,
convert_paramfloattype,
FactorizedJoint

function generate_random_distributions(::Type{V} = Any; seed = abs(rand(Int)), Types = (Float32, Float64)) where {V}
Expand Down
2 changes: 1 addition & 1 deletion test/exponential_family_setuptests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ ExponentialFamily.join_conditioner(::Type{ArbitraryConditionedDistributionFromEx
(::MeanToNatural{ArbitraryConditionedDistributionFromExponentialFamily})(params::Tuple, conditioner::Number) = (params[1] + conditioner,)
(::NaturalToMean{ArbitraryConditionedDistributionFromExponentialFamily})(params::Tuple, conditioner::Number) = (params[1] - conditioner,)

ExponentialFamily.unpack_parameters(::Type{ArbitraryConditionedDistributionFromExponentialFamily}, η) = (η[1],)
ExponentialFamily.unpack_parameters(::Type{ArbitraryConditionedDistributionFromExponentialFamily}, η) = (η[1],)
3 changes: 1 addition & 2 deletions test/exponential_family_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ end
@test @inferred(paramfloattype(similar(member, F))) === F
end
end

end

@testitem "vague" begin
Expand All @@ -252,4 +251,4 @@ end

@test @inferred(vague(ExponentialFamilyDistribution{ArbitraryConditionedDistributionFromExponentialFamily})) isa
ExponentialFamilyDistribution{ArbitraryConditionedDistributionFromExponentialFamily}
end
end
2 changes: 1 addition & 1 deletion test/prod_setuptests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ Base.convert(::Type{Int}, ::ObjectWithClosedProd2) = 2

struct ADistributionObject <: ContinuousUnivariateDistribution end

prod(::PreserveTypeProd{Distribution}, ::ADistributionObject, ::ADistributionObject) = ADistributionObject()
prod(::PreserveTypeProd{Distribution}, ::ADistributionObject, ::ADistributionObject) = ADistributionObject()

0 comments on commit ce762b3

Please sign in to comment.