Skip to content

Commit

Permalink
test: add test convert partioned Categorical ef into Distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimrais committed Jul 23, 2024
1 parent 29091e6 commit bf7de35
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ LogExpFunctions = "0.3"
LoopVectorization = "0.12"
PositiveFactorizations = "0.2"
Random = "1.9"
RecursiveArrayTools = "3.26"
SparseArrays = "1.9"
SpecialFunctions = "2"
StaticArrays = "1"
Expand All @@ -56,9 +57,10 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
CpuId = "adafc99b-e345-5852-983c-f28acb93d879"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
ReTestItems = "817f1d60-ba6b-4fd5-9520-3cf149f6a823"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Aqua", "BenchmarkTools", "CpuId", "ReTestItems", "Test", "JET", "StableRNGs"]
test = ["Aqua", "BenchmarkTools", "CpuId", "RecursiveArrayTools", "ReTestItems", "Test", "JET", "StableRNGs"]
8 changes: 8 additions & 0 deletions test/distributions/categorical_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ end
@test !isproper(NaturalParametersSpace(), Categorical, [1], 1) # length should be >=2
end

@testitem "Categorical ExponentialFamilyDistribution supports RecursiveArrayTools" begin
using RecursiveArrayTools
include("distributions_setuptests.jl")
ef = ExponentialFamilyDistribution(Categorical, ArrayPartition([0, 1, 0]), 3, nothing)
part_ef = ExponentialFamilyDistribution(Categorical, ArrayPartition([0, 1], [0]), 3, nothing)
@test convert(Distribution, ef) convert(Distribution, part_ef)
end

@testitem "Categorical: prod with ExponentialFamilyDistribution" begin
include("distributions_setuptests.jl")

Expand Down

0 comments on commit bf7de35

Please sign in to comment.