Skip to content

Commit

Permalink
build based on c705215
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Apr 4, 2024
1 parent 0b4275c commit 36a8956
Show file tree
Hide file tree
Showing 15 changed files with 78 additions and 78 deletions.
2 changes: 1 addition & 1 deletion dev/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.10.2","generation_timestamp":"2024-04-04T11:12:26","documenter_version":"1.3.0"}}
{"documenter":{"julia_version":"1.10.2","generation_timestamp":"2024-04-04T13:20:34","documenter_version":"1.3.0"}}
120 changes: 60 additions & 60 deletions dev/API/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/FAQ/translate_a_model/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@

run!(m)

lines(m[:TT_cu], m[:LAI], color=:green, axis=(ylabel=&quot;LAI (m² m⁻²)&quot;, xlabel=&quot;Days since sowing&quot;))</code></pre><img src="4a4b92e4.png" alt="Example block output"/></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../model_coupling/model_coupling_modeler/">« Modelers</a><a class="docs-footer-nextpage" href="../../API/">API »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.3.0 on <span class="colophon-date" title="Thursday 4 April 2024 11:12">Thursday 4 April 2024</span>. Using Julia version 1.10.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
lines(m[:TT_cu], m[:LAI], color=:green, axis=(ylabel=&quot;LAI (m² m⁻²)&quot;, xlabel=&quot;Days since sowing&quot;))</code></pre><img src="4a4b92e4.png" alt="Example block output"/></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../model_coupling/model_coupling_modeler/">« Modelers</a><a class="docs-footer-nextpage" href="../../API/">API »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.3.0 on <span class="colophon-date" title="Thursday 4 April 2024 13:20">Thursday 4 April 2024</span>. Using Julia version 1.10.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
4 changes: 2 additions & 2 deletions dev/design/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</code></pre><p>Or after instantiation using <a href="../API/#PlantSimEngine.init_status!-Tuple{Dict{String, ModelList}}"><code>init_status!</code></a>:</p><pre><code class="language-julia hljs">m = ModelList(Beer(0.5))

