Skip to content

Commit

Permalink
updates for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPatrie committed Sep 23, 2024
1 parent d733660 commit 7b50507
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 2 deletions.
Binary file modified documentation/build/doctrees/bio_compose.doctree
Binary file not shown.
Binary file modified documentation/build/doctrees/environment.pickle
Binary file not shown.
21 changes: 20 additions & 1 deletion documentation/build/html/_modules/bio_compose/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ <h1>Source code for bio_compose.api</h1><div class="highlight"><pre>
<span class="n">buffer_time</span> <span class="o">=</span> <span class="mi">5</span>
<span class="n">poll_time</span> <span class="o">=</span> <span class="mi">5</span>
<span class="n">submission_generator</span> <span class="o">=</span> <span class="n">verifier</span><span class="o">.</span><span class="n">verify_sbml</span> <span class="k">if</span> <span class="n">run_sbml</span> <span class="k">else</span> <span class="n">verifier</span><span class="o">.</span><span class="n">verify_omex</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Submitting verification...&quot;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Submitting verification...&quot;</span><span class="p">,</span> <span class="n">end</span><span class="o">=</span><span class="s1">&#39;</span><span class="se">\r</span><span class="s1">&#39;</span><span class="p">)</span>
<span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="n">buffer_time</span><span class="p">)</span>

<span class="c1"># fetch params</span>
Expand Down Expand Up @@ -259,6 +259,25 @@ <h1>Source code for bio_compose.api</h1><div class="highlight"><pre>
<span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
<span class="k">return</span> <span class="n">SimulationResult</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">output</span><span class="p">)</span></div>



