From 02138fd77ab0e819df4fac7adfbf6fb95c34499f Mon Sep 17 00:00:00 2001 From: Bagaev Dmitry Date: Tue, 15 Oct 2024 09:53:36 +0200 Subject: [PATCH 1/5] fix tests --- test/ext/ReactiveMPProjectionExt/rules/out_tests.jl | 2 +- test/nodes/nodes_tests.jl | 4 +++- test/rules/continuous_transition/x_tests.jl | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/test/ext/ReactiveMPProjectionExt/rules/out_tests.jl b/test/ext/ReactiveMPProjectionExt/rules/out_tests.jl index 041ba2901..d4428db38 100644 --- a/test/ext/ReactiveMPProjectionExt/rules/out_tests.jl +++ b/test/ext/ReactiveMPProjectionExt/rules/out_tests.jl @@ -6,7 +6,7 @@ q_ins_m_out_incomings = [ (FactorizedJoint((NormalMeanVariance(2, 2),)), NormalMeanVariance(0, 1)), - (FactorizedJoint((Gamma(3, 4),)), Gamma(2, 3)), + (FactorizedJoint((Gamma(2, 1),)), Gamma(2, 2)), (FactorizedJoint((Beta(5, 4),)), Beta(5, 5)), (FactorizedJoint((Rayleigh(4),)), Rayleigh(5.2)), (FactorizedJoint((Geometric(0.3),)), Geometric(0.9)), diff --git a/test/nodes/nodes_tests.jl b/test/nodes/nodes_tests.jl index 33658372c..37d3fae52 100644 --- a/test/nodes/nodes_tests.jl +++ b/test/nodes/nodes_tests.jl @@ -151,8 +151,10 @@ end @node DummyNodeForDocumentationDeterministic Deterministic [out, (x, aliases = [xx, xxx]), y] - documentation = string(Base.doc(Base.Docs.Binding(ReactiveMP, :is_predefined_node))) + binding = @doc(ReactiveMP.is_predefined_node) + @test !isnothing(binding) + documentation = string(binding) @test occursin(r"DummyNodeForDocumentationStochastic.*Stochastic.*out, x, y \(or yy\)", documentation) @test occursin(r"DummyNodeForDocumentationDeterministic.*Deterministic.*out, x \(or xx, xxx\), y", documentation) end diff --git a/test/rules/continuous_transition/x_tests.jl b/test/rules/continuous_transition/x_tests.jl index 83ad2352f..58e28b2a1 100644 --- a/test/rules/continuous_transition/x_tests.jl +++ b/test/rules/continuous_transition/x_tests.jl @@ -28,13 +28,13 @@ metal = CTMeta(transformation) Ly = rand(rng, dy, dy) - μy, Σy = rand(rng, dy), Ly * Ly' + μy, Σy = rand(rng, dy), Ly * Ly' + dydx * I qy = MvNormalMeanCovariance(μy, Σy) qa = MvNormalMeanCovariance(vec(mA), diageye(dydx)) qW = Wishart(dy + 1, diageye(dy)) - @test_rules [check_type_promotion = true, atol = 1e-4] ContinuousTransition(:x, Marginalisation) [( + @test_rules [check_type_promotion = true, atol = 1e-6] ContinuousTransition(:x, Marginalisation) [( input = (m_y = qy, q_a = qa, q_W = qW, meta = metal), output = benchmark_rule_strucutred(qy, qW, mA, ΣA, UA) )] end @@ -79,13 +79,13 @@ metal = CTMeta(transformation) Ly = rand(rng, dy, dy) - μy, Σy = rand(rng, dy), Ly * Ly' + μy, Σy = rand(rng, dy), Ly * Ly' + dydx * I qy = MvNormalMeanCovariance(μy, Σy) qa = MvNormalMeanCovariance(vec(mA), diageye(dydx)) qW = Wishart(dy + 1, diageye(dy)) - @test_rules [check_type_promotion = true, atol = 1e-4] ContinuousTransition(:x, Marginalisation) [( + @test_rules [check_type_promotion = true, atol = 1e-6] ContinuousTransition(:x, Marginalisation) [( input = (q_y = qy, q_a = qa, q_W = qW, meta = metal), output = benchmark_rule_meanfield(qy, qW, mA, ΣA, UA) )] end From 2d41b2db3b3117240c7ca616c1225dcdd751cec2 Mon Sep 17 00:00:00 2001 From: Bagaev Dmitry Date: Tue, 15 Oct 2024 10:18:10 +0200 Subject: [PATCH 2/5] CI has less accuracy? --- test/rules/continuous_transition/x_tests.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/rules/continuous_transition/x_tests.jl b/test/rules/continuous_transition/x_tests.jl index 58e28b2a1..29ac653da 100644 --- a/test/rules/continuous_transition/x_tests.jl +++ b/test/rules/continuous_transition/x_tests.jl @@ -34,7 +34,7 @@ qa = MvNormalMeanCovariance(vec(mA), diageye(dydx)) qW = Wishart(dy + 1, diageye(dy)) - @test_rules [check_type_promotion = true, atol = 1e-6] ContinuousTransition(:x, Marginalisation) [( + @test_rules [check_type_promotion = true, atol = 1e-4] ContinuousTransition(:x, Marginalisation) [( input = (m_y = qy, q_a = qa, q_W = qW, meta = metal), output = benchmark_rule_strucutred(qy, qW, mA, ΣA, UA) )] end @@ -85,7 +85,7 @@ qa = MvNormalMeanCovariance(vec(mA), diageye(dydx)) qW = Wishart(dy + 1, diageye(dy)) - @test_rules [check_type_promotion = true, atol = 1e-6] ContinuousTransition(:x, Marginalisation) [( + @test_rules [check_type_promotion = true, atol = 1e-4] ContinuousTransition(:x, Marginalisation) [( input = (q_y = qy, q_a = qa, q_W = qW, meta = metal), output = benchmark_rule_meanfield(qy, qW, mA, ΣA, UA) )] end From 4995b72c10798ed9a543788ca665f1e4d15d43da Mon Sep 17 00:00:00 2001 From: Bagaev Dmitry Date: Tue, 15 Oct 2024 10:35:40 +0200 Subject: [PATCH 3/5] attempt to fix last test --- Project.toml | 4 +++- test/nodes/nodes_tests.jl | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 433708b7c..c74e8f165 100644 --- a/Project.toml +++ b/Project.toml @@ -66,6 +66,7 @@ MatrixCorrectionTools = "1.2.0" Optim = "1.0.0" Optimisers = "0.2, 0.3" PositiveFactorizations = "0.2" +REPL = "1.11.0" Random = "1.9" Requires = "1" Rocket = "1.8.0" @@ -95,9 +96,10 @@ Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" PkgBenchmark = "32113eaa-f34f-5b0d-bd6c-c81e245fc73d" ReTestItems = "817f1d60-ba6b-4fd5-9520-3cf149f6a823" +REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" TestSetExtensions = "98d24dd4-01ad-11ea-1b02-c9a08f80db04" [targets] -test = ["Aqua", "CpuId", "ReTestItems", "Test", "Pkg", "Logging", "InteractiveUtils", "TestSetExtensions", "Coverage", "Dates", "Distributed", "Documenter", "BenchmarkCI", "BenchmarkTools", "PkgBenchmark", "StableRNGs", "Optimisers", "DiffResults", "ExponentialFamilyProjection"] +test = ["Aqua", "CpuId", "ReTestItems", "Test", "Pkg", "Logging", "InteractiveUtils", "TestSetExtensions", "Coverage", "Dates", "Distributed", "Documenter", "BenchmarkCI", "BenchmarkTools", "PkgBenchmark", "StableRNGs", "Optimisers", "DiffResults", "ExponentialFamilyProjection", "REPL"] diff --git a/test/nodes/nodes_tests.jl b/test/nodes/nodes_tests.jl index 37d3fae52..25a28aacd 100644 --- a/test/nodes/nodes_tests.jl +++ b/test/nodes/nodes_tests.jl @@ -144,6 +144,8 @@ end end @testitem "@node macro should generate a documentation entry for a newly specified node" begin + using REPL # `REPL` changes the docstring output format + struct DummyNodeForDocumentationStochastic end struct DummyNodeForDocumentationDeterministic end From 0c9230b69a6d3fd9facce5586452494fc3e9b0e2 Mon Sep 17 00:00:00 2001 From: Bagaev Dmitry Date: Tue, 15 Oct 2024 10:36:10 +0200 Subject: [PATCH 4/5] 2prev --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index beaf75718..c88aee1d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@v1 with: - version: '1.10' + version: '1.11' - run: make lint test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} From 674fecac20c4ac04cd1d55f8fad16cf41c3121ab Mon Sep 17 00:00:00 2001 From: Bagaev Dmitry Date: Tue, 15 Oct 2024 10:37:40 +0200 Subject: [PATCH 5/5] 2prev --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c88aee1d3..c83187683 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,8 +18,6 @@ jobs: steps: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@v1 - with: - version: '1.11' - run: make lint test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} @@ -33,7 +31,7 @@ jobs: fail-fast: false matrix: version: - - '1.10' + - '1.11' os: - ubuntu-latest arch: