Skip to content

Commit

Permalink
deploy: 21200de
Browse files Browse the repository at this point in the history
  • Loading branch information
Hofer-Julian committed Nov 9, 2023
1 parent fb536e5 commit 635ed8a
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 157 deletions.
254 changes: 127 additions & 127 deletions build/index.html

Large diffs are not rendered by default.

33 changes: 9 additions & 24 deletions contribute/core.html
Original file line number Diff line number Diff line change
Expand Up @@ -282,37 +282,22 @@ <h2 data-number="2.1" class="anchored" data-anchor-id="sec-test"><span class="he
<p>You will want to run the testsuite on a regular basis to check if your changes had unexpected side effects. It is also a good way to find out if your development environment is set up correctly.</p>
<p>Before the tests can run, you need to <a href="../contribute/python.html#prepare-model-input">prepare model input</a>.</p>
<p>With the root of the repository as your working directory you can start the REPL with activated <code>Ribasim</code> environment by running the following:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">julia</span> <span class="at">--project</span><span class="op">=</span>core</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">julia</span> <span class="at">--project</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>While not technically required, it is advised to import Ribasim first to catch installation issues early on.</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>julia<span class="op">&gt;</span> <span class="im">using</span> <span class="bu">Ribasim</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>Then open the Pkg REPL by typing <code>]</code> and execute:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>pkg<span class="op">&gt;</span> test</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>If you are in a different environment that depends on Ribasim, you can test Ribasim with the following command:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>pkg<span class="op">&gt;</span> test Ribasim</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode" id="cb6"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>pkg<span class="op">&gt;</span> test Ribasim</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>In order to debug tests, it is very useful to run them in a REPL. However, here, you don’t have the dependencies available in the <code>[extras]</code> section of your <code>Project.toml</code>. <a href="https://github.com/JuliaTesting/TestEnv.jl"><code>TestEnv.jl</code></a> that we installed earlier solves that problem.</p>
<p>When you then debug your tests inside the REPL, you can include the <code>[extras]</code> dependencies as follows:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="im">using</span> <span class="bu">TestEnv</span></span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a>TestEnv.<span class="fu">activate</span>()</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Tip
</div>
</div>
<div class="callout-body-container callout-body">
<p>The Julia VS Code extension allows you to <a href="https://www.julia-vscode.org/docs/stable/userguide/runningcode/#The-Julia-REPL">open a REPL</a> with the Ribasim environment already activated: <code>"julia.environmentPath": "Ribasim/core"</code>. That way you don’t have to type <code>activate core</code> every time you open the REPL.</p>
</div>
</div>
<div class="sourceCode" id="cb7"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="im">using</span> <span class="bu">TestEnv</span>,</span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="bu">TestEnv.activate("Ribasim")</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</section>
<section id="render-documentation" class="level2" data-number="2.2">
<h2 data-number="2.2" class="anchored" data-anchor-id="render-documentation"><span class="header-section-number">2.2</span> Render documentation</h2>
<p>Example models are created and simulated as part of the rendering of the documentation. The Julia API reference is created using Documenter.jl by running this command:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="ex">pixi</span> run build-julia-docs</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode" id="cb8"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="ex">pixi</span> run build-julia-docs</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>In order to preview documentation you can run the following command from the <code>docs/</code> folder. Afterwards, a browser tab will open with the rendered documentation, updating it as you make changes.</p>
<div class="sourceCode" id="cb10"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="ex">pixi</span> run quarto-preview</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode" id="cb9"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="ex">pixi</span> run quarto-preview</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>The documentation also includes <a href="https://jupyter.org/">Jupyter notebooks</a>. Note that they are stored in the repository without any output, and this should stay this way to keep the repository small. The documentation rendering process adds the output by running the notebooks.</p>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center">
Expand All @@ -331,10 +316,10 @@ <h2 data-number="2.2" class="anchored" data-anchor-id="render-documentation"><sp
<section id="run-ribasim-simulations" class="level2" data-number="2.3">
<h2 data-number="2.3" class="anchored" data-anchor-id="run-ribasim-simulations"><span class="header-section-number">2.3</span> Run Ribasim simulations</h2>
<p>Assuming your working directory is the root of the repository, you can activate this project by entering the Pkg mode of the REPL with <code>]</code> and execute:</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a>pkg<span class="op">&gt;</span> activate core</span>
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a>pkg<span class="op">&gt;</span> instantiate</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode" id="cb10"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a>pkg<span class="op">&gt;</span> activate .</span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a>pkg<span class="op">&gt;</span> instantiate</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>Press backspace to go back to the Julia REPL. There you can run a model with:</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a>julia<span class="op">&gt;</span> Ribasim.<span class="fu">run</span>(<span class="st">"path/to/model/ribasim.toml"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode" id="cb11"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a>julia<span class="op">&gt;</span> Ribasim.<span class="fu">run</span>(<span class="st">"path/to/model/ribasim.toml"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
Expand Down
2 changes: 1 addition & 1 deletion core/equations.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ <h2 data-number="2.1" class="anchored" data-anchor-id="sec-reduction_factor"><sp
<div class="cell-output cell-output-stderr">
<pre><code>&lt;&gt;:31: SyntaxWarning: invalid escape sequence '\p'
&lt;&gt;:31: SyntaxWarning: invalid escape sequence '\p'
/tmp/ipykernel_5228/665069857.py:31: SyntaxWarning: invalid escape sequence '\p'
/tmp/ipykernel_5497/665069857.py:31: SyntaxWarning: invalid escape sequence '\p'
ax.set_ylabel("$\phi(x;p)$", fontsize=fontsize)</code></pre>
</div>
<div class="cell-output cell-output-display">
Expand Down
2 changes: 1 addition & 1 deletion python/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ <h1 data-number="2"><span class="header-section-number">2</span> Update the basi
<span id="cb26-4"><a href="#cb26-4" aria-hidden="true" tabindex="-1"></a>ax <span class="op">=</span> df_flow.pivot_table(index<span class="op">=</span><span class="st">"time"</span>, columns<span class="op">=</span><span class="st">"edge"</span>, values<span class="op">=</span><span class="st">"flow_m3d"</span>).plot()</span>
<span id="cb26-5"><a href="#cb26-5" aria-hidden="true" tabindex="-1"></a>ax.legend(bbox_to_anchor<span class="op">=</span>(<span class="fl">1.3</span>, <span class="dv">1</span>), title<span class="op">=</span><span class="st">"Edge"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="26">
<pre><code>&lt;matplotlib.legend.Legend at 0x7efbb1923800&gt;</code></pre>
<pre><code>&lt;matplotlib.legend.Legend at 0x7fb3b2634050&gt;</code></pre>
</div>
<div class="cell-output cell-output-display">
<p><img src="examples_files/figure-html/cell-27-output-2.png" width="727" height="561"></p>
Expand Down
Binary file modified python/examples_files/figure-html/cell-55-output-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions search.json

Large diffs are not rendered by default.

0 comments on commit 635ed8a

Please sign in to comment.