Skip to content

Commit

Permalink
deploy: 5e58987
Browse files Browse the repository at this point in the history
  • Loading branch information
Hofer-Julian committed Dec 13, 2023
1 parent 51c4dc4 commit 5478aec
Show file tree
Hide file tree
Showing 7 changed files with 290 additions and 256 deletions.
312 changes: 156 additions & 156 deletions build/index.html

Large diffs are not rendered by default.

56 changes: 21 additions & 35 deletions contribute/core.html

Large diffs are not rendered by default.

64 changes: 63 additions & 1 deletion contribute/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,40 @@
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
vertical-align: middle;
}
/* CSS for syntax highlighting */
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
}
pre.numberSource { margin-left: 3em; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
</style>


Expand Down Expand Up @@ -177,7 +211,17 @@
<div id="quarto-sidebar-glass" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar,#quarto-sidebar-glass"></div>
<!-- margin-sidebar -->
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar">

<nav id="TOC" role="doc-toc" class="toc-active">
<h2 id="toc-title">On this page</h2>

<ul>
<li><a href="#set-up-the-developer-environment" id="toc-set-up-the-developer-environment" class="nav-link active" data-scroll-target="#set-up-the-developer-environment"><span class="header-section-number">1</span> Set up the developer environment</a>
<ul class="collapse">
<li><a href="#clone-ribasim" id="toc-clone-ribasim" class="nav-link" data-scroll-target="#clone-ribasim"><span class="header-section-number">1.1</span> Clone Ribasim</a></li>
<li><a href="#setting-up-pixi" id="toc-setting-up-pixi" class="nav-link" data-scroll-target="#setting-up-pixi"><span class="header-section-number">1.2</span> Setting up pixi</a></li>
</ul></li>
</ul>
</nav>
</div>
<!-- main -->
<main class="content" id="quarto-document-content">
Expand All @@ -201,8 +245,26 @@ <h1 class="title">Contributing</h1>

<p>Ribasim welcomes contributions.</p>
<p>There is developer documentation for the <a href="../contribute/core.html">Julia core</a>, <a href="../contribute/python.html">Python tooling</a>, and the <a href="../contribute/qgis.html">QGIS plugin</a>. A guide on how to add a new node type to both is written in <a href="../contribute/addnode.html">adding node types</a>. <a href="../contribute/release.html">Release process</a> describes the steps to follow when creating a new Ribasim release.</p>
<section id="set-up-the-developer-environment" class="level1" data-number="1">
<h1 data-number="1"><span class="header-section-number">1</span> Set up the developer environment</h1>
<section id="clone-ribasim" class="level2" data-number="1.1">
<h2 data-number="1.1" class="anchored" data-anchor-id="clone-ribasim"><span class="header-section-number">1.1</span> Clone Ribasim</h2>
<p>In order to have the Ribasim repository locally available, you can clone it with Git. Git can be installed from <a href="https://git-scm.com/downloads">git-scm.com</a>. Once installed, run the following command at a directory of your choice:</p>
<p>In order to have the Ribasim repository locally available, run the following command at a directory of your choice:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> clone https://github.com/Deltares/Ribasim.git</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>To continue with the following steps, make the root of the repository your working directory by running</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="bu">cd</span> Ribasim</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</section>
<section id="setting-up-pixi" class="level2" data-number="1.2">
<h2 data-number="1.2" class="anchored" data-anchor-id="setting-up-pixi"><span class="header-section-number">1.2</span> Setting up pixi</h2>
<p>First, set up pixi as described on their getting started <a href="https://prefix.dev/docs/pixi/overview">page</a>.</p>
<p>Then set up the environment by running the following commands:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">pixi</span> run install</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>This will automatically install all required packages for development. Our pixi environment also provides an instance of Julia and QGIS. These will not conflict with any pre-installed applications, as long as you have the pixi environment enabled. You can do this in a terminal by calling <code>pixi shell</code>, or starting programs with <code>pixi run julia</code>, or <code>pixi run qgis</code>. This is also the way that we start visual studio code: <code>pixi run code .</code>.</p>


</section>
</section>

</main> <!-- /main -->
<script id="quarto-html-after-body" type="application/javascript">
Expand Down
51 changes: 22 additions & 29 deletions contribute/python.html
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,11 @@ <h2 id="toc-title">On this page</h2>
<ul>
<li><a href="#set-up-the-developer-environment" id="toc-set-up-the-developer-environment" class="nav-link active" data-scroll-target="#set-up-the-developer-environment"><span class="header-section-number">1</span> Set up the developer environment</a>
<ul class="collapse">
<li><a href="#setting-up-pixi" id="toc-setting-up-pixi" class="nav-link" data-scroll-target="#setting-up-pixi"><span class="header-section-number">1.1</span> Setting up pixi</a></li>
<li><a href="#sec-test" id="toc-sec-test" class="nav-link" data-scroll-target="#sec-test"><span class="header-section-number">1.2</span> Running the tests</a></li>
<li><a href="#updating-example-notebooks" id="toc-updating-example-notebooks" class="nav-link" data-scroll-target="#updating-example-notebooks"><span class="header-section-number">1.3</span> Updating example notebooks</a></li>
<li><a href="#prepare-model-input" id="toc-prepare-model-input" class="nav-link" data-scroll-target="#prepare-model-input"><span class="header-section-number">1.4</span> Prepare model input</a></li>
<li><a href="#sec-vscode" id="toc-sec-vscode" class="nav-link" data-scroll-target="#sec-vscode"><span class="header-section-number">1.5</span> Setup Visual Studio Code (optional)</a></li>
<li><a href="#linting" id="toc-linting" class="nav-link" data-scroll-target="#linting"><span class="header-section-number">1.6</span> Linting</a></li>
<li><a href="#sec-test" id="toc-sec-test" class="nav-link" data-scroll-target="#sec-test"><span class="header-section-number">1.1</span> Running the tests</a></li>
<li><a href="#updating-example-notebooks" id="toc-updating-example-notebooks" class="nav-link" data-scroll-target="#updating-example-notebooks"><span class="header-section-number">1.2</span> Updating example notebooks</a></li>
<li><a href="#prepare-model-input" id="toc-prepare-model-input" class="nav-link" data-scroll-target="#prepare-model-input"><span class="header-section-number">1.3</span> Prepare model input</a></li>
<li><a href="#sec-vscode" id="toc-sec-vscode" class="nav-link" data-scroll-target="#sec-vscode"><span class="header-section-number">1.4</span> Setup Visual Studio Code (optional)</a></li>
<li><a href="#linting" id="toc-linting" class="nav-link" data-scroll-target="#linting"><span class="header-section-number">1.5</span> Linting</a></li>
</ul></li>
<li><a href="#sec-codecov" id="toc-sec-codecov" class="nav-link" data-scroll-target="#sec-codecov"><span class="header-section-number">2</span> Code maintenance</a></li>
</ul>
Expand Down Expand Up @@ -251,45 +250,39 @@ <h1 class="title">Python tooling development</h1>

<section id="set-up-the-developer-environment" class="level1" data-number="1">
<h1 data-number="1"><span class="header-section-number">1</span> Set up the developer environment</h1>
<section id="setting-up-pixi" class="level2" data-number="1.1">
<h2 data-number="1.1" class="anchored" data-anchor-id="setting-up-pixi"><span class="header-section-number">1.1</span> Setting up pixi</h2>
<p>First, set up pixi as described on their getting started <a href="https://prefix.dev/docs/pixi/overview">page</a>.</p>
<p>Then set up the environment by running the following commands:</p>
<pre><code>pixi run install</code></pre>
</section>
<section id="sec-test" class="level2" data-number="1.2">
<h2 data-number="1.2" class="anchored" data-anchor-id="sec-test"><span class="header-section-number">1.2</span> Running the tests</h2>
<section id="sec-test" class="level2" data-number="1.1">
<h2 data-number="1.1" class="anchored" data-anchor-id="sec-test"><span class="header-section-number">1.1</span> Running the tests</h2>
<p>In order to run tests on Ribasim Python execute</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">pixi</span> run test-ribasim-python</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="ex">pixi</span> run test-ribasim-python</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</section>
<section id="updating-example-notebooks" class="level2" data-number="1.3">
<h2 data-number="1.3" class="anchored" data-anchor-id="updating-example-notebooks"><span class="header-section-number">1.3</span> Updating example notebooks</h2>
<section id="updating-example-notebooks" class="level2" data-number="1.2">
<h2 data-number="1.2" class="anchored" data-anchor-id="updating-example-notebooks"><span class="header-section-number">1.2</span> Updating example notebooks</h2>
<p>Make sure to run <code>Clear All Outputs</code> on the notebook before committing.</p>
</section>
<section id="prepare-model-input" class="level2" data-number="1.4">
<h2 data-number="1.4" class="anchored" data-anchor-id="prepare-model-input"><span class="header-section-number">1.4</span> Prepare model input</h2>
<section id="prepare-model-input" class="level2" data-number="1.3">
<h2 data-number="1.3" class="anchored" data-anchor-id="prepare-model-input"><span class="header-section-number">1.3</span> Prepare model input</h2>
<p>Before running the Julia tests or building binaries, example model input needs to created. This is done by running the following:</p>
<pre><code>pixi run generate-testmodels</code></pre>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">pixi</span> run generate-testmodels</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>This places example model input files under <code>./generated_testmodels/</code>. If the example models change, re-run this script.</p>
</section>
<section id="sec-vscode" class="level2" data-number="1.5">
<h2 data-number="1.5" class="anchored" data-anchor-id="sec-vscode"><span class="header-section-number">1.5</span> Setup Visual Studio Code (optional)</h2>
<section id="sec-vscode" class="level2" data-number="1.4">
<h2 data-number="1.4" class="anchored" data-anchor-id="sec-vscode"><span class="header-section-number">1.4</span> Setup Visual Studio Code (optional)</h2>
<p>Install the <a href="https://marketplace.visualstudio.com/items?itemName=ms-python.python">Python</a>, <a href="https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff">ruff</a> and <a href="https://marketplace.visualstudio.com/items?itemName=njpwerner.autodocstring">autoDocstring</a> extensions.</p>
</section>
<section id="linting" class="level2" data-number="1.6">
<h2 data-number="1.6" class="anchored" data-anchor-id="linting"><span class="header-section-number">1.6</span> Linting</h2>
<section id="linting" class="level2" data-number="1.5">
<h2 data-number="1.5" class="anchored" data-anchor-id="linting"><span class="header-section-number">1.5</span> Linting</h2>
<p>To run our linting suite locally, execute:</p>
<pre><code>pixi run lint</code></pre>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">pixi</span> run lint</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</section>
</section>
<section id="sec-codecov" class="level1" data-number="2">
<h1 data-number="2"><span class="header-section-number">2</span> Code maintenance</h1>
<p>For new features new tests have to be added. To monitor how much of the code is covered by the tests we use <a href="https://about.codecov.io/">Codecov</a>. For a simple overview of the local code coverage run</p>
<pre><code>pixi shell
pytest --cov=ribasim tests/</code></pre>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">pixi</span> shell</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="ex">pytest</span> <span class="at">--cov</span><span class="op">=</span>ribasim tests/</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>from <code>python/ribasim</code>. For an extensive overview in <code>html</code> format use</p>
<pre><code>pixi shell
pytest --cov=ribasim --cov-report=html tests/</code></pre>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh code-with-copy"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">pixi</span> shell</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="ex">pytest</span> <span class="at">--cov</span><span class="op">=</span>ribasim <span class="at">--cov-report</span><span class="op">=</span>html tests/</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>which creates a folder <code>htmlcov</code> in the working directory. To see te contents open <code>htmlcov/index.html</code> in a browser.</p>
<p>The code coverage of pushed branches can be seen <a href="https://app.codecov.io/gh/Deltares/Ribasim">here</a>.</p>

Expand Down
4 changes: 2 additions & 2 deletions contribute/qgis.html
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,7 @@ <h1 class="title">QGIS plugin development</h1>

<section id="set-up-the-developer-environment" class="level1" data-number="1">
<h1 data-number="1"><span class="header-section-number">1</span> Set up the developer environment</h1>
<p>First set up pixi as described in the <a href="../contribute/python.html">Python tooling</a> page.</p>
<p>QGIS is installed with Pixi when running <code>pixi run install</code>. To further set up the development environment, you must add the plugins to QGIS. The simplest way to do this is by running <code>pixi run install-qgis-plugins</code>. It grabs the latest version of the iMOD QGIS plugin and it makes a symlink to the ribasim_qgis folder so that QGIS can find it.</p>
<p>After you have installed the environment as described <a href="../contribute/index.html">here</a> you must still activate the QGIS plugins. The simplest way to do this is by running <code>pixi run install-qgis-plugins</code>. It grabs the latest version of the iMOD QGIS plugin and it makes a symlink to the ribasim_qgis folder so that QGIS can find it. It also installs plugins that make it possible to reload and debug your plugin while QGIS is open.</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
Expand All @@ -224,6 +223,7 @@ <h1 data-number="1"><span class="header-section-number">1</span> Set up the deve
</div>
<div class="callout-body-container callout-body">
<p>On Windows you need to have Developer mode enabled. Otherwise you will not have enough access rights to create symlinks. For more info, see this <a href="https://blogs.windows.com/windowsdeveloper/2016/12/02/symlinks-windows-10/">Windows blog</a>.</p>
<p>We wanted to implement this via <code>pip install --editable</code>, but QGIS doesn’t find the <code>metadata.txt</code> and therefore cannot load the plugin on startup.</p>
</div>
</div>
</section>
Expand Down
2 changes: 1 addition & 1 deletion python/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ <h1 data-number="2"><span class="header-section-number">2</span> Update the basi
<span id="cb28-4"><a href="#cb28-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="cb28-5"><a href="#cb28-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 0x7fd5f0590390&gt;</code></pre>
<pre><code>&lt;matplotlib.legend.Legend at 0x7f518b44d0d0&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
57 changes: 25 additions & 32 deletions search.json

Large diffs are not rendered by default.

0 comments on commit 5478aec

Please sign in to comment.