Skip to content

Commit

Permalink
Rename CalibrateAtmos -> ClimaCalibrate
Browse files Browse the repository at this point in the history
  • Loading branch information
nefrathenrici committed May 14, 2024
1 parent 3961f8a commit 17b790f
Show file tree
Hide file tree
Showing 26 changed files with 92 additions and 92 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ steps:
key: "init_cpu_env"
command:
- echo "--- Instantiate SurfaceFluxes calibration project"
- julia --project=experiments/surface_fluxes_perfect_model -e 'using Pkg; Pkg.build("CalibrateAtmos"); Pkg.precompile()'
- julia --project=experiments/surface_fluxes_perfect_model -e 'using Pkg; Pkg.build("ClimaCalibrate"); Pkg.precompile()'

- wait
- label: "SurfaceFluxes perfect model calibration"
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = "CalibrateAtmos"
name = "ClimaCalibrate"
uuid = "4347a170-ebd6-470c-89d3-5c705c0cacc2"
authors = ["Climate Modeling Alliance"]
version = "0.1.0"
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!-- Title -->
<h1 align="center">
CalibrateAtmos.jl
ClimaCalibrate.jl
</h1>

<!-- description -->
<p align="center">
<strong>CalibrateAtmos is a toolkit for developing scalable and reproducible
<strong>ClimaCalibrate is a toolkit for developing scalable and reproducible
calibration pipelines using with minimal boilerplate.</strong>
</p>

Expand All @@ -14,17 +14,17 @@ calibration pipelines using with minimal boilerplate.</strong>
[![ghaci][gha-ci-img]][gha-ci-url]
[![codecov][codecov-img]][codecov-url]

[docs-bld-img]: https://github.com/CliMA/CalibrateAtmos.jl/workflows/Documentation/badge.svg
[docs-bld-url]: https://github.com/CliMA/CalibrateAtmos.jl/actions?query=workflow%3ADocumentation
[docs-bld-img]: https://github.com/CliMA/ClimaCalibrate.jl/workflows/Documentation/badge.svg
[docs-bld-url]: https://github.com/CliMA/ClimaCalibrate.jl/actions?query=workflow%3ADocumentation

[docs-dev-img]: https://img.shields.io/badge/docs-dev-blue.svg
[docs-dev-url]: https://CliMA.github.io/CalibrateAtmos.jl/dev/
[docs-dev-url]: https://CliMA.github.io/ClimaCalibrate.jl/dev/

[gha-ci-img]: https://github.com/CliMA/CalibrateAtmos.jl/actions/workflows/ci.yml/badge.svg
[gha-ci-url]: https://github.com/CliMA/CalibrateAtmos.jl/actions/workflows/ci.yml
[gha-ci-img]: https://github.com/CliMA/ClimaCalibrate.jl/actions/workflows/ci.yml/badge.svg
[gha-ci-url]: https://github.com/CliMA/ClimaCalibrate.jl/actions/workflows/ci.yml

[codecov-img]: https://codecov.io/gh/CliMA/CalibrateAtmos.jl/branch/main/graph/badge.svg
[codecov-url]: https://codecov.io/gh/CliMA/CalibrateAtmos.jl
[codecov-img]: https://codecov.io/gh/CliMA/ClimaCalibrate.jl/branch/main/graph/badge.svg
[codecov-url]: https://codecov.io/gh/CliMA/ClimaCalibrate.jl

The recommended Julia version is: Stable release v1.10.0

Expand All @@ -33,6 +33,6 @@ We strive to support flexible and clearly documented calibration experiments.

## Contributing

If you're interested in contributing to the development of CalibrateAtmos we want your help no matter how big or small a contribution you make! It's always great to have new people look at the code with fresh eyes: you will see errors that other developers have missed.
If you're interested in contributing to the development of ClimaCalibrate we want your help no matter how big or small a contribution you make! It's always great to have new people look at the code with fresh eyes: you will see errors that other developers have missed.

