Skip to content

Commit af812b8

Browse files
authored
Add Aqua to tests (#2257)
* Add running Aqua to test suite * Remove undefined imports * Add compat entries for stdlib dependencies See https://discourse.julialang.org/t/psa-compat-requirements-in-the-general-registry-are-changing/104958 for why this is necessary * Disable Aqua checking method ambiguities
1 parent f6d1712 commit af812b8

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,16 @@ Compat = "4.15.0"
6868
EllipticalSliceSampling = "0.5, 1, 2"
6969
ForwardDiff = "0.10.3"
7070
Libtask = "0.7, 0.8"
71+
LinearAlgebra = "1"
7172
LogDensityProblems = "2"
7273
LogDensityProblemsAD = "1.7.0"
7374
MCMCChains = "5, 6"
7475
NamedArrays = "0.9, 0.10"
7576
Optimization = "3"
7677
OptimizationOptimJL = "0.1, 0.2, 0.3"
7778
OrderedCollections = "1"
79+
Printf = "1"
80+
Random = "1"
7881
Optim = "1"
7982
Reexport = "0.2, 1"
8083
Requires = "0.5, 1.0"

src/Turing.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ export @model, # modelling
9292
SGHMC,
9393
HMCDA,
9494
NUTS,
95-
DynamicNUTS,
96-
ANUTS,
9795
PolynomialStepsize,
9896
IS, # particle-based sampling
9997
SMC,
@@ -121,7 +119,6 @@ export @model, # modelling
121119
NamedDist, # Exports from DynamicPPL
122120
predict,
123121
pointwise_loglikelihoods,
124-
elementwise_loglikelihoods,
125122
generated_quantities,
126123
logprior,
127124
logjoint,

src/essential/Essential.jl

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,10 @@ include("container.jl")
1919

2020
export @model,
2121
@varname,
22-
generate_observe,
23-
translate_tilde!,
24-
get_vars,
25-
get_data,
26-
get_default_values,
27-
ParticleContainer,
28-
Particle,
29-
Trace,
30-
fork,
31-
forkr,
32-
current_trace,
33-
getweights,
34-
getweight,
35-
effectiveSampleSize,
36-
sweep!,
37-
ResampleWithESSThreshold,
3822
AutoForwardDiff,
3923
AutoTracker,
4024
AutoZygote,
4125
AutoReverseDiff,
42-
value,
4326
@logprob_str,
4427
@prob_str
4528

src/mcmc/Inference.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import StatsBase: predict
3838

3939
export InferenceAlgorithm,
4040
Hamiltonian,
41-
GibbsComponent,
4241
StaticHamiltonian,
4342
AdaptiveHamiltonian,
4443
SampleFromUniform,
@@ -54,7 +53,6 @@ export InferenceAlgorithm,
5453
SGHMC,
5554
HMCDA,
5655
NUTS, # Hamiltonian-like sampling
57-
DynamicNUTS,
5856
IS,
5957
SMC,
6058
CSMC,

test/Aqua.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module AquaTests
2+
3+
using Aqua: Aqua
4+
using Turing
5+
6+
# TODO(mhauru) We skip testing for method ambiguities because it catches a lot of problems
7+
# in dependencies. Would like to check it for just Turing.jl itself though.
8+
Aqua.test_all(Turing; ambiguities=false)
9+
10+
end

test/Project.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
33
AdvancedMH = "5b7e9947-ddc0-4b3f-9b55-0d8042f74170"
44
AdvancedPS = "576499cb-2369-40b2-a588-c64705576edc"
55
AdvancedVI = "b5ca4192-6429-45e5-a2d9-87aec30a685c"
6+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
67
Clustering = "aaaa29a8-35af-508c-8bc3-b662a17a0fe5"
78
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
89
DistributionsAD = "ced4e74d-a319-5a8a-b0ac-84af2272839c"
@@ -39,6 +40,7 @@ AbstractMCMC = "5"
3940
AdvancedMH = "0.6, 0.7, 0.8"
4041
AdvancedPS = "0.6.0"
4142
AdvancedVI = "0.2"
43+
Aqua = "0.8"
4244
Clustering = "0.14, 0.15"
4345
Distributions = "0.25"
4446
DistributionsAD = "0.6.3"
@@ -47,6 +49,7 @@ DynamicPPL = "0.27"
4749
FiniteDifferences = "0.10.8, 0.11, 0.12"
4850
ForwardDiff = "0.10.12 - 0.10.32, 0.10"
4951
HypothesisTests = "0.11"
52+
LinearAlgebra = "1"
5053
LogDensityProblems = "2"
5154
LogDensityProblemsAD = "1.4"
5255
MCMCChains = "5, 6"
@@ -57,6 +60,8 @@ OptimizationBBO = "0.1, 0.2"
5760
OptimizationNLopt = "0.1, 0.2"
5861
OptimizationOptimJL = "0.1, 0.2, 0.3"
5962
PDMats = "0.10, 0.11"
63+
Pkg = "1"
64+
Random = "1"
6065
ReverseDiff = "1.4.2"
6166
SpecialFunctions = "0.10.3, 1, 2"
6267
StableRNGs = "1"

test/runtests.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ macro timeit_include(path::AbstractString)
2626
end
2727

2828
@testset "Turing" begin
29+
@testset "Aqua" begin
30+
@timeit_include("Aqua.jl")
31+
end
32+
2933
@testset "essential" begin
3034
@timeit_include("essential/ad.jl")
3135
@timeit_include("essential/container.jl")

0 commit comments

Comments
 (0)