Skip to content

Commit

Permalink
deploy: 6733e79
Browse files Browse the repository at this point in the history
  • Loading branch information
visr committed Aug 27, 2024
1 parent 4216ef3 commit d286876
Show file tree
Hide file tree
Showing 14 changed files with 85 additions and 59 deletions.
26 changes: 13 additions & 13 deletions concept/allocation.html
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ <h2 data-number="4.3" class="anchored" data-anchor-id="the-optimization-constrai
<section id="example" class="level2" data-number="4.4">
<h2 data-number="4.4" class="anchored" data-anchor-id="example"><span class="header-section-number">4.4</span> Example</h2>
<p>The following is an example of an optimization problem for the example shown <a href="../guide/examples.html#model-with-allocation-user-demand">here</a>:</p>
<div id="0e2cc4f3" class="cell" data-execution_count="1">
<div id="1805dcd5" class="cell" data-execution_count="1">
<details class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">using</span> <span class="bu">Ribasim</span></span>
Expand All @@ -599,25 +599,25 @@ <h2 data-number="4.4" class="anchored" data-anchor-id="example"><span class="hea
<div class="cell-output cell-output-stdout">
<pre><code>Min F[(Basin #2, UserDemand #3)]² + F[(Basin #5, UserDemand #6)]²
Subject to
F[(UserDemand #6, Basin #5)] ≥ 0
F[(Basin #5, TabulatedRatingCurve #7)] ≥ 0
F[(FlowBoundary #1, Basin #2)] ≥ 0
F[(Basin #2, UserDemand #3)] ≥ 0
F[(LinearResistance #4, Basin #5)] ≥ 0
F[(Basin #5, LinearResistance #4)] ≥ 0
F[(UserDemand #3, Basin #2)] ≥ 0
F[(Basin #2, LinearResistance #4)] ≥ 0
F[(LinearResistance #4, Basin #2)] ≥ 0
F[(Basin #2, UserDemand #3)] ≥ 0
F[(TabulatedRatingCurve #7, Terminal #8)] ≥ 0
F[(LinearResistance #4, Basin #5)] ≥ 0
F[(Basin #5, LinearResistance #4)] ≥ 0
F[(FlowBoundary #1, Basin #2)] ≥ 0
F[(Basin #5, UserDemand #6)] ≥ 0
F[(UserDemand #3, Basin #2)] ≥ 0
F[(Basin #5, TabulatedRatingCurve #7)] ≥ 0
F[(UserDemand #6, Basin #5)] ≥ 0
source[(FlowBoundary #1, Basin #2)] : F[(FlowBoundary #1, Basin #2)] ≤ 172800
source_user[UserDemand #3] : F[(UserDemand #3, Basin #2)] ≤ 0
source_user[UserDemand #6] : F[(UserDemand #6, Basin #5)] ≤ 0
flow_conservation[LinearResistance #4] : -F[(LinearResistance #4, Basin #5)] + F[(Basin #5, LinearResistance #4)] + F[(Basin #2, LinearResistance #4)] - F[(LinearResistance #4, Basin #2)] = 0
flow_conservation[Basin #2] : F[(FlowBoundary #1, Basin #2)] - F[(Basin #2, UserDemand #3)] + F[(UserDemand #3, Basin #2)] - F[(Basin #2, LinearResistance #4)] + F[(LinearResistance #4, Basin #2)] = 0
flow_conservation[Basin #5] : F[(UserDemand #6, Basin #5)] - F[(Basin #5, TabulatedRatingCurve #7)] + F[(LinearResistance #4, Basin #5)] - F[(Basin #5, LinearResistance #4)] - F[(Basin #5, UserDemand #6)] = 0
source_user[UserDemand #3] : F[(UserDemand #3, Basin #2)] ≤ 0
flow_conservation[Basin #2] : -F[(Basin #2, LinearResistance #4)] + F[(LinearResistance #4, Basin #2)] - F[(Basin #2, UserDemand #3)] + F[(FlowBoundary #1, Basin #2)] + F[(UserDemand #3, Basin #2)] = 0
flow_conservation[LinearResistance #4] : F[(Basin #2, LinearResistance #4)] - F[(LinearResistance #4, Basin #2)] - F[(LinearResistance #4, Basin #5)] + F[(Basin #5, LinearResistance #4)] = 0
flow_conservation[Basin #5] : F[(LinearResistance #4, Basin #5)] - F[(Basin #5, LinearResistance #4)] - F[(Basin #5, UserDemand #6)] - F[(Basin #5, TabulatedRatingCurve #7)] + F[(UserDemand #6, Basin #5)] = 0
flow_conservation[Terminal #8] : F[(TabulatedRatingCurve #7, Terminal #8)] = 0
flow_conservation[TabulatedRatingCurve #7] : F[(Basin #5, TabulatedRatingCurve #7)] - F[(TabulatedRatingCurve #7, Terminal #8)] = 0
flow_conservation[TabulatedRatingCurve #7] : -F[(TabulatedRatingCurve #7, Terminal #8)] + F[(Basin #5, TabulatedRatingCurve #7)] = 0
</code></pre>
</div>
</div>
Expand Down
28 changes: 21 additions & 7 deletions dev/qgis_test_plan.html
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ <h2 id="toc-title">On this page</h2>
<ul class="collapse">
<li><a href="#add-points-to-node-layer" id="toc-add-points-to-node-layer" class="nav-link" data-scroll-target="#add-points-to-node-layer"><span class="header-section-number">5.1</span> Add points to Node layer</a></li>
<li><a href="#add-edges-to-edge-layer" id="toc-add-edges-to-edge-layer" class="nav-link" data-scroll-target="#add-edges-to-edge-layer"><span class="header-section-number">5.2</span> Add edges to Edge layer</a></li>
<li><a href="#node-selection-on-map-triggers-table-selection" id="toc-node-selection-on-map-triggers-table-selection" class="nav-link" data-scroll-target="#node-selection-on-map-triggers-table-selection"><span class="header-section-number">5.3</span> Node selection on map triggers table selection</a></li>
</ul></li>
<li><a href="#tables-tests" id="toc-tables-tests" class="nav-link" data-scroll-target="#tables-tests"><span class="header-section-number">6</span> Tables tests</a>
<ul class="collapse">
Expand Down Expand Up @@ -327,7 +328,7 @@ <h2 data-number="1.3" class="anchored" data-anchor-id="button-states-on-startup"
<li><em>In the Model tab, the “Add to QGIS” and “Remove from Dataset” buttons are disabled</em>.</li>
<li><em>In the Nodes tab, all buttons are disabled</em>.</li>
</ul>
<p><a href="https://github.com/Deltares/Ribasim/issues/1678">Failing</a></p>
<p><a href="https://github.com/Deltares/Ribasim/issues/1678">Failing</a></p>
</section>
</section>
<section id="new-model-tests" class="level1" data-number="2">
Expand Down Expand Up @@ -368,7 +369,7 @@ <h2 data-number="2.3" class="anchored" data-anchor-id="new-model-in-same-folder"
<li>Press OK: <em>An error is given that the database.gpkg already exists, test2.toml is not written</em>.</li>
<li>Cleanup: Delete the created files from disk.</li>
</ul>
<p><a href="https://github.com/Deltares/Ribasim/issues/1679">Failing</a></p>
<p><a href="https://github.com/Deltares/Ribasim/issues/1679">Failing</a></p>
</section>
<section id="new-model-with-same-name" class="level2" data-number="2.4">
<h2 data-number="2.4" class="anchored" data-anchor-id="new-model-with-same-name"><span class="header-section-number">2.4</span> New model with same name</h2>
Expand All @@ -386,7 +387,7 @@ <h2 data-number="2.4" class="anchored" data-anchor-id="new-model-with-same-name"
<li>Cleanup: Delete the created files from disk.</li>
</ul>
<p>Unsure if this is wanted behavior, as we said we wanted to overwrite the TOML file, and therefore also the database file. Perhaps we should create folders instead of TOML files only.</p>
<p><a href="https://github.com/Deltares/Ribasim/issues/1681">Failing</a></p>
<p><a href="https://github.com/Deltares/Ribasim/issues/1681">Failing</a></p>
</section>
<section id="new-model-and-clean-new-project-cleans-ribasim-plugin" class="level2" data-number="2.5">
<h2 data-number="2.5" class="anchored" data-anchor-id="new-model-and-clean-new-project-cleans-ribasim-plugin"><span class="header-section-number">2.5</span> New model and clean new project cleans Ribasim plugin</h2>
Expand All @@ -399,7 +400,7 @@ <h2 data-number="2.5" class="anchored" data-anchor-id="new-model-and-clean-new-p
<li>Press “Project &gt; New”: <em>Popup asks to save the project</em>.</li>
<li>Press Discard: <em>Layers tab is emptied, Ribasim panel is emptied</em>.</li>
</ul>
<p><a href="https://github.com/Deltares/Ribasim/issues/1682">Failing</a></p>
<p><a href="https://github.com/Deltares/Ribasim/issues/1682">Failing</a></p>
</section>
</section>
<section id="model-tab-button-interaction-tests" class="level1" data-number="3">
Expand Down Expand Up @@ -429,7 +430,7 @@ <h2 data-number="3.2" class="anchored" data-anchor-id="add-to-qgis-button"><span
<li>Press “Add to QGIS”: <em>Nothing happens</em>.</li>
<li>Press the “Edge” layer in the Model tab: <em>“Add to QGIS” button is disabled</em>.</li>
</ul>
<p><a href="https://github.com/Deltares/Ribasim/issues/1683">Failing</a></p>
<p><a href="https://github.com/Deltares/Ribasim/issues/1683">Failing</a></p>
</section>
<section id="remove-from-dataset-button" class="level2" data-number="3.3">
<h2 data-number="3.3" class="anchored" data-anchor-id="remove-from-dataset-button"><span class="header-section-number">3.3</span> Remove from Dataset button</h2>
Expand Down Expand Up @@ -472,7 +473,7 @@ <h2 data-number="4.2" class="anchored" data-anchor-id="add-table-twice-to-new-mo
<li>Go to the Nodes tab: <em>All buttons are enabled</em>.</li>
<li>Press the Basin / time button: <em>A layer is added to the layers panel with that name, the button becomes disabled</em>.</li>
</ul>
<p><a href="https://github.com/Deltares/Ribasim/issues/1685">Failing</a></p>
<p><a href="https://github.com/Deltares/Ribasim/issues/1685">Failing</a></p>
</section>
</section>
<section id="map-interaction-tests" class="level1" data-number="5">
Expand Down Expand Up @@ -511,12 +512,25 @@ <h2 data-number="5.2" class="anchored" data-anchor-id="add-edges-to-edge-layer">
<li>Select the Edge layer in the Layers tab: <em>edit buttons in the toolbar become enabled</em>.</li>
<li>Enable snapping under View &gt; Toolbars &gt; Snapping Toolbars: <em>Magnet button is enabled and active</em>.</li>
<li>Press the Add Line Feature button: <em>Mouse becomes a crosshair</em>.</li>
<li>Snap a line between the two nodes, click the two nodes and then right click to finish: <em>Popup shows with input, all is set to NULL</em>.</li>
<li>Snap a line between the two nodes, click the two nodes and then right click to finish: <em>Popup shows with input, most fields are set to NULL</em>.</li>
<li>Press OK: <em>Line appears on screen between the two nodes</em>.</li>
<li>Save the layer’s edits: <em>The line becomes blue</em>.</li>
<li>Open the attribute table: <em>The information shows the from_node_id, to_node_id. This information matches the information from the Node table.</em></li>
</ul>
</section>
<section id="node-selection-on-map-triggers-table-selection" class="level2" data-number="5.3">
<h2 data-number="5.3" class="anchored" data-anchor-id="node-selection-on-map-triggers-table-selection"><span class="header-section-number">5.3</span> Node selection on map triggers table selection</h2>
<ul>
<li>Open QGIS and ensure that the Ribasim plugin is installed and enabled.</li>
<li>Open the application via the Ribasim button on the QGIS toolbar: <em>Ribasim panel opens</em>.</li>
<li>Press the “Open” button in the Model tab: <em>file navigation window pops up</em>.</li>
<li>Choose an existing model from the <code>generated_testmodels</code> folder.</li>
<li>Press OK: <em>The model layers appear in the layer panel and on the map</em>.</li>
<li>Select the node layer, and make a subselection of nodes on the map: <em>Nodes are highlighted in yellow, including their edges</em>.</li>
<li>Open the Edge attribute table: <em>The highlighted rows are those with a from/to node_id that was selected</em>.</li>
<li>Open any non-spatial attribute table: <em>The highlighted rows are those with an node_id that was selected</em>.</li>
</ul>
</section>
</section>
<section id="tables-tests" class="level1" data-number="6">
<h1 data-number="6"><span class="header-section-number">6</span> Tables tests</h1>
Expand Down
Binary file modified guide/examples_files/figure-html/cell-18-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.
Binary file modified guide/examples_files/figure-html/cell-19-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.
Binary file modified guide/examples_files/figure-html/cell-57-output-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guide/examples_files/figure-html/cell-68-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.
30 changes: 15 additions & 15 deletions guide/qgis.html
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ <h2 id="toc-title">On this page</h2>
</ul></li>
</ul></li>
<li><a href="#running-a-model" id="toc-running-a-model" class="nav-link" data-scroll-target="#running-a-model"><span class="header-section-number">2</span> Running a model</a></li>
<li><a href="#sec-results" id="toc-sec-results" class="nav-link" data-scroll-target="#sec-results"><span class="header-section-number">3</span> Inspecting results</a></li>
<li><a href="#sec-inspect" id="toc-sec-inspect" class="nav-link" data-scroll-target="#sec-inspect"><span class="header-section-number">3</span> Inspect a (large) model</a></li>
<li><a href="#sec-results" id="toc-sec-results" class="nav-link" data-scroll-target="#sec-results"><span class="header-section-number">4</span> Inspecting results</a></li>
</ul>
</nav>
</div>
Expand Down Expand Up @@ -271,11 +272,7 @@ <h3 data-number="1.1.1" class="anchored" data-anchor-id="adding-nodes-on-the-map
</figure>
</div>
<p>Add nodes to the map with a left click and select the node type.</p>
<div class="quarto-figure quarto-figure-left">
<figure class="figure">
<p><img src="https://user-images.githubusercontent.com/4471859/224939237-67c1150b-15ec-4044-a02a-26a82f81da05.png" class="img-fluid quarto-figure quarto-figure-left figure-img"></p>
</figure>
</div>
<p><img alt="Node form" src="https://github.com/user-attachments/assets/6e811bb9-1817-4505-b8a4-a96ced5b6c26" class="img-fluid"></p>
<p>Turn the edit mode off and save the edits to the Nodes layer.</p>
<div class="quarto-figure quarto-figure-left">
<figure class="figure">
Expand All @@ -297,7 +294,7 @@ <h3 data-number="1.1.2" class="anchored" data-anchor-id="editing-node-properties
<p><img src="https://user-images.githubusercontent.com/4471859/224939287-a8b9f351-9aea-4e3a-8417-3867cd40cda5.png" class="img-fluid quarto-figure quarto-figure-left figure-img"></p>
</figure>
</div>
<p>Adjust the content. If you prefer, it also works to copy data with the same columns from Excel. Turn off edit mode and save changes to the layer.</p>
<p>Adjust the content. Note that the <code>node_id</code> field is connected to the Node layer and thus must be set to an existing <code>node_id</code>. If you prefer, it also works to copy data with the same columns from Excel. Turn off edit mode and save changes to the layer.</p>
<div class="quarto-figure quarto-figure-left">
<figure class="figure">
<p><img src="https://user-images.githubusercontent.com/4471859/224939297-4b0ca812-9618-4d25-ab7a-518bf1ca63e1.png" class="img-fluid quarto-figure quarto-figure-left figure-img"></p>
Expand All @@ -309,7 +306,7 @@ <h3 data-number="1.1.2" class="anchored" data-anchor-id="editing-node-properties
<h2 data-number="1.2" class="anchored" data-anchor-id="connect-nodes"><span class="header-section-number">1.2</span> Connect nodes</h2>
<section id="turn-on-snapping" class="level3" data-number="1.2.1">
<h3 data-number="1.2.1" class="anchored" data-anchor-id="turn-on-snapping"><span class="header-section-number">1.2.1</span> Turn on snapping</h3>
<p>Make sure the Snapping Toolbar is visible, by going to the View &gt; Toolbars menu. Turn on snapping mode by clicking the magnet and set the snapping distance to 25 pixels.</p>
<p>Make sure the Snapping Toolbar is visible, by going to the View &gt; Toolbars menu. Turn on snapping mode by clicking the magnet and set the snapping distance to 25 pixels. The keyboard shortcut for snapping is <code>s</code> (once the toolbar is enabled).</p>
<div class="quarto-figure quarto-figure-left">
<figure class="figure">
<p><img src="https://user-images.githubusercontent.com/4471859/224939328-8359272a-30bb-4eb1-ab6c-968318ac3997.png" class="img-fluid quarto-figure quarto-figure-left figure-img"></p>
Expand All @@ -331,11 +328,9 @@ <h3 data-number="1.2.2" class="anchored" data-anchor-id="creating-connecting-edg
</figure>
</div>
<p>Create a connection by left clicking a source node and right clicking the destination node.</p>
<div class="quarto-figure quarto-figure-left">
<figure class="figure">
<p><img src="https://user-images.githubusercontent.com/4471859/224939363-88716d43-0536-499d-adb8-2fb4223c0f87.png" class="img-fluid quarto-figure quarto-figure-left figure-img"></p>
</figure>
</div>
<p><img alt="Create an edge" src="https://github.com/user-attachments/assets/048d342d-dd2b-4e67-b8a0-7bbb8fe3f243" class="img-fluid"></p>
<p>A form where one can change the edge attributes will pop up. Once done with editing, click ok.</p>
<p><img alt="Edge form" src="https://github.com/user-attachments/assets/bee6af6f-7623-4d1e-98ed-edc26c524377" class="img-fluid"></p>
<p>Now leave the edit mode and save the results to the layer. Your model is now ready to run. See</p>
</section>
</section>
Expand All @@ -349,8 +344,13 @@ <h1 data-number="2"><span class="header-section-number">2</span> Running a model
<li>In your model directory there is now a <code>results/</code> folder with <code>basin.arrow</code> and <code>flow.arrow</code> output files.</li>
</ul>
</section>
<section id="sec-results" class="level1" data-number="3">
<h1 data-number="3"><span class="header-section-number">3</span> Inspecting results</h1>
<section id="sec-inspect" class="level1" data-number="3">
<h1 data-number="3"><span class="header-section-number">3</span> Inspect a (large) model</h1>
<p>For larger models the node tables can grow quite large. To facilitate inspection, the tables are linked via the <code>node_id</code> field to the Node table, and react to the selection of the Node layer. That is, on selection of certain nodes—either via the map or the attribute table—the selection is also made in all related tables. This is also the case for the Edge layer. It helps to set the attribute table of a table of interest to show selected features only (using the dropdown button on the bottom left).</p>
<p><img alt="Selection change" src="https://github.com/user-attachments/assets/074c1f58-926b-4d5e-a640-86a5a746a4c2" class="img-fluid"></p>
</section>
<section id="sec-results" class="level1" data-number="4">
<h1 data-number="4"><span class="header-section-number">4</span> Inspecting results</h1>
<p>Before inspecting the results, verify that the run was successfully and the output files are there.</p>
<p>Click the “Time Series” button of the iMOD plugin.</p>
<div class="quarto-figure quarto-figure-left">
Expand Down
Loading

0 comments on commit d286876

Please sign in to comment.