init_status!(m, LAI = 2.0)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi"><span class="sgr36"><span class="sgr1">[ Info: </span></span>Some variables must be initialized before simulation: (light_interception = (:LAI,),) (see `to_initialize()`)</code></pre><p>We can check if a component is correctly initialized using <a href="../API/#PlantSimEngine.is_initialized-Tuple{T} where T&lt;:ModelList"><code>is_initialized</code></a>:</p><pre><code class="language-julia hljs">is_initialized(m)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">true</code></pre><p>Some variables are inputs of models, but outputs of other models. When we couple models, <code>PlantSimEngine.jl</code> is clever and only requests the variables that are not computed by other models.</p><h2 id="Climate-forcing"><a class="docs-heading-anchor" href="#Climate-forcing">Climate forcing</a><a id="Climate-forcing-1"></a><a class="docs-heading-anchor-permalink" href="#Climate-forcing" title="Permalink"></a></h2><p>To make a simulation, we usually need the climatic/meteorological conditions measured close to the object or component.</p><p>Users are strongly encouraged to use <a href="https://github.com/PalmStudio/PlantMeteo.jl"><code>PlantMeteo.jl</code></a>, the companion package that helps manage such data, with default pre-computations and structures for efficient computations. The most basic data structure from this package is a type called <a href="https://palmstudio.github.io/PlantMeteo.jl/stable/#PlantMeteo.Atmosphere"><code>Atmosphere</code></a>, which defines steady-state atmospheric conditions, <em>i.e.</em> the conditions are considered at equilibrium. Another structure is available to define different consecutive time-steps: <a href="https://palmstudio.github.io/PlantMeteo.jl/stable/#PlantMeteo.TimeStepTable"><code>TimeStepTable</code></a>.</p><p>The mandatory variables to provide for an <a href="https://palmstudio.github.io/PlantMeteo.jl/stable/#PlantMeteo.Atmosphere"><code>Atmosphere</code></a> are: <code>T</code> (air temperature in °C), <code>Rh</code> (relative humidity, 0-1) and <code>Wind</code> (the wind speed, m s⁻¹). In our example, we also need the incoming photosynthetically active radiation flux (<code>Ri_PAR_f</code>, W m⁻²). We can declare such conditions like so:</p><pre><code class="language-julia hljs">using PlantMeteo
meteo = Atmosphere(T = 20.0, Wind = 1.0, Rh = 0.65, Ri_PAR_f = 500.0)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">Atmosphere(date = Dates.DateTime(&quot;2024-04-04T11:11:39.469&quot;), duration = Dates.Second(1), T = 20.0, Wind = 1.0, P = 101.325, Rh = 0.65, Precipitations = 0.0, Cₐ = 400.0, e = 1.5255470730405223, eₛ = 2.3469954969854188, VPD = 0.8214484239448965, ρ = 1.2040822421461452, λ = 2.4537e6, γ = 0.06725339460440805, ε = 0.5848056484857892, Δ = 0.14573378083416522, clearness = Inf, Ri_SW_f = Inf, Ri_PAR_f = 500.0, Ri_NIR_f = Inf, Ri_TIR_f = Inf, Ri_custom_f = Inf)</code></pre><p>More details are available from the <a href="https://vezy.github.io/PlantMeteo.jl/stable">package documentation</a>.</p><h2 id="Simulation"><a class="docs-heading-anchor" href="#Simulation">Simulation</a><a id="Simulation-1"></a><a class="docs-heading-anchor-permalink" href="#Simulation" title="Permalink"></a></h2><h3 id="Simulation-of-processes"><a class="docs-heading-anchor" href="#Simulation-of-processes">Simulation of processes</a><a id="Simulation-of-processes-1"></a><a class="docs-heading-anchor-permalink" href="#Simulation-of-processes" title="Permalink"></a></h3><p>Making a simulation is rather simple, we simply use <a href="../API/#PlantSimEngine.run!"><code>run!</code></a> on the <code>ModelList</code>:</p><p>The call to <a href="../API/#PlantSimEngine.run!"><code>run!</code></a> is the same whatever the models you choose for simulating the processes. This is some magic allowed by <code>PlantSimEngine.jl</code>! Here is an example:</p><pre><code class="language-julia hljs">run!(model_list, meteo)</code></pre><p>The first argument is the model list (see <a href="../model_switching/#ModelList"><code>ModelList</code></a>), and the second defines the micro-climatic conditions.</p><p>The <code>ModelList</code> should be initialized for the given process before calling the function. See <a href="#Variables-(inputs,-outputs)">Variables (inputs, outputs)</a> for more details.</p><h3 id="Example-simulation"><a class="docs-heading-anchor" href="#Example-simulation">Example simulation</a><a id="Example-simulation-1"></a><a class="docs-heading-anchor-permalink" href="#Example-simulation" title="Permalink"></a></h3><p>For example we can simulate the <code>light_interception</code> of a leaf like so:</p><pre><code class="language-julia hljs">using PlantSimEngine, PlantMeteo
meteo = Atmosphere(T = 20.0, Wind = 1.0, Rh = 0.65, Ri_PAR_f = 500.0)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">Atmosphere(date = Dates.DateTime(&quot;2024-04-04T13:19:43.149&quot;), duration = Dates.Second(1), T = 20.0, Wind = 1.0, P = 101.325, Rh = 0.65, Precipitations = 0.0, Cₐ = 400.0, e = 1.5255470730405223, eₛ = 2.3469954969854188, VPD = 0.8214484239448965, ρ = 1.2040822421461452, λ = 2.4537e6, γ = 0.06725339460440805, ε = 0.5848056484857892, Δ = 0.14573378083416522, clearness = Inf, Ri_SW_f = Inf, Ri_PAR_f = 500.0, Ri_NIR_f = Inf, Ri_TIR_f = Inf, Ri_custom_f = Inf)</code></pre><p>More details are available from the <a href="https://vezy.github.io/PlantMeteo.jl/stable">package documentation</a>.</p><h2 id="Simulation"><a class="docs-heading-anchor" href="#Simulation">Simulation</a><a id="Simulation-1"></a><a class="docs-heading-anchor-permalink" href="#Simulation" title="Permalink"></a></h2><h3 id="Simulation-of-processes"><a class="docs-heading-anchor" href="#Simulation-of-processes">Simulation of processes</a><a id="Simulation-of-processes-1"></a><a class="docs-heading-anchor-permalink" href="#Simulation-of-processes" title="Permalink"></a></h3><p>Making a simulation is rather simple, we simply use <a href="../API/#PlantSimEngine.run!"><code>run!</code></a> on the <code>ModelList</code>:</p><p>The call to <a href="../API/#PlantSimEngine.run!"><code>run!</code></a> is the same whatever the models you choose for simulating the processes. This is some magic allowed by <code>PlantSimEngine.jl</code>! Here is an example:</p><pre><code class="language-julia hljs">run!(model_list, meteo)</code></pre><p>The first argument is the model list (see <a href="../model_switching/#ModelList"><code>ModelList</code></a>), and the second defines the micro-climatic conditions.</p><p>The <code>ModelList</code> should be initialized for the given process before calling the function. See <a href="#Variables-(inputs,-outputs)">Variables (inputs, outputs)</a> for more details.</p><h3 id="Example-simulation"><a class="docs-heading-anchor" href="#Example-simulation">Example simulation</a><a id="Example-simulation-1"></a><a class="docs-heading-anchor-permalink" href="#Example-simulation" title="Permalink"></a></h3><p>For example we can simulate the <code>light_interception</code> of a leaf like so:</p><pre><code class="language-julia hljs">using PlantSimEngine, PlantMeteo

