From 37b469735afa7cd6f1e6ce16d52365cd6155c4f4 Mon Sep 17 00:00:00 2001 From: willtebbutt Date: Thu, 22 Jul 2021 09:48:49 +0100 Subject: [PATCH] Sort out test and docs deps (#205) * Tidy up test deps * Tidy up docs deps * Bump Documenter dep * Typo --- docs/Project.toml | 4 +-- docs/make.jl | 5 ++-- test/Project.toml | 7 ++--- test/abstract_gp.jl | 3 -- test/composite/cross.jl | 2 -- test/composite/test_util.jl | 2 -- test/gp/gp.jl | 2 -- test/runtests.jl | 44 +++++++++++++++++++++++++----- test/test_util.jl | 3 -- test/util/abstract_data_set.jl | 2 -- test/util/block_arrays/diagonal.jl | 2 -- test/util/covariance_matrices.jl | 2 -- 12 files changed, 44 insertions(+), 34 deletions(-) diff --git a/docs/Project.toml b/docs/Project.toml index d10ff68f..268f8036 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,8 +1,8 @@ [deps] -AbstractGPs = "99985d1d-32ba-4be9-9821-2ec096f28918" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Stheno = "8188c328-b5d6-583d-959b-9690869a5511" [compat] -Documenter = "0.26" +Documenter = "0.27" julia = "1.6" diff --git a/docs/make.jl b/docs/make.jl index a9ca3bf4..a5f107f6 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -61,13 +61,14 @@ isempty(processes) || success(processes) || error("some examples were not run su ### Build documentation - +using Pkg +Pkg.develop(path=joinpath(@__DIR__, "..")) using Documenter, Stheno DocMeta.setdocmeta!( Stheno, :DocTestSetup, - :(using AbstractGPs, Stheno, Random, LinearAlgebra); + :(using Stheno.AbstractGPs, Stheno, Random, LinearAlgebra); recursive=true, ) diff --git a/test/Project.toml b/test/Project.toml index c2944a64..994adfae 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,19 +1,16 @@ [deps] -AbstractGPs = "99985d1d-32ba-4be9-9821-2ec096f28918" -BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e" -Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000" Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c" -KernelFunctions = "ec8451be-7e33-11e9-00cf-bbf324bd1392" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +Stheno = "8188c328-b5d6-583d-959b-9690869a5511" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f" -Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" [compat] Documenter = "0.25, 0.26, 0.27" FiniteDifferences = "0.12" +Flux = "0.12" TimerOutputs = "0.5" diff --git a/test/abstract_gp.jl b/test/abstract_gp.jl index 3338af4c..c1c8a1bf 100644 --- a/test/abstract_gp.jl +++ b/test/abstract_gp.jl @@ -1,6 +1,3 @@ -using Stheno: FiniteGP, block_diagonal -using Distributions: MvNormal - _rng() = MersenneTwister(123456) function generate_noise_matrix(rng::AbstractRNG, N::Int) diff --git a/test/composite/cross.jl b/test/composite/cross.jl index d68c9ddd..d43e2594 100644 --- a/test/composite/cross.jl +++ b/test/composite/cross.jl @@ -1,5 +1,3 @@ -using Stheno: BlockData, cross - @timedtestset "cross" begin @timedtestset "Correctness tests" begin rng, P, Q, gpc = MersenneTwister(123456), 2, 3, GPC() diff --git a/test/composite/test_util.jl b/test/composite/test_util.jl index f1c99092..49ed17be 100644 --- a/test/composite/test_util.jl +++ b/test/composite/test_util.jl @@ -1,5 +1,3 @@ -using Stheno: FiniteGP - """ check_consistency(rng::AbstractRNG, θ, f, x::AV, y::AV, A, z::AV) diff --git a/test/gp/gp.jl b/test/gp/gp.jl index f13209eb..ec86a9dd 100644 --- a/test/gp/gp.jl +++ b/test/gp/gp.jl @@ -1,5 +1,3 @@ -using Stheno: GPC - @timedtestset "gp" begin # Ensure that basic functionality works as expected. diff --git a/test/runtests.jl b/test/runtests.jl index c85983cb..e4442894 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,17 +1,47 @@ -using AbstractGPs -using BlockArrays +using Stheno + +# Dependencies that are also used in Stheno that are not in the standard library. +# This is a hack to prevent CompatHelper from trying to maintain a version number for these +# packages in both Stheno and test. +using Stheno.AbstractGPs +using Stheno.BlockArrays +using Stheno.KernelFunctions +using Stheno.Zygote + +# Dependencies that are test-specific. using Documenter using FiniteDifferences using LinearAlgebra -using KernelFunctions using Random using Statistics -using Stheno using Test using TimerOutputs -using Zygote -using Stheno: mean, cov, var, GPC, AV +using Stheno: + mean, + cov, + var, + GPC, + AV, + FiniteGP, + block_diagonal, + AbstractGP, + BlockData, + blocks, + cross, + ColVecs, + Xt_invA_Y, + Xt_invA_X, + diag_At_A, + diag_At_B, + diag_Xt_invA_X, + diag_Xt_invA_Y, + block_diagonal, + BlockDiagonal, + blocksizes + +using Stheno.AbstractGPs.Distributions: MvNormal +using FiniteDifferences: j′vp const to = TimerOutput() @@ -65,7 +95,7 @@ include("test_util.jl") DocMeta.setdocmeta!( Stheno, :DocTestSetup, - :(using AbstractGPs, Stheno, Random, Documenter, LinearAlgebra); + :(using Stheno.AbstractGPs, Stheno, Random, Documenter, LinearAlgebra); recursive=true, ) doctest(Stheno) diff --git a/test/test_util.jl b/test/test_util.jl index 91032c56..098ad545 100644 --- a/test/test_util.jl +++ b/test/test_util.jl @@ -1,6 +1,3 @@ -using Stheno: AbstractGP, BlockData, blocks -using FiniteDifferences: j′vp - const _rtol = 1e-10 const _atol = 1e-10 diff --git a/test/util/abstract_data_set.jl b/test/util/abstract_data_set.jl index 1a38fc1f..4a9c4894 100644 --- a/test/util/abstract_data_set.jl +++ b/test/util/abstract_data_set.jl @@ -1,5 +1,3 @@ -using Stheno: ColVecs, BlockData - @timedtestset "abstract_data_set" begin rng, N, D = MersenneTwister(123456), 10, 2 x, X = randn(rng, N), randn(rng, D, N) diff --git a/test/util/block_arrays/diagonal.jl b/test/util/block_arrays/diagonal.jl index c620f249..fc67d1ed 100644 --- a/test/util/block_arrays/diagonal.jl +++ b/test/util/block_arrays/diagonal.jl @@ -1,5 +1,3 @@ -using Stheno: block_diagonal, BlockDiagonal, blocksizes - function general_BlockDiagonal_tests(rng, blocks) d = block_diagonal(blocks) Ps, Qs = size.(blocks, 1), size.(blocks, 2) diff --git a/test/util/covariance_matrices.jl b/test/util/covariance_matrices.jl index a2288d5f..a3a4bc0e 100644 --- a/test/util/covariance_matrices.jl +++ b/test/util/covariance_matrices.jl @@ -1,5 +1,3 @@ -using Stheno: Xt_invA_Y, Xt_invA_X, diag_At_A, diag_At_B, diag_Xt_invA_X, diag_Xt_invA_Y - @timedtestset "cholesky" begin # Set up some matrices and factorisations. rng, N, N′, P, Q = MersenneTwister(123456), 5, 3, 6, 2