Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
crvernon committed Nov 13, 2023
1 parent d0bae00 commit 193ab88
Show file tree
Hide file tree
Showing 56 changed files with 3,584 additions and 875 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified _images/figure_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 added _images/quickstarter_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 added _images/quickstarter_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 4 additions & 18 deletions _modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,6 @@
Quickstarter
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="../getting-started/tutorial.html">
Tutorial
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading">
<span class="caption-text">
User Guides
</span>
</p>
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="../examples/modify-inputs.html">
Modify Inputs
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading">
<span class="caption-text">
Expand Down Expand Up @@ -220,15 +203,18 @@ <h1></h1>
<div>

<h1>All modules for which code is available</h1>
<ul><li><a href="statemodify/ddm.html">statemodify.ddm</a></li>
<ul><li><a href="statemodify/batch.html">statemodify.batch</a></li>
<li><a href="statemodify/ddm.html">statemodify.ddm</a></li>
<li><a href="statemodify/ddr.html">statemodify.ddr</a></li>
<li><a href="statemodify/eva.html">statemodify.eva</a></li>
<li><a href="statemodify/hmm.html">statemodify.hmm</a></li>
<li><a href="statemodify/modify.html">statemodify.modify</a></li>
<li><a href="statemodify/res.html">statemodify.res</a></li>
<li><a href="statemodify/sampler.html">statemodify.sampler</a></li>
<li><a href="statemodify/utils.html">statemodify.utils</a></li>
<li><a href="statemodify/xbm_iwr.html">statemodify.xbm_iwr</a></li>
<li><a href="statemodify/xdd.html">statemodify.xdd</a></li>
<li><a href="statemodify/xre.html">statemodify.xre</a></li>
</ul>

</div>
Expand Down
514 changes: 514 additions & 0 deletions _modules/statemodify/batch.html

Large diffs are not rendered by default.

21 changes: 2 additions & 19 deletions _modules/statemodify/ddm.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,6 @@
Quickstarter
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="../../getting-started/tutorial.html">
Tutorial
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading">
<span class="caption-text">
User Guides
</span>
</p>
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="../../examples/modify-inputs.html">
Modify Inputs
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading">
<span class="caption-text">
Expand Down Expand Up @@ -231,7 +214,7 @@ <h1>Source code for statemodify.ddm</h1><div class="highlight"><pre>
<span class="kn">import</span> <span class="nn">statemodify.utils</span> <span class="k">as</span> <span class="nn">utx</span>


<span class="k">def</span> <span class="nf">modify_single_ddm</span><span class="p">(</span><span class="n">modify_dict</span><span class="p">:</span> <span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">List</span><span class="p">[</span><span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">float</span><span class="p">]]],</span>
<div class="viewcode-block" id="modify_single_ddm"><a class="viewcode-back" href="../../reference/api.html#statemodify.modify_single_ddm">[docs]</a><span class="k">def</span> <span class="nf">modify_single_ddm</span><span class="p">(</span><span class="n">modify_dict</span><span class="p">:</span> <span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">List</span><span class="p">[</span><span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">float</span><span class="p">]]],</span>
<span class="n">query_field</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="n">output_dir</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="n">scenario</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
Expand Down Expand Up @@ -421,7 +404,7 @@ <h1>Source code for statemodify.ddm</h1><div class="highlight"><pre>
<span class="n">out</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">template_header</span><span class="p">)</span>

<span class="c1"># write data</span>
<span class="n">out</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
<span class="n">out</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">data</span><span class="p">)</span></div>


<div class="viewcode-block" id="modify_ddm"><a class="viewcode-back" href="../../reference/api.html#statemodify.modify_ddm">[docs]</a><span class="k">def</span> <span class="nf">modify_ddm</span><span class="p">(</span><span class="n">modify_dict</span><span class="p">:</span> <span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">List</span><span class="p">[</span><span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">float</span><span class="p">]]],</span>
Expand Down
29 changes: 6 additions & 23 deletions _modules/statemodify/ddr.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,6 @@
Quickstarter
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="../../getting-started/tutorial.html">
Tutorial
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading">
<span class="caption-text">
User Guides
</span>
</p>
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="../../examples/modify-inputs.html">
Modify Inputs
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading">
<span class="caption-text">
Expand Down Expand Up @@ -232,7 +215,7 @@ <h1>Source code for statemodify.ddr</h1><div class="highlight"><pre>
<span class="kn">import</span> <span class="nn">statemodify.utils</span> <span class="k">as</span> <span class="nn">utx</span>


