diff --git a/pipeline/Project.toml b/pipeline/Project.toml index b796dcac5..7d6178b46 100644 --- a/pipeline/Project.toml +++ b/pipeline/Project.toml @@ -1,4 +1,5 @@ -name = "Analysis pipeline" +name = "AnalysisPipeline" +uuid = "66314692-3678-4cbb-b3ac-6fcb54505317" authors = ["Sam Abbott", "Sam Brand", "Zach Susswein"] [deps] @@ -16,6 +17,7 @@ JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" RCall = "6f49c342-dc21-5d91-9882-a32aef131414" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] CSV = "0.10" diff --git a/pipeline/scripts/run_pipeline.jl b/pipeline/scripts/run_pipeline.jl index c9982e24a..138883939 100644 --- a/pipeline/scripts/run_pipeline.jl +++ b/pipeline/scripts/run_pipeline.jl @@ -11,10 +11,9 @@ using Dagger # Define the backend resources to use for the pipeline # in this case we are using distributed local workers with loaded modules using Distributed -pids = addprocs() +pids = addprocs(; exeflags = ["--project=$(Base.active_project())"]) -@everywhere include("../src/AnalysisPipeline.jl") -@everywhere using .AnalysisPipeline +@everywhere using AnalysisPipeline # Create an instance of the pipeline behaviour pipeline = RtwithoutRenewalPipeline() diff --git a/pipeline/scripts/run_priorpred_pipeline.jl b/pipeline/scripts/run_priorpred_pipeline.jl index bcd6f8241..c509d037f 100644 --- a/pipeline/scripts/run_priorpred_pipeline.jl +++ b/pipeline/scripts/run_priorpred_pipeline.jl @@ -11,10 +11,9 @@ using Dagger # Define the backend resources to use for the pipeline # in this case we are using distributed local workers with loaded modules using Distributed -pids = addprocs() +pids = addprocs(; exeflags = ["--project=$(Base.active_project())"]) -@everywhere include("../src/AnalysisPipeline.jl") -@everywhere using .AnalysisPipeline +@everywhere using AnalysisPipeline # Create an instance of the pipeline behaviour pipeline = RtwithoutRenewalPriorPipeline() diff --git a/pipeline/src/constructors/constructors.jl b/pipeline/src/constructors/constructors.jl index 2c42487db..c8df4c362 100644 --- a/pipeline/src/constructors/constructors.jl +++ b/pipeline/src/constructors/constructors.jl @@ -7,4 +7,3 @@ include("make_truth_data_configs.jl") include("make_inference_configs.jl") include("make_Rt.jl") include("make_tspan.jl") -include("make_inference_method.jl") diff --git a/pipeline/test/constructors/test_constructors.jl b/pipeline/test/constructors/test_constructors.jl index 239c35c65..4aed08399 100644 --- a/pipeline/test/constructors/test_constructors.jl +++ b/pipeline/test/constructors/test_constructors.jl @@ -1,5 +1,5 @@ @testset "make_gi_params: returns a dictionary with correct keys" begin - using .AnalysisPipeline + using AnalysisPipeline pipeline = RtwithoutRenewalPipeline() params = make_gi_params(pipeline) @@ -9,14 +9,14 @@ end @testset "make_inf_generating_processes" begin - using .AnalysisPipeline, EpiAware + using AnalysisPipeline, EpiAware pipeline = RtwithoutRenewalPipeline() igps = make_inf_generating_processes(pipeline) @test igps == [DirectInfections, ExpGrowthRate, Renewal] end @testset "make_Rt: returns an array" begin - using .AnalysisPipeline + using AnalysisPipeline pipeline = RtwithoutRenewalPipeline() Rt = make_Rt(pipeline) @@ -24,7 +24,7 @@ end end @testset "default_tspan: returns an Tuple{Integer, Integer}" begin - using .AnalysisPipeline + using AnalysisPipeline pipeline = RtwithoutRenewalPipeline() tspan = make_tspan(pipeline) @@ -32,7 +32,7 @@ end end @testset "make_latent_model_priors: generates a dict with correct keys and distributions" begin - using .AnalysisPipeline, Distributions + using AnalysisPipeline, Distributions pipeline = RtwithoutRenewalPipeline() priors_dict = make_latent_model_priors(pipeline) @@ -47,7 +47,7 @@ end end @testset "make_epiaware_name_model_pairs: generates a vector of Pairs with correct keys and latent models" begin - using .AnalysisPipeline, EpiAware + using AnalysisPipeline, EpiAware pipeline = RtwithoutRenewalPipeline() namemodel_vect = make_epiaware_name_model_pairs(pipeline) @@ -57,7 +57,7 @@ end end @testset "make_inference_method: constructor and defaults" begin - using .AnalysisPipeline, EpiAware, ADTypes, AbstractMCMC + using AnalysisPipeline, EpiAware, ADTypes, AbstractMCMC pipeline = RtwithoutRenewalPipeline() method = make_inference_method(pipeline) @@ -74,7 +74,7 @@ end end @testset "make_inference_method: for prior predictive checking" begin - using .AnalysisPipeline, EpiAware, ADTypes, AbstractMCMC + using AnalysisPipeline, EpiAware, ADTypes, AbstractMCMC pipeline = RtwithoutRenewalPriorPipeline() method = make_inference_method(pipeline) @@ -84,7 +84,7 @@ end end @testset "make_truth_data_configs" begin - using .AnalysisPipeline + using AnalysisPipeline pipeline = RtwithoutRenewalPipeline() @testset "make_truth_data_configs should return a dictionary" begin config_dicts = make_truth_data_configs(pipeline) @@ -99,7 +99,7 @@ end end @testset "default inference configurations" begin - using .AnalysisPipeline + using AnalysisPipeline pipeline = RtwithoutRenewalPipeline() inference_configs = make_inference_configs(pipeline) diff --git a/pipeline/test/infer/test_InferenceConfig.jl b/pipeline/test/infer/test_InferenceConfig.jl index cb352144d..754847412 100644 --- a/pipeline/test/infer/test_InferenceConfig.jl +++ b/pipeline/test/infer/test_InferenceConfig.jl @@ -1,7 +1,7 @@ # Test the InferenceConfig struct constructor @testset "InferenceConfig" begin - using Distributions, .AnalysisPipeline, EpiAware + using Distributions, AnalysisPipeline, EpiAware struct TestLatentModel <: AbstractLatentModel end diff --git a/pipeline/test/pipeline/test_pipelinetypes.jl b/pipeline/test/pipeline/test_pipelinetypes.jl index d4ebaff1e..1d91f6222 100644 --- a/pipeline/test/pipeline/test_pipelinetypes.jl +++ b/pipeline/test/pipeline/test_pipelinetypes.jl @@ -1,5 +1,5 @@ @testset "EpiAwarePipeline Tests" begin - using .AnalysisPipeline + using AnalysisPipeline @testset "AbstractEpiAwarePipeline" begin @test_throws MethodError AbstractEpiAwarePipeline() end diff --git a/pipeline/test/runtests.jl b/pipeline/test/runtests.jl index b70dea1ff..75943be6a 100644 --- a/pipeline/test/runtests.jl +++ b/pipeline/test/runtests.jl @@ -1,10 +1,7 @@ using DrWatson, Test -quickactivate(@__DIR__(), "Analysis pipeline") +quickactivate(@__DIR__(), "AnalysisPipeline") -# Load analysis module -include(srcdir("AnalysisPipeline.jl")); - -#run tests +# Run tests include("pipeline/test_pipelinetypes.jl"); include("constructors/test_constructors.jl"); include("simulate/test_TruthSimulationConfig.jl"); diff --git a/pipeline/test/simulate/test_SimulationConfig.jl b/pipeline/test/simulate/test_SimulationConfig.jl index 29e6c6269..623a1900b 100644 --- a/pipeline/test/simulate/test_SimulationConfig.jl +++ b/pipeline/test/simulate/test_SimulationConfig.jl @@ -1,7 +1,7 @@ # Test the TruthSimulationConfig struct constructor @testset "TruthSimulationConfig" begin - using Distributions, .AnalysisPipeline, EpiAware + using Distributions, AnalysisPipeline, EpiAware gi = Gamma(2, 2) config = TruthSimulationConfig( truth_process = [0.5, 0.8, 1.2], gi_mean = 3.0, gi_std = 2.0) diff --git a/pipeline/test/simulate/test_TruthSimulationConfig.jl b/pipeline/test/simulate/test_TruthSimulationConfig.jl index d82a13ff2..bf37166f4 100644 --- a/pipeline/test/simulate/test_TruthSimulationConfig.jl +++ b/pipeline/test/simulate/test_TruthSimulationConfig.jl @@ -1,5 +1,5 @@ @testset "simulate runs" begin - using Distributions, .AnalysisPipeline, EpiAware + using Distributions, AnalysisPipeline, EpiAware # Define a mock TruthSimulationConfig object for testing config = TruthSimulationConfig( truth_process = fill(1.5, 10), gi_mean = 2.0, gi_std = 2.0) @@ -19,7 +19,7 @@ end @testset "generate_truthdata" begin - using .AnalysisPipeline + using AnalysisPipeline pipeline = RtwithoutRenewalPipeline() truth_data_config = Dict("gi_mean" => 0.5, "gi_std" => 0.1) truthdata = generate_truthdata(truth_data_config, pipeline) diff --git a/pipeline/test/test_full_inference.jl b/pipeline/test/test_full_inference.jl index 7e151a559..7427a9329 100644 --- a/pipeline/test/test_full_inference.jl +++ b/pipeline/test/test_full_inference.jl @@ -1,10 +1,9 @@ using Test @testset "run inference for random scenario with short toy data" begin - using DrWatson, EpiAware - quickactivate(@__DIR__(), "Analysis pipeline") - include(srcdir("AnalysisPipeline.jl")) + using DrWatson + quickactivate(@__DIR__(), "AnalysisPipeline") - using .AnalysisPipeline + using AnalysisPipeline pipeline = RtwithoutRenewalPipeline() tspan = (1, 28) diff --git a/pipeline/test/test_prior_predictive.jl b/pipeline/test/test_prior_predictive.jl index d584a711a..52a6173eb 100644 --- a/pipeline/test/test_prior_predictive.jl +++ b/pipeline/test/test_prior_predictive.jl @@ -4,7 +4,7 @@ using Test quickactivate(@__DIR__(), "Analysis pipeline") include(srcdir("AnalysisPipeline.jl")) - using .AnalysisPipeline + using AnalysisPipeline pipeline = RtwithoutRenewalPriorPipeline() tspan = (1, 28)