<div class="viewcode-block" id="visualize_observables">
<a class="viewcode-back" href="../../bio_compose.html#bio_compose.api.visualize_observables">[docs]</a>
<span class="k">def</span> <span class="nf">visualize_observables</span><span class="p">(</span><span class="n">job_id</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">save_dest</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="n">hspace</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">0.25</span><span class="p">,</span> <span class="n">use_grid</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Visualize simulation output (observables) data, not comparison data, with subplots for each species.</span>

<span class="sd"> :param job_id: (`str`) job id for the simulation observable output you wish to visualize.</span>
<span class="sd"> :param save_dest: (`str`) path to save the figure. If this value is passed, the figure will be saved in pdf format to this location.</span>
<span class="sd"> :param hspace: (`float`) horizontal spacing between subplots. Defaults to 0.25.</span>
<span class="sd"> :param use_grid: (`bool`) whether to use a grid for each subplot. Defaults to False.</span>
<span class="sd"> </span>
<span class="sd"> :rtype: `Tuple[matplotlib.Figure, Dict]` </span>
<span class="sd"> :return: matplotlib Figure and simulation observables indexed by simulator</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">API_VERIFIER</span><span class="o">.</span><span class="n">visualize_observables</span><span class="p">(</span><span class="n">job_id</span><span class="o">=</span><span class="n">job_id</span><span class="p">,</span> <span class="n">save_dest</span><span class="o">=</span><span class="n">save_dest</span><span class="p">,</span> <span class="n">hspace</span><span class="o">=</span><span class="n">hspace</span><span class="p">,</span> <span class="n">use_grid</span><span class="o">=</span><span class="n">use_grid</span><span class="p">)</span></div>


</pre></div>

</div>
Expand Down
10 changes: 10 additions & 0 deletions documentation/build/html/_modules/bio_compose/verifier.html
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,14 @@ <h1>Source code for bio_compose.verifier</h1><div class="highlight"><pre>
<span class="n">observables</span> <span class="o">=</span> <span class="p">[</span><span class="n">key</span> <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">species_data_content</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span> <span class="k">if</span> <span class="n">key</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">excluded_observables</span><span class="p">]</span>
<span class="n">first_observable</span> <span class="o">=</span> <span class="n">species_data_content</span><span class="p">[</span><span class="n">observables</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span>
<span class="n">simulators</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">first_observable</span><span class="p">[</span><span class="s1">&#39;output_data&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span>

<span class="c1"># post-process to handle any strings (errors)</span>
<span class="k">for</span> <span class="n">sim</span> <span class="ow">in</span> <span class="n">simulators</span><span class="p">:</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">first_observable</span><span class="p">[</span><span class="s1">&#39;output_data&#39;</span><span class="p">][</span><span class="n">sim</span><span class="p">]</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
<span class="n">simulators</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">sim</span><span class="p">)</span>

<span class="c1"># count post processed sims</span>
<span class="n">n_simulators</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">simulators</span><span class="p">)</span>

<span class="c1"># create subplots</span>
Expand All @@ -396,6 +404,8 @@ <h1>Source code for bio_compose.verifier</h1><div class="highlight"><pre>
<span class="n">ax</span> <span class="o">=</span> <span class="n">axes</span><span class="p">[</span><span class="n">idx</span><span class="p">]</span>
<span class="k">for</span> <span class="n">observable</span> <span class="ow">in</span> <span class="n">observables</span><span class="p">:</span>
<span class="n">value_data</span> <span class="o">=</span> <span class="n">species_data_content</span><span class="p">[</span><span class="n">observable</span><span class="p">][</span><span class="s1">&#39;output_data&#39;</span><span class="p">][</span><span class="n">simulator</span><span class="p">]</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value_data</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
<span class="k">continue</span>
<span class="n">obs</span><span class="p">[</span><span class="n">observable</span><span class="p">][</span><span class="n">simulator</span><span class="p">]</span> <span class="o">=</span> <span class="n">value_data</span>
<span class="n">sns</span><span class="o">.</span><span class="n">lineplot</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">value_data</span><span class="p">,</span> <span class="n">ax</span><span class="o">=</span><span class="n">ax</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="n">observable</span><span class="p">)</span>

Expand Down
23 changes: 23 additions & 0 deletions documentation/build/html/bio_compose.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<li class="toctree-l3"><a class="reference internal" href="#bio_compose.api.get_output"><code class="docutils literal notranslate"><span class="pre">get_output()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#bio_compose.api.run_simulation"><code class="docutils literal notranslate"><span class="pre">run_simulation()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#bio_compose.api.verify"><code class="docutils literal notranslate"><span class="pre">verify()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#bio_compose.api.visualize_observables"><code class="docutils literal notranslate"><span class="pre">visualize_observables()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-bio_compose.bundles">bio_compose.bundles</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#bio_compose.bundles.BioBundle"><code class="docutils literal notranslate"><span class="pre">BioBundle</span></code></a></li>
</ul>
Expand Down Expand Up @@ -213,6 +214,28 @@
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="bio_compose.api.visualize_observables">
<span class="sig-prename descclassname"><span class="pre">bio_compose.api.</span></span><span class="sig-name descname"><span class="pre">visualize_observables</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">job_id</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">save_dest</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">hspace</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">0.25</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">use_grid</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/bio_compose/api.html#visualize_observables"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#bio_compose.api.visualize_observables" title="Link to this definition"></a></dt>
<dd><p>Visualize simulation output (observables) data, not comparison data, with subplots for each species.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>job_id</strong> – (<cite>str</cite>) job id for the simulation observable output you wish to visualize.</p></li>
<li><p><strong>save_dest</strong> – (<cite>str</cite>) path to save the figure. If this value is passed, the figure will be saved in pdf format to this location.</p></li>
<li><p><strong>hspace</strong> – (<cite>float</cite>) horizontal spacing between subplots. Defaults to 0.25.</p></li>
<li><p><strong>use_grid</strong> – (<cite>bool</cite>) whether to use a grid for each subplot. Defaults to False.</p></li>
</ul>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><cite>Tuple[matplotlib.Figure, Dict]</cite></p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>matplotlib Figure and simulation observables indexed by simulator</p>
</dd>
</dl>
</dd></dl>

<section id="module-bio_compose.bundles">
<span id="bio-compose-bundles"></span><h2>bio_compose.bundles<a class="headerlink" href="#module-bio_compose.bundles" title="Link to this heading"></a></h2>
<dl class="py class">
Expand Down
2 changes: 2 additions & 0 deletions documentation/build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ <h2 id="V">V</h2>

<ul>
<li><a href="bio_compose.html#bio_compose.verifier.Verifier.visualize_observables">(bio_compose.verifier.Verifier method)</a>
</li>
<li><a href="bio_compose.html#bio_compose.api.visualize_observables">(in module bio_compose.api)</a>
</li>
</ul></li>
<li><a href="bio_compose.html#bio_compose.verifier.Verifier.visualize_rmse">visualize_rmse() (bio_compose.verifier.Verifier method)</a>
Expand Down
1 change: 1 addition & 0 deletions documentation/build/html/modules.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ <h1>API Documentation<a class="headerlink" href="#api-documentation" title="Link
<li class="toctree-l2"><a class="reference internal" href="bio_compose.html#bio_compose.api.get_output"><code class="docutils literal notranslate"><span class="pre">get_output()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="bio_compose.html#bio_compose.api.run_simulation"><code class="docutils literal notranslate"><span class="pre">run_simulation()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="bio_compose.html#bio_compose.api.verify"><code class="docutils literal notranslate"><span class="pre">verify()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="bio_compose.html#bio_compose.api.visualize_observables"><code class="docutils literal notranslate"><span class="pre">visualize_observables()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="bio_compose.html#module-bio_compose.bundles">bio_compose.bundles</a><ul>
<li class="toctree-l3"><a class="reference internal" href="bio_compose.html#bio_compose.bundles.BioBundle"><code class="docutils literal notranslate"><span class="pre">BioBundle</span></code></a><ul>
<li class="toctree-l4"><a class="reference internal" href="bio_compose.html#bio_compose.bundles.BioBundle.add_emitter_node"><code class="docutils literal notranslate"><span class="pre">BioBundle.add_emitter_node()</span></code></a></li>
Expand Down
Binary file modified documentation/build/html/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion documentation/build/html/searchindex.js

Large diffs are not rendered by default.

0 comments on commit 7b50507

Please sign in to comment.