Let us know by [opening an issue](https://github.com/CliMA/CalibrateAtmos.jl/issues/new) if you'd like to work on a new feature.
Let us know by [opening an issue](https://github.com/CliMA/ClimaCalibrate.jl/issues/new) if you'd like to work on a new feature.
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[deps]
CalibrateAtmos = "4347a170-ebd6-470c-89d3-5c705c0cacc2"
ClimaCalibrate = "4347a170-ebd6-470c-89d3-5c705c0cacc2"
CalibrateEmulateSample = "95e48a1f-0bec-4818-9538-3db4340308e3"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
Expand Down
10 changes: 5 additions & 5 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
using Documenter
using Documenter: doctest
using CalibrateAtmos
using ClimaCalibrate
using Base.CoreLogging
using DocumenterCitations

disable_logging(Base.CoreLogging.Info) # Hide doctest's `@info` printing
bib = CitationBibliography(joinpath(@__DIR__, "bibliography.bib"))

doctest(CalibrateAtmos; plugins = [bib])
doctest(ClimaCalibrate; plugins = [bib])
disable_logging(Base.CoreLogging.BelowMinLevel) # Re-enable all logging

makedocs(
plugins = [bib],
modules = [CalibrateAtmos],
sitename = "CalibrateAtmos.jl",
modules = [ClimaCalibrate],
sitename = "ClimaCalibrate.jl",
authors = "Clima",
checkdocs = :exports,
format = Documenter.HTML(
Expand All @@ -32,7 +32,7 @@ makedocs(
)

deploydocs(
repo = "github.com/CliMA/CalibrateAtmos.jl.git",
repo = "github.com/CliMA/ClimaCalibrate.jl.git",
devbranch = "main",
push_preview = true,
forcepush = true,
Expand Down
26 changes: 13 additions & 13 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@
## Model Interface

```@docs
CalibrateAtmos.get_config
CalibrateAtmos.run_forward_model
CalibrateAtmos.get_forward_model
CalibrateAtmos.observation_map
ClimaCalibrate.get_config
ClimaCalibrate.run_forward_model
ClimaCalibrate.get_forward_model
ClimaCalibrate.observation_map
```

## Backend Interface

```@docs
CalibrateAtmos.calibrate
CalibrateAtmos.sbatch_model_run
ClimaCalibrate.calibrate
ClimaCalibrate.sbatch_model_run
```

## EnsembleKalmanProcesses Interface

```@docs
CalibrateAtmos.initialize
CalibrateAtmos.save_G_ensemble
CalibrateAtmos.update_ensemble
CalibrateAtmos.ExperimentConfig
CalibrateAtmos.get_prior
CalibrateAtmos.get_param_dict
CalibrateAtmos.path_to_iteration
ClimaCalibrate.initialize
ClimaCalibrate.save_G_ensemble
ClimaCalibrate.update_ensemble
ClimaCalibrate.ExperimentConfig
ClimaCalibrate.get_prior
ClimaCalibrate.get_param_dict
ClimaCalibrate.path_to_iteration
```
2 changes: 1 addition & 1 deletion docs/src/emulate_sample.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import EnsembleKalmanProcesses as EKP
using EnsembleKalmanProcesses.ParameterDistributions
using EnsembleKalmanProcesses.TOMLInterface

import CalibrateAtmos as CAL
import ClimaCalibrate as CAL
```

Next, load in the data, EKP object, and prior distribution. These values are taken
Expand Down
4 changes: 2 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CalibrateAtmos.jl
# ClimaCalibrate.jl

CalibrateAtmos.jl is a toolkit for developing scalable and reproducible model
ClimaCalibrate.jl is a toolkit for developing scalable and reproducible model
calibration pipelines using CalibrateEmulateSample.jl with minimal boilerplate.

For more information, see our Getting Started page.
4 changes: 2 additions & 2 deletions docs/src/precompilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

PrecompileTools.jl enables developers to force the Julia compiler to save more code to disk, preventing re-compilation in the future.

For CalibrateAtmos, this is useful under certain conditions:
For ClimaCalibrate, this is useful under certain conditions:
1. **The atmosphere model configuration is set and will not change often**. This is because the model configuration specifies things like the floating-point type and callbacks, which affect the MethodInstances that get precompiled. Generically precompiling ClimaAtmos would take much too long to be useful.
2. **The model runtime is short compared to the compile time.** If the model runtime is an order of magnitude or more than the compilation time, any benefit from reduced compilation time will be trivial.

# How do I precompile my configuration?
The easiest way is by copying and pasting the code snippet below into `src/CalibrateAtmos.jl` and replacing the `job_id` with your experiment ID.
The easiest way is by copying and pasting the code snippet below into `src/ClimaCalibrate.jl` and replacing the `job_id` with your experiment ID.
This will precompile the model step and all callbacks for the given configuration.
```julia
using PrecompileTools
Expand Down
10 changes: 5 additions & 5 deletions docs/src/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To run the example experiment on your local machine, first open your REPL with t

Next, run the following code:
```julia
import CalibrateAtmos
import ClimaCalibrate

experiment_dir = dirname(Base.active_project())

Expand All @@ -24,7 +24,7 @@ include(joinpath(experiment_dir, "generate_data.jl"))
include(joinpath(experiment_dir, "observation_map.jl"))
include(joinpath(experiment_dir, "model_interface.jl"))

eki = CalibrateAtmos.calibrate(JuliaBackend, experiment_dir)
eki = ClimaCalibrate.calibrate(JuliaBackend, experiment_dir)
include(joinpath(experiment_dir, "postprocessing.jl"))
```

Expand All @@ -33,11 +33,11 @@ This method will queue Julia processes to run on your slurm cluster.

To run this experiment:
1. Log onto the Caltech HPC
2. Clone CalibrateAtmos.jl and `cd` into the repository.
2. Clone ClimaCalibrate.jl and `cd` into the repository.
3. Start julia: `julia --project=experiments/surace_fluxes_perfect_model`
4. Run the following:
```julia
import CalibrateAtmos: CaltechHPC, calibrate
import ClimaCalibrate: CaltechHPC, calibrate

experiment_dir = dirname(Base.active_project())

Expand All @@ -50,4 +50,4 @@ eki = calibrate(CaltechHPC, experiment_dir;
include(joinpath(experiment_dir, "postprocessing.jl"))
```

New experiments should be defined within the component model repos (in this case, `SurfaceFluxes.jl`), so that the internals of `CalibrateAtmos.jl` do not explicitly depend on component models.
New experiments should be defined within the component model repos (in this case, `SurfaceFluxes.jl`), so that the internals of `ClimaCalibrate.jl` do not explicitly depend on component models.
26 changes: 13 additions & 13 deletions experiments/surface_fluxes_perfect_model/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.10.3"
manifest_format = "2.0"
project_hash = "ae9cb369c40816d49bb5a565631215d357fe1284"
project_hash = "c588c67f67784e1b4e65633bdcbfa5bcaa6ddf91"

[[deps.AMD]]
deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse_jll"]
Expand Down Expand Up @@ -171,18 +171,6 @@ git-tree-sha1 = "a4c43f59baa34011e303e76f5c8c91bf58415aaf"
uuid = "83423d85-b0ee-5818-9007-b63ccbeb887a"
version = "1.18.0+1"

[[deps.CalibrateAtmos]]
deps = ["Distributions", "EnsembleKalmanProcesses", "JLD2", "Random", "TOML", "YAML"]
path = "../.."
uuid = "4347a170-ebd6-470c-89d3-5c705c0cacc2"
version = "0.1.0"

[deps.CalibrateAtmos.extensions]
CESExt = "CalibrateEmulateSample"

[deps.CalibrateAtmos.weakdeps]
CalibrateEmulateSample = "95e48a1f-0bec-4818-9538-3db4340308e3"

[[deps.ChainRulesCore]]
deps = ["Compat", "LinearAlgebra"]
git-tree-sha1 = "575cd02e080939a33b6df6c5853d14924c08e35b"
Expand All @@ -193,6 +181,18 @@ weakdeps = ["SparseArrays"]
[deps.ChainRulesCore.extensions]
ChainRulesCoreSparseArraysExt = "SparseArrays"

[[deps.ClimaCalibrate]]
deps = ["Distributions", "EnsembleKalmanProcesses", "JLD2", "Random", "TOML", "YAML"]
path = "../.."
uuid = "4347a170-ebd6-470c-89d3-5c705c0cacc2"
version = "0.1.0"

[deps.ClimaCalibrate.extensions]
CESExt = "CalibrateEmulateSample"

[deps.ClimaCalibrate.weakdeps]
CalibrateEmulateSample = "95e48a1f-0bec-4818-9538-3db4340308e3"

[[deps.ClimaParams]]
deps = ["DocStringExtensions", "TOML", "Test"]
git-tree-sha1 = "528aadfaae6f447df3879eab224625ecceec5982"
Expand Down
2 changes: 1 addition & 1 deletion experiments/surface_fluxes_perfect_model/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[deps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
CalibrateAtmos = "4347a170-ebd6-470c-89d3-5c705c0cacc2"
ClimaCalibrate = "4347a170-ebd6-470c-89d3-5c705c0cacc2"
ClimaParams = "5c42b081-d73a-476f-9059-fd94b934656c"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
EnsembleKalmanProcesses = "aa8a2aa5-91d8-4396-bcef-d4f2ec43552d"
Expand Down
4 changes: 2 additions & 2 deletions experiments/surface_fluxes_perfect_model/generate_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import SurfaceFluxes.UniversalFunctions as UF
import Thermodynamics as TD
using YAML
import SurfaceFluxes.Parameters: SurfaceFluxesParameters
using CalibrateAtmos
using ClimaCalibrate

pkg_dir = pkgdir(CalibrateAtmos)
pkg_dir = pkgdir(ClimaCalibrate)
experiment_path = "$pkg_dir/experiments/$experiment_id"
data_path = "$experiment_path/data"
include(joinpath(experiment_path, "model_interface.jl"))
Expand Down
6 changes: 3 additions & 3 deletions experiments/surface_fluxes_perfect_model/model_interface.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import EnsembleKalmanProcesses as EKP
import CalibrateAtmos
import CalibrateAtmos:
using ClimaCalibrate
import ClimaCalibrate:
AbstractPhysicalModel,
get_config,
run_forward_model,
Expand Down Expand Up @@ -35,7 +35,7 @@ We need to follow the following steps for the calibration:
struct SurfaceFluxModel <: AbstractPhysicalModel end

experiment_dir = joinpath(
pkgdir(CalibrateAtmos),
pkgdir(ClimaCalibrate),
"experiments",
"surface_fluxes_perfect_model",
)
Expand Down
4 changes: 2 additions & 2 deletions experiments/surface_fluxes_perfect_model/observation_map.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Statistics
import YAML
import JLD2
import CalibrateAtmos:
import ClimaCalibrate:
observation_map, ExperimentConfig, path_to_ensemble_member

experiment_dir = joinpath(
pkgdir(CalibrateAtmos),
pkgdir(ClimaCalibrate),
"experiments",
"surface_fluxes_perfect_model",
)
Expand Down
10 changes: 5 additions & 5 deletions experiments/surface_fluxes_perfect_model/postprocessing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import TOML
import CairoMakie: Makie
using Statistics

using CalibrateAtmos
using ClimaCalibrate

experiment_dir = dirname(Base.active_project())
experiment_config = CalibrateAtmos.ExperimentConfig(experiment_dir)
experiment_config = ClimaCalibrate.ExperimentConfig(experiment_dir)
output_dir = experiment_config.output_dir
experiment_id = experiment_config.id
N_iter = experiment_config.n_iterations
Expand Down Expand Up @@ -102,13 +102,13 @@ function convergence_plot(
end


pkg_dir = pkgdir(CalibrateAtmos)
pkg_dir = pkgdir(ClimaCalibrate)
model_config = YAML.load_file(
joinpath(pkg_dir, "experiments", experiment_id, "model_config.yml"),
)

eki_path = joinpath(
CalibrateAtmos.path_to_iteration(output_dir, N_iter),
ClimaCalibrate.path_to_iteration(output_dir, N_iter),
"eki_file.jld2",
);
eki = JLD2.load_object(eki_path);
Expand Down Expand Up @@ -146,7 +146,7 @@ for iter in 0:N_iter
model_config["toml"] = [
joinpath(
pkg_dir,
CalibrateAtmos.path_to_ensemble_member(output_dir, iter, i),
ClimaCalibrate.path_to_ensemble_member(output_dir, iter, i),
"parameters.toml",
),
]
Expand Down
2 changes: 1 addition & 1 deletion ext/CESExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using EnsembleKalmanProcesses.ParameterDistributions
using EnsembleKalmanProcesses.TOMLInterface
import JLD2

import CalibrateAtmos as CAL
import ClimaCalibrate as CAL


function CAL.get_input_output_pairs(ekp; N_iterations = nothing)
Expand Down
4 changes: 2 additions & 2 deletions src/CalibrateAtmos.jl → src/ClimaCalibrate.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module CalibrateAtmos
module ClimaCalibrate

include("ekp_interface.jl")
include("model_interface.jl")
include("backends.jl")
include("emulate_sample.jl")

end # module CalibrateAtmos
end # module ClimaCalibrate
Loading

0 comments on commit 17b790f

Please sign in to comment.