From 01c4fd862188a2f910ef794170dbb21b7ffa818b Mon Sep 17 00:00:00 2001 From: odunbar Date: Thu, 1 Aug 2024 14:22:18 -0700 Subject: [PATCH] working cloudy example --- docs/src/examples/Cloudy_example.md | 4 ++++ examples/Cloudy/Cloudy_calibrate.jl | 13 ++++++++----- examples/Cloudy/Cloudy_emulate_sample.jl | 3 +-- examples/Cloudy/Project.toml | 9 ++++----- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/docs/src/examples/Cloudy_example.md b/docs/src/examples/Cloudy_example.md index dea98fcf3..f34f2e51b 100755 --- a/docs/src/examples/Cloudy_example.md +++ b/docs/src/examples/Cloudy_example.md @@ -3,6 +3,10 @@ !!! info "How do I run this code?" The full code is found in the [`examples/`](https://github.com/CliMA/CalibrateEmulateSample.jl/tree/main/examples) directory of the github repository +!!! warn "version control for Cloudy" + Due to rapid developments in Cloudy, this example will not work with the latest version. It is known to work pinned to specific commit `b4fa7e3`, please add Cloudy to the example Project using command `add Cloudy#b4fa7e3` in `Pkg` to avoid errors. + + This example is based on [Cloudy](https://github.com/CliMA/Cloudy.jl.git), a microphysics model that simulates how cloud droplets collide and coalesce into larger drops. Collision-coalescence is a crucial process for the formation of diff --git a/examples/Cloudy/Cloudy_calibrate.jl b/examples/Cloudy/Cloudy_calibrate.jl index 0dd8d8a64..037de2d65 100644 --- a/examples/Cloudy/Cloudy_calibrate.jl +++ b/examples/Cloudy/Cloudy_calibrate.jl @@ -1,6 +1,8 @@ # Reference the in-tree version of CalibrateEmulateSample on Julias load path include(joinpath(@__DIR__, "../", "ci", "linkfig.jl")) +@info "This experiment is very sensitive to the Cloudy version. It is known to work with Cloudy commit: b4fa7e3" + # Import modules using Distributions using StatsBase @@ -18,11 +20,12 @@ using Cloudy.KernelTensors # Import the module that runs Cloudy include(joinpath(@__DIR__, "DynamicalModel.jl")) -# Import Ensemble Kalman Processes modules -using EnsembleKalmanProcesses -using EnsembleKalmanProcesses.ParameterDistributions -using EnsembleKalmanProcesses.DataContainers -using EnsembleKalmanProcesses.PlotRecipes +# Import Ensemble Kalman Processes modules via CES +using CalibrateEmulateSample +using CalibrateEmulateSample.EnsembleKalmanProcesses +using CalibrateEmulateSample.EnsembleKalmanProcesses.ParameterDistributions +using CalibrateEmulateSample.EnsembleKalmanProcesses.DataContainers +using CalibrateEmulateSample.EnsembleKalmanProcesses.PlotRecipes ################################################################################ diff --git a/examples/Cloudy/Cloudy_emulate_sample.jl b/examples/Cloudy/Cloudy_emulate_sample.jl index 4441c6373..0f3deac48 100644 --- a/examples/Cloudy/Cloudy_emulate_sample.jl +++ b/examples/Cloudy/Cloudy_emulate_sample.jl @@ -281,8 +281,7 @@ function main() # Adding a vertical line for the true value vlines!(ax, [ϕ_true[idx]], color = :indigo, linewidth = 2.6, label = "true " * param_names[idx]) - xlims!(ax, xmin, xmax) - ylims!(ax, 0, nothing) + # Setting title and labels ax.xlabel = "Value" diff --git a/examples/Cloudy/Project.toml b/examples/Cloudy/Project.toml index ecec24084..7f7d731ec 100644 --- a/examples/Cloudy/Project.toml +++ b/examples/Cloudy/Project.toml @@ -1,10 +1,13 @@ [deps] CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" +CalibrateEmulateSample = "95e48a1f-0bec-4818-9538-3db4340308e3" Cloudy = "9e3b23bb-e7cc-4b94-886c-65de2234ba87" DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" +EnsembleKalmanProcesses = "aa8a2aa5-91d8-4396-bcef-d4f2ec43552d" GaussianProcesses = "891a1506-143c-57d2-908e-e1f8e92e6de9" +JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" PairPlots = "43a3c2be-4208-490b-832a-a21dcd55d7da" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" @@ -12,11 +15,7 @@ Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd" -CalibrateEmulateSample = "95e48a1f-0bec-4818-9538-3db4340308e3" -EnsembleKalmanProcesses = "aa8a2aa5-91d8-4396-bcef-d4f2ec43552d" -JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819" - [compat] julia = "~1.6" -Cloudy = "0.3" +Cloudy = "0.2" # Known to work with commit: b4fa7e3 \ No newline at end of file