<span class="k">def</span> <span class="nf">apply_on_off_modification</span><span class="p">(</span><span class="n">df</span><span class="p">:</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">,</span>
<div class="viewcode-block" id="apply_on_off_modification"><a class="viewcode-back" href="../../reference/api.html#statemodify.apply_on_off_modification">[docs]</a><span class="k">def</span> <span class="nf">apply_on_off_modification</span><span class="p">(</span><span class="n">df</span><span class="p">:</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">,</span>
<span class="n">modify_dict</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span>
<span class="n">query_field</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Apply on_off modification as specified by the user. Used with the water demand (.ddr) modification.</span>
Expand All @@ -256,10 +239,10 @@ <h1>Source code for statemodify.ddr</h1><div class="highlight"><pre>
<span class="c1"># update existing value with value from dictionary</span>
<span class="n">df</span><span class="o">.</span><span class="n">loc</span><span class="p">[</span><span class="n">df</span><span class="p">[</span><span class="n">query_field</span><span class="p">]</span> <span class="o">==</span> <span class="n">target_id</span><span class="p">,</span> <span class="s2">&quot;on_off&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">modify_dict</span><span class="p">[</span><span class="s2">&quot;on_off&quot;</span><span class="p">][</span><span class="n">index</span><span class="p">]</span>

<span class="k">return</span> <span class="n">df</span>
<span class="k">return</span> <span class="n">df</span></div>


<span class="k">def</span> <span class="nf">apply_seniority_modification</span><span class="p">(</span><span class="n">df</span><span class="p">:</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">,</span>
<div class="viewcode-block" id="apply_seniority_modification"><a class="viewcode-back" href="../../reference/api.html#statemodify.apply_seniority_modification">[docs]</a><span class="k">def</span> <span class="nf">apply_seniority_modification</span><span class="p">(</span><span class="n">df</span><span class="p">:</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">,</span>
<span class="n">modify_dict</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span>
<span class="n">query_field</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Apply seniority modification as specified by the user. Used with the water demand (.ddr) modification.</span>
Expand Down Expand Up @@ -303,10 +286,10 @@ <h1>Source code for statemodify.ddr</h1><div class="highlight"><pre>
<span class="c1"># update existing value with value from dictionary</span>
<span class="n">df</span><span class="o">.</span><span class="n">loc</span><span class="p">[</span><span class="n">df</span><span class="p">[</span><span class="n">query_field</span><span class="p">]</span> <span class="o">==</span> <span class="n">target_id</span><span class="p">,</span> <span class="s2">&quot;admin&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">set_value</span>

<span class="k">return</span> <span class="n">df</span>
<span class="k">return</span> <span class="n">df</span></div>


<span class="k">def</span> <span class="nf">modify_single_ddr</span><span class="p">(</span><span class="n">modify_dict</span><span class="p">:</span> <span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">List</span><span class="p">[</span><span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">float</span><span class="p">]]],</span>
<div class="viewcode-block" id="modify_single_ddr"><a class="viewcode-back" href="../../reference/api.html#statemodify.modify_single_ddr">[docs]</a><span class="k">def</span> <span class="nf">modify_single_ddr</span><span class="p">(</span><span class="n">modify_dict</span><span class="p">:</span> <span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">List</span><span class="p">[</span><span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">float</span><span class="p">]]],</span>
<span class="n">query_field</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="n">output_dir</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="n">scenario</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
Expand Down Expand Up @@ -547,7 +530,7 @@ <h1>Source code for statemodify.ddr</h1><div class="highlight"><pre>
<span class="n">out</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">template_header</span><span class="p">)</span>

<span class="c1"># write data</span>
<span class="n">out</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
<span class="n">out</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">data</span><span class="p">)</span></div>


<div class="viewcode-block" id="modify_ddr"><a class="viewcode-back" href="../../reference/api.html#statemodify.modify_ddr">[docs]</a><span class="k">def</span> <span class="nf">modify_ddr</span><span class="p">(</span><span class="n">modify_dict</span><span class="p">:</span> <span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">List</span><span class="p">[</span><span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">float</span><span class="p">]]],</span>
Expand Down
17 changes: 0 additions & 17 deletions _modules/statemodify/eva.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,6 @@
Quickstarter
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="../../getting-started/tutorial.html">
Tutorial
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading">
<span class="caption-text">
User Guides
</span>
</p>
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="../../examples/modify-inputs.html">
Modify Inputs
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading">
<span class="caption-text">
Expand Down
27 changes: 5 additions & 22 deletions _modules/statemodify/hmm.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,6 @@
Quickstarter
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="../../getting-started/tutorial.html">
Tutorial
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading">
<span class="caption-text">
User Guides
</span>
</p>
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="../../examples/modify-inputs.html">
Modify Inputs
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading">
<span class="caption-text">
Expand Down Expand Up @@ -276,11 +259,11 @@ <h1>Source code for statemodify.hmm</h1><div class="highlight"><pre>
<span class="k">if</span> <span class="n">output_directory</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;If saving parameters you must pass a valid path to `output_directory&#39;&quot;</span><span class="p">)</span>

<span class="n">np</span><span class="o">.</span><span class="n">savetxt</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">output_directory</span><span class="p">,</span> <span class="s1">&#39;dry_state_means.txt&#39;</span><span class="p">,</span> <span class="n">dry_state_means</span><span class="p">))</span>
<span class="n">np</span><span class="o">.</span><span class="n">savetxt</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">output_directory</span><span class="p">,</span> <span class="s1">&#39;wet_state_means.txt&#39;</span><span class="p">,</span> <span class="n">wet_state_means</span><span class="p">))</span>
<span class="n">np</span><span class="o">.</span><span class="n">savetxt</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">output_directory</span><span class="p">,</span> <span class="s1">&#39;covariance_matrix_dry.txt&#39;</span><span class="p">,</span> <span class="n">covariance_matrix_dry</span><span class="p">))</span>
<span class="n">np</span><span class="o">.</span><span class="n">savetxt</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">output_directory</span><span class="p">,</span> <span class="s1">&#39;covariance_matrix_wet.txt&#39;</span><span class="p">,</span> <span class="n">covariance_matrix_wet</span><span class="p">))</span>
<span class="n">np</span><span class="o">.</span><span class="n">savetxt</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">output_directory</span><span class="p">,</span> <span class="s1">&#39;transition_matrix.txt&#39;</span><span class="p">,</span> <span class="n">transition_matrix</span><span class="p">))</span>
<span class="n">np</span><span class="o">.</span><span class="n">savetxt</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">output_directory</span><span class="p">,</span> <span class="s1">&#39;dry_state_means.txt&#39;</span><span class="p">),</span> <span class="n">dry_state_means</span><span class="p">)</span>
<span class="n">np</span><span class="o">.</span><span class="n">savetxt</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">output_directory</span><span class="p">,</span> <span class="s1">&#39;wet_state_means.txt&#39;</span><span class="p">),</span> <span class="n">wet_state_means</span><span class="p">)</span>
<span class="n">np</span><span class="o">.</span><span class="n">savetxt</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">output_directory</span><span class="p">,</span> <span class="s1">&#39;covariance_matrix_dry.txt&#39;</span><span class="p">),</span> <span class="n">covariance_matrix_dry</span><span class="p">)</span>
<span class="n">np</span><span class="o">.</span><span class="n">savetxt</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">output_directory</span><span class="p">,</span> <span class="s1">&#39;covariance_matrix_wet.txt&#39;</span><span class="p">),</span> <span class="n">covariance_matrix_wet</span><span class="p">)</span>
<span class="n">np</span><span class="o">.</span><span class="n">savetxt</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">output_directory</span><span class="p">,</span> <span class="s1">&#39;transition_matrix.txt&#39;</span><span class="p">),</span> <span class="n">transition_matrix</span><span class="p">)</span>

<span class="c1"># calculate stationary distribution to determine unconditional probabilities</span>
<span class="n">eigenvals</span><span class="p">,</span> <span class="n">eigenvecs</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">eig</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">transpose</span><span class="p">(</span><span class="n">transition_matrix</span><span class="p">))</span>
Expand Down
17 changes: 0 additions & 17 deletions _modules/statemodify/modify.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,6 @@
Quickstarter
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="../../getting-started/tutorial.html">
Tutorial
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading">
<span class="caption-text">
User Guides
</span>
</p>
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="../../examples/modify-inputs.html">
Modify Inputs
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading">
<span class="caption-text">
Expand Down
Loading

0 comments on commit 193ab88

Please sign in to comment.