# Import the examples defined in the `Examples` sub-module
using PlantSimEngine.Examples
Expand All @@ -52,4 +52,4 @@
1444.3954769232544</code></pre><p>Or similarly using the dot syntax:</p><pre><code class="language-julia hljs">leaf.status.aPPFD</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">1-element Vector{Float64}:
1444.3954769232544</code></pre><p>Or much simpler (and recommended), by indexing directly into the model list:</p><pre><code class="language-julia hljs">leaf[:aPPFD]</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">1-element Vector{Float64}:
1444.3954769232544</code></pre><p>Another simple way to get the results is to transform the outputs into a <code>DataFrame</code>. Which is very easy because the <code>TimeStepTable</code> implements the Tables.jl interface:</p><pre><code class="language-julia hljs">using DataFrames
DataFrame(leaf)</code></pre><div><div style = "float: left;"><span>1×3 DataFrame</span></div><div style = "clear: both;"></div></div><div class = "data-frame" style = "overflow-x: scroll;"><table class = "data-frame" style = "margin-bottom: 6px;"><thead><tr class = "header"><th class = "rowNumber" style = "font-weight: bold; text-align: right;">Row</th><th style = "text-align: left;">LAI</th><th style = "text-align: left;">aPPFD</th><th style = "text-align: left;">timestep</th></tr><tr class = "subheader headerLastRow"><th class = "rowNumber" style = "font-weight: bold; text-align: right;"></th><th title = "Float64" style = "text-align: left;">Float64</th><th title = "Float64" style = "text-align: left;">Float64</th><th title = "Int64" style = "text-align: left;">Int64</th></tr></thead><tbody><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">1</td><td style = "text-align: right;">2.0</td><td style = "text-align: right;">1444.4</td><td style = "text-align: right;">1</td></tr></tbody></table></div><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>The output from <code>DataFrame</code> is adapted to the kind of simulation you did: one row per time-step, and per component models if you simulated several.</p></div></div><h2 id="Model-coupling"><a class="docs-heading-anchor" href="#Model-coupling">Model coupling</a><a id="Model-coupling-1"></a><a class="docs-heading-anchor-permalink" href="#Model-coupling" title="Permalink"></a></h2><p>A model can work either independently or in conjunction with other models. For example a stomatal conductance model is often associated with a photosynthesis model, <em>i.e.</em> it is called from the photosynthesis model.</p><p><code>PlantSimEngine.jl</code> is designed to make model coupling painless for modelers and users. Please see <a href="../model_coupling/model_coupling_user/#Model-coupling-for-users">Model coupling for users</a> and <a href="../model_coupling/model_coupling_modeler/#Model-coupling-for-modelers">Model coupling for modelers</a> for more details.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Home</a><a class="docs-footer-nextpage" href="../model_switching/">Model Switching »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.3.0 on <span class="colophon-date" title="Thursday 4 April 2024 11:12">Thursday 4 April 2024</span>. Using Julia version 1.10.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
DataFrame(leaf)</code></pre><div><div style = "float: left;"><span>1×3 DataFrame</span></div><div style = "clear: both;"></div></div><div class = "data-frame" style = "overflow-x: scroll;"><table class = "data-frame" style = "margin-bottom: 6px;"><thead><tr class = "header"><th class = "rowNumber" style = "font-weight: bold; text-align: right;">Row</th><th style = "text-align: left;">LAI</th><th style = "text-align: left;">aPPFD</th><th style = "text-align: left;">timestep</th></tr><tr class = "subheader headerLastRow"><th class = "rowNumber" style = "font-weight: bold; text-align: right;"></th><th title = "Float64" style = "text-align: left;">Float64</th><th title = "Float64" style = "text-align: left;">Float64</th><th title = "Int64" style = "text-align: left;">Int64</th></tr></thead><tbody><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">1</td><td style = "text-align: right;">2.0</td><td style = "text-align: right;">1444.4</td><td style = "text-align: right;">1</td></tr></tbody></table></div><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>The output from <code>DataFrame</code> is adapted to the kind of simulation you did: one row per time-step, and per component models if you simulated several.</p></div></div><h2 id="Model-coupling"><a class="docs-heading-anchor" href="#Model-coupling">Model coupling</a><a id="Model-coupling-1"></a><a class="docs-heading-anchor-permalink" href="#Model-coupling" title="Permalink"></a></h2><p>A model can work either independently or in conjunction with other models. For example a stomatal conductance model is often associated with a photosynthesis model, <em>i.e.</em> it is called from the photosynthesis model.</p><p><code>PlantSimEngine.jl</code> is designed to make model coupling painless for modelers and users. Please see <a href="../model_coupling/model_coupling_user/#Model-coupling-for-users">Model coupling for users</a> and <a href="../model_coupling/model_coupling_modeler/#Model-coupling-for-modelers">Model coupling for modelers</a> for more details.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Home</a><a class="docs-footer-nextpage" href="../model_switching/">Model Switching »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.3.0 on <span class="colophon-date" title="Thursday 4 April 2024 13:20">Thursday 4 April 2024</span>. Using Julia version 1.10.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 36a8956

Please sign in to comment.