Skip to content

Commit

Permalink
Deployed ee6f6b8 with MkDocs version: 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kvanderwijst committed Mar 12, 2024
1 parent 4951c24 commit 1c4451c
Show file tree
Hide file tree
Showing 7 changed files with 504 additions and 354 deletions.
178 changes: 93 additions & 85 deletions components/economics/index.html

Large diffs are not rendered by default.

469 changes: 258 additions & 211 deletions components/emissions/index.html

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions extending_mimosa/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,17 @@ <h1>Extending MIMOSA</h1>
<li>Adding a variable</li>
<li>
<p>Adding a parameter</p>
<ul>
<li>Either setting param directly from config<ul>
<li>With string or dynamically</li>
</ul>
</li>
<li>Or setting it automatically from regional param store<ul>
<li>With string or dynamically</li>
</ul>
</li>
<li>Or for more advanced manipulations by using <code>instantiate_params.py</code></li>
</ul>
</li>
<li>
<p>Adding a new component (import abstract_model etc)</p>
Expand Down
156 changes: 99 additions & 57 deletions parameters/index.html

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions run/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,15 @@
</span>
</a>

</li>

<li class="md-nav__item">
<a href="#advanced-logging" class="md-nav__link">
<span class="md-ellipsis">
Advanced: logging
</span>
</a>

</li>

</ul>
Expand Down Expand Up @@ -754,6 +763,15 @@
</span>
</a>

</li>

<li class="md-nav__item">
<a href="#advanced-logging" class="md-nav__link">
<span class="md-ellipsis">
Advanced: logging
</span>
</a>

</li>

