Skip to content

Commit

Permalink
Merge pull request #92 from gaelforget/v0p2p14b
Browse files Browse the repository at this point in the history
V0p2p14b
  • Loading branch information
gaelforget authored Oct 6, 2022
2 parents e971407 + 9669f25 commit a9122ab
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ClimateModels"
uuid = "f6adb021-9183-4f40-84dc-8cea6f651bb0"
authors = ["gaelforget <gforget@mit.edu>"]
version = "0.2.13"
version = "0.2.14"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand Down
4 changes: 4 additions & 0 deletions docs/src/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

A good place to start is the [random walk model](RandomWalker.html) example. It is also presented in greater detail in the [Climate Model Interface](@ref) section to further illustrate how things work.

```@docs
RandomWalker
```

The examples generally fall into two categories :

- [Workflows That Run Models](@ref run_model_examples)
Expand Down
6 changes: 3 additions & 3 deletions docs/src/functionalities.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ or using the [`@ModelRun`](@ref) to abbreviate further:
@ModelRun ClimateModels.RandomWalker
```

The above example uses `ClimateModels.RandomWalker` as the model's top level function / wrapper function.
The above example uses [RandomWalker](@ref) as the model's top level function / wrapper function.

By design of our interface, **it is required** that this function receives a `ModelConfig` as its sole input argument.

Expand All @@ -44,8 +44,6 @@ MC=ModelConfig(model=ClimateModels.RandomWalker)
nothing #hide
```

The `model`'s top level function gets called via [`launch`](@ref). In our example, `f` thus generates a file called `RandomWalker.csv`, which gets stored in the run folder.

The sequence of calls within `ModelRun` can then be expanded as shown below. In practice, `setup` typically handles files and software, `build` may compile a chosen model configuration, and `launch` takes care of the main computation.

```@example main
Expand All @@ -54,6 +52,8 @@ build(MC)
launch(MC)
```

The `model`'s top level function gets called via [`launch`](@ref). In our example, it generates a CSV file found in the run folder as shown below.

!!! note
It is **not required** that compilation takes place during `build`. It can also be done beforehand or within `launch`.

Expand Down
1 change: 1 addition & 0 deletions src/ClimateModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export put!, take!, pathof, readdir, log
#export git_log_prm, git_log_show
#export monitor, help, pause
#export train, compare, analyze
export RandomWalker

export OrderedDict, UUID, uuid4, @suppress #should be commented out?

Expand Down
8 changes: 5 additions & 3 deletions src/toy_models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ using CSV, DataFrames
"""
RandomWalker(x::AbstractModelConfig)
Random Walk in 2D over `NS` steps (100 by default). Returns the results to as an array and
saves them to a `.csv` file (_RandomWalker.csv_ by default) inside the run directory
(`pathof(x)` by default), if `setup` method has been invoked to create it.
Random Walk in 2D over `NS` steps (100 by default). The results are returned as an array
and saved to a text file (`RandomWalker.csv`` by default) inside the `run` folder
(`pathof(x)` by default).
Note: the `setup` method should be invoked to create the `run` folder beforehand.
"""
function RandomWalker(x::AbstractModelConfig)
#model run
Expand Down

0 comments on commit a9122ab

Please sign in to comment.