From 1fcf2abd3659a279d85dd3a637353fb5b0f4b740 Mon Sep 17 00:00:00 2001 From: nefrathenrici Date: Fri, 16 Feb 2024 14:32:20 -0800 Subject: [PATCH] add test --- src/emulate_sample.jl | 1 - test/Project.toml | 1 + test/runtests.jl | 1 + test/test_case_inputs/eki_test.jld2 | Bin 0 -> 29854 bytes test/test_case_inputs/sphere_hs_rhoe.toml | 4 +++ test/test_emulate_sample.jl | 36 ++++++++++++++++++++++ 6 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 test/test_case_inputs/eki_test.jld2 create mode 100644 test/test_case_inputs/sphere_hs_rhoe.toml create mode 100644 test/test_emulate_sample.jl diff --git a/src/emulate_sample.jl b/src/emulate_sample.jl index 5493ad70..d3aebc92 100644 --- a/src/emulate_sample.jl +++ b/src/emulate_sample.jl @@ -47,7 +47,6 @@ function sample(emulator, y_obs, prior, init_params; n_samples = 100_000) N = 2000, discard_initial = 0, ) - println("Begin MCMC - with step size ", new_step) chain = MarkovChainMonteCarlo.sample( mcmc, n_samples; diff --git a/test/Project.toml b/test/Project.toml index 84a24c9e..be81e530 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,6 +1,7 @@ [deps] CLIMAParameters = "6eacf6c3-8458-43b9-ae03-caf5306d3d53" CalibrateAtmos = "4347a170-ebd6-470c-89d3-5c705c0cacc2" +CalibrateEmulateSample = "95e48a1f-0bec-4818-9538-3db4340308e3" ClimaCore = "d414da3d-4745-48bb-8d80-42e94e092884" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" EnsembleKalmanProcesses = "aa8a2aa5-91d8-4396-bcef-d4f2ec43552d" diff --git a/test/runtests.jl b/test/runtests.jl index ece451f8..b45bf29d 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,3 +2,4 @@ using Test include("test_init.jl") include("test_atmos_config.jl") +include("test_emulate_sample.jl") \ No newline at end of file diff --git a/test/test_case_inputs/eki_test.jld2 b/test/test_case_inputs/eki_test.jld2 new file mode 100644 index 0000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