</ul>
Expand Down Expand Up @@ -1001,6 +1019,30 @@ <h4 id="example-2-high-damages-high-tcre-low-discounting">Example 2: high damage
</span><span id="__span-2-12"><a href="#__codelineno-2-12" id="__codelineno-2-12" name="__codelineno-2-12"></a><span class="n">model2</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="s2">"run_example2"</span><span class="p">)</span>
</span></code></pre></div>
<h3 id="doing-multiple-runs">Doing multiple runs</h3>
<h3 id="advanced-logging">Advanced: logging</h3>
<p>The solve status (optimal, impossible, etc), model solve time and the final maximised value can be logged to an external log file (along with the warnings or errors from the code). This can be very useful when doing many runs overnight. In this code example, the log is written to the file <code>mainlog.log</code>:</p>
<div class="language-python highlight"><pre><span></span><code><span id="__span-3-1"><a href="#__codelineno-3-1" id="__codelineno-3-1" name="__codelineno-3-1"></a><span class="kn">import</span> <span class="nn">logging</span>
</span><span id="__span-3-2"><a href="#__codelineno-3-2" id="__codelineno-3-2" name="__codelineno-3-2"></a><span class="kn">import</span> <span class="nn">logging.handlers</span>
</span><span id="__span-3-3"><a href="#__codelineno-3-3" id="__codelineno-3-3" name="__codelineno-3-3"></a>
</span><span id="__span-3-4"><a href="#__codelineno-3-4" id="__codelineno-3-4" name="__codelineno-3-4"></a><span class="kn">from</span> <span class="nn">mimosa</span> <span class="kn">import</span> <span class="n">MIMOSA</span><span class="p">,</span> <span class="n">load_params</span>
</span><span id="__span-3-5"><a href="#__codelineno-3-5" id="__codelineno-3-5" name="__codelineno-3-5"></a><span class="hll">
</span></span><span id="__span-3-6"><a href="#__codelineno-3-6" id="__codelineno-3-6" name="__codelineno-3-6"></a><span class="hll"><span class="n">handler</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">handlers</span><span class="o">.</span><span class="n">WatchedFileHandler</span><span class="p">(</span><span class="s2">"mainlog.log"</span><span class="p">)</span>
</span></span><span id="__span-3-7"><a href="#__codelineno-3-7" id="__codelineno-3-7" name="__codelineno-3-7"></a><span class="hll"><span class="n">handler</span><span class="o">.</span><span class="n">setFormatter</span><span class="p">(</span>
</span></span><span id="__span-3-8"><a href="#__codelineno-3-8" id="__codelineno-3-8" name="__codelineno-3-8"></a><span class="hll"> <span class="n">logging</span><span class="o">.</span><span class="n">Formatter</span><span class="p">(</span><span class="s2">"[</span><span class="si">%(levelname)s</span><span class="s2">, </span><span class="si">%(asctime)s</span><span class="s2">] </span><span class="si">%(name)s</span><span class="s2"> - </span><span class="si">%(message)s</span><span class="s2">"</span><span class="p">)</span>
</span></span><span id="__span-3-9"><a href="#__codelineno-3-9" id="__codelineno-3-9" name="__codelineno-3-9"></a><span class="hll"><span class="p">)</span>
</span></span><span id="__span-3-10"><a href="#__codelineno-3-10" id="__codelineno-3-10" name="__codelineno-3-10"></a><span class="hll"><span class="n">root</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">()</span>
</span></span><span id="__span-3-11"><a href="#__codelineno-3-11" id="__codelineno-3-11" name="__codelineno-3-11"></a><span class="hll"><span class="n">root</span><span class="o">.</span><span class="n">setLevel</span><span class="p">(</span><span class="s2">"INFO"</span><span class="p">)</span>
</span></span><span id="__span-3-12"><a href="#__codelineno-3-12" id="__codelineno-3-12" name="__codelineno-3-12"></a><span class="hll"><span class="n">root</span><span class="o">.</span><span class="n">addHandler</span><span class="p">(</span><span class="n">handler</span><span class="p">)</span>
</span></span><span id="__span-3-13"><a href="#__codelineno-3-13" id="__codelineno-3-13" name="__codelineno-3-13"></a><span class="hll">
</span></span><span id="__span-3-14"><a href="#__codelineno-3-14" id="__codelineno-3-14" name="__codelineno-3-14"></a><span class="n">params</span> <span class="o">=</span> <span class="n">load_params</span><span class="p">()</span>
</span><span id="__span-3-15"><a href="#__codelineno-3-15" id="__codelineno-3-15" name="__codelineno-3-15"></a>
</span><span id="__span-3-16"><a href="#__codelineno-3-16" id="__codelineno-3-16" name="__codelineno-3-16"></a><span class="c1"># Make changes to the params if needed</span>
</span><span id="__span-3-17"><a href="#__codelineno-3-17" id="__codelineno-3-17" name="__codelineno-3-17"></a><span class="n">params</span><span class="p">[</span><span class="s2">"emissions"</span><span class="p">][</span><span class="s2">"carbonbudget"</span><span class="p">]</span> <span class="o">=</span> <span class="kc">False</span>
</span><span id="__span-3-18"><a href="#__codelineno-3-18" id="__codelineno-3-18" name="__codelineno-3-18"></a>
</span><span id="__span-3-19"><a href="#__codelineno-3-19" id="__codelineno-3-19" name="__codelineno-3-19"></a><span class="n">model1</span> <span class="o">=</span> <span class="n">MIMOSA</span><span class="p">(</span><span class="n">params</span><span class="p">)</span>
</span><span id="__span-3-20"><a href="#__codelineno-3-20" id="__codelineno-3-20" name="__codelineno-3-20"></a><span class="n">model1</span><span class="o">.</span><span class="n">solve</span><span class="p">(</span><span class="n">verbose</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
</span><span id="__span-3-21"><a href="#__codelineno-3-21" id="__codelineno-3-21" name="__codelineno-3-21"></a><span class="n">model1</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="s2">"run1"</span><span class="p">)</span>
</span></code></pre></div>



Expand Down
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

Binary file modified sitemap.xml.gz
Binary file not shown.

0 comments on commit 1c4451c

Please sign in to comment.