From 721c5d5474ca30551bb2ab4511bf896da68d3d75 Mon Sep 17 00:00:00 2001 From: cgrudz Date: Tue, 1 Nov 2022 17:32:34 -0700 Subject: [PATCH] Uploading test cases for parallel experiment constructors --- src/experiments/ParallelExperimentDriver.jl | 5 +- test/TestParallelExperimentDriver.jl | 115 ++++++++++++++++++++ test/runtests.jl | 13 ++- 3 files changed, 130 insertions(+), 3 deletions(-) create mode 100755 test/TestParallelExperimentDriver.jl diff --git a/src/experiments/ParallelExperimentDriver.jl b/src/experiments/ParallelExperimentDriver.jl index dc18c815..68cc4e3f 100755 --- a/src/experiments/ParallelExperimentDriver.jl +++ b/src/experiments/ParallelExperimentDriver.jl @@ -4,7 +4,8 @@ module ParallelExperimentDriver # imports and exports using ..DataAssimilationBenchmarks export ensemble_filter_adaptive_inflation, ensemble_filter_param, classic_ensemble_state, - classic_ensemble_param, single_iteration_ensemble_state, iterative_ensemble_state + classic_ensemble_param, single_iteration_ensemble_state, iterative_ensemble_state, + D3_var_tuned_inflation ############################################################################################## # Utility methods and definitions ############################################################################################## @@ -104,7 +105,7 @@ end ############################################################################################## """ - args, wrap_exp = D3_var_filter_tuning() + args, wrap_exp = D3_var_tuned_inflation() Constructs parameter range for tuning multiplicative inflation for 3D-VAR background cov. diff --git a/test/TestParallelExperimentDriver.jl b/test/TestParallelExperimentDriver.jl new file mode 100755 index 00000000..4392e1f6 --- /dev/null +++ b/test/TestParallelExperimentDriver.jl @@ -0,0 +1,115 @@ +############################################################################################## +module TestParallelExperimentDriver +############################################################################################## +using DataAssimilationBenchmarks +using DataAssimilationBenchmarks.ParallelExperimentDriver + +############################################################################################## +""" + This is to test if the named tuple constructor will generate the experiment configuration + +""" +function test_ensemble_filter_adaptive_inflation() + try + args, wrap_exp = ensemble_filter_adaptive_inflation() + wrap_exp(args[1]) + true + catch + false + end +end + +############################################################################################## +""" + This is to test if the named tuple constructor will generate the experiment configuration + +""" +function test_D3_var_tuned_inflation() + try + args, wrap_exp = D3_var_tuned_inflation() + wrap_exp(args[1]) + true + catch + false + end +end + +############################################################################################## +""" + This is to test if the named tuple constructor will generate the experiment configuration + +""" +function test_ensemble_filter_param() + try + args, wrap_exp = ensemble_filter_param() + wrap_exp(args[1]) + true + catch + false + end +end + +############################################################################################## +""" + This is to test if the named tuple constructor will generate the experiment configuration + +""" +function test_classic_ensemble_state() + try + args, wrap_exp = classic_ensemble_state() + wrap_exp(args[1]) + true + catch + false + end +end + +############################################################################################## +""" + This is to test if the named tuple constructor will generate the experiment configuration + +""" +function test_classic_ensemble_param() + try + args, wrap_exp = classic_ensemble_param() + wrap_exp(args[1]) + true + catch + false + end +end + +############################################################################################## +""" + This is to test if the named tuple constructor will generate the experiment configuration + +""" +function test_single_iteration_ensemble_state() + try + args, wrap_exp = single_iteration_ensemble_state() + wrap_exp(args[1]) + true + catch + false + end +end + +############################################################################################## +""" + This is to test if the named tuple constructor will generate the experiment configuration + +""" +function test_iterative_ensemble_state() + try + args, wrap_exp = iterative_ensemble_state() + wrap_exp(args[1]) + true + catch + false + end +end + +############################################################################################## +# end module + +end diff --git a/test/runtests.jl b/test/runtests.jl index 34a14423..be0a5671 100755 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -17,10 +17,10 @@ include("TestFilterExps.jl") include("TestClassicSmootherExps.jl") include("TestIterativeSmootherExps.jl") include("TestSingleIterationSmootherExps.jl") +include("TestParallelExperimentDriver.jl") ############################################################################################## # Run tests - @testset "ParentModule" begin @test TestDataAssimilationBenchmarks.splash() end @@ -110,6 +110,17 @@ end @test TestSingleIterationSmootherExps.analyze_mda_ensemble_smoother_param_L96() end +# Test parallel experiment constructors +@testset "Parallel experiment constructors" begin + @test TestParallelExperimentDriver.test_ensemble_filter_adaptive_inflation() + @test TestParallelExperimentDriver.test_D3_var_tuned_inflation() + @test TestParallelExperimentDriver.test_ensemble_filter_param() + @test TestParallelExperimentDriver.test_classic_ensemble_state() + @test TestParallelExperimentDriver.test_classic_ensemble_param() + @test TestParallelExperimentDriver.test_single_iteration_ensemble_state() + @test TestParallelExperimentDriver.test_iterative_ensemble_state() +end + ############################################################################################## # end module