Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Aug 5, 2024
1 parent 617e209 commit e7c5749
Show file tree
Hide file tree
Showing 53 changed files with 3,288 additions and 2,402 deletions.
Binary file not shown.
3 changes: 3 additions & 0 deletions _downloads/1af86ac96b6768aeeb7f604be5cc95fe/bdsim-blocks-2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import matplotlib.pyplot as plt
plt.plot([0, 2, 5], [-1, -1, 5], lw=2)
plt.grid(True)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions _downloads/4deb6fea2461a9ca377ae7c44f944e9c/bdsim-blocks-3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import matplotlib.pyplot as plt
plt.plot([0, 2, 2, 5], [-1, -1, 1, 1], lw=2)
plt.grid(True)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions _downloads/a05c513c6d3e3865ec71cfc224b47cde/bdsim-blocks-1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import matplotlib.pyplot as plt
plt.plot([0, 2, 2, 3, 3, 4, 4, 5, 5, 5.2],
[0, 0, 0.5, 0.5, 0, 0, -0.5, -0.5, 0, 0], lw=2)
plt.grid(True)
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions _downloads/d6f75e3f2207f57b04a59ef68aa6b083/bdsim-blocks-4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import matplotlib.pyplot as plt
plt.plot([0, 5, 10],
[0, 1, 0], lw=2)
plt.grid(True)
plt.xlabel("in[0]")
plt.ylabel("out[0]")
Binary file modified _images/bdsim-blocks-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 _images/bdsim-blocks-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 _images/bdsim-blocks-3.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 _images/bdsim-blocks-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
147 changes: 111 additions & 36 deletions _modules/bdsim/blockdiagram.html

Large diffs are not rendered by default.

107 changes: 79 additions & 28 deletions _modules/bdsim/blocks/connections.html

Large diffs are not rendered by default.

76 changes: 53 additions & 23 deletions _modules/bdsim/blocks/discrete.html

Large diffs are not rendered by default.

79 changes: 50 additions & 29 deletions _modules/bdsim/blocks/displays.html

Large diffs are not rendered by default.

95 changes: 70 additions & 25 deletions _modules/bdsim/blocks/functions.html

Large diffs are not rendered by default.

105 changes: 78 additions & 27 deletions _modules/bdsim/blocks/linalg.html

Large diffs are not rendered by default.

67 changes: 47 additions & 20 deletions _modules/bdsim/blocks/sinks.html

Large diffs are not rendered by default.

85 changes: 62 additions & 23 deletions _modules/bdsim/blocks/sources.html

Large diffs are not rendered by default.

65 changes: 46 additions & 19 deletions _modules/bdsim/blocks/spatial.html

Large diffs are not rendered by default.

99 changes: 71 additions & 28 deletions _modules/bdsim/blocks/transfers.html

Large diffs are not rendered by default.

468 changes: 363 additions & 105 deletions _modules/bdsim/components.html

Large diffs are not rendered by default.

62 changes: 43 additions & 19 deletions _modules/bdsim/graphics.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<html class="writer-html5" lang="en" data-content_root="../../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>bdsim.graphics &mdash; Block diagram simulation documentation</title>
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/plot_directive.css" type="text/css" />
<link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=80d5e7a1" />
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="../../_static/plot_directive.css" />
<link rel="stylesheet" type="text/css" href="../../_static/graphviz.css?v=fd3f3429" />


<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->

<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/jquery.js?v=5d32c60e"></script>
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../../_static/documentation_options.js?v=5929fcd5"></script>
<script src="../../_static/doctools.js?v=9a2dae69"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
Expand All @@ -34,7 +37,7 @@
<img src="../../_static/BDSimLogo_NoBackgnd@2x.png" class="logo" alt="Logo"/>
</a>
<div class="version">
1.1.1
1.1.2
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
Expand Down Expand Up @@ -83,15 +86,19 @@ <h1>Source code for bdsim.graphics</h1><div class="highlight"><pre>
<span class="kn">from</span> <span class="nn">bdsim.components</span> <span class="kn">import</span> <span class="n">SinkBlock</span>


<div class="viewcode-block" id="GraphicsBlock"><a class="viewcode-back" href="../../internals.html#bdsim.GraphicsBlock">[docs]</a><span class="k">class</span> <span class="nc">GraphicsBlock</span><span class="p">(</span><span class="n">SinkBlock</span><span class="p">):</span>
<div class="viewcode-block" id="GraphicsBlock">
<a class="viewcode-back" href="../../internals.html#bdsim.GraphicsBlock">[docs]</a>
<span class="k">class</span> <span class="nc">GraphicsBlock</span><span class="p">(</span><span class="n">SinkBlock</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> A GraphicsBlock is a subclass of SinkBlock that represents a block that has inputs</span>
<span class="sd"> but no outputs and creates/updates a graphical display.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="n">blockclass</span> <span class="o">=</span> <span class="s2">&quot;graphics&quot;</span>

<div class="viewcode-block" id="GraphicsBlock.__init__"><a class="viewcode-back" href="../../internals.html#bdsim.GraphicsBlock.__init__">[docs]</a> <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">movie</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">blockargs</span><span class="p">):</span>
<div class="viewcode-block" id="GraphicsBlock.__init__">
<a class="viewcode-back" href="../../internals.html#bdsim.GraphicsBlock.__init__">[docs]</a>
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">movie</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">blockargs</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Create a graphical display block.</span>

Expand All @@ -110,7 +117,10 @@ <h1>Source code for bdsim.graphics</h1><div class="highlight"><pre>

<span class="bp">self</span><span class="o">.</span><span class="n">movie</span> <span class="o">=</span> <span class="n">movie</span></div>

<div class="viewcode-block" id="GraphicsBlock.start"><a class="viewcode-back" href="../../internals.html#bdsim.GraphicsBlock.start">[docs]</a> <span class="k">def</span> <span class="nf">start</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">simstate</span><span class="p">):</span>

<div class="viewcode-block" id="GraphicsBlock.start">
<a class="viewcode-back" href="../../internals.html#bdsim.GraphicsBlock.start">[docs]</a>
<span class="k">def</span> <span class="nf">start</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">simstate</span><span class="p">):</span>

<span class="c1"># plt.draw()</span>
<span class="c1"># plt.show(block=False)</span>
Expand All @@ -133,7 +143,10 @@ <h1>Source code for bdsim.graphics</h1><div class="highlight"><pre>
<span class="k">except</span> <span class="ne">FileNotFoundError</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">fatal</span><span class="p">(</span><span class="s2">&quot;cannot save movie, please install ffmpeg&quot;</span><span class="p">)</span></div>

<div class="viewcode-block" id="GraphicsBlock.step"><a class="viewcode-back" href="../../internals.html#bdsim.GraphicsBlock.step">[docs]</a> <span class="k">def</span> <span class="nf">step</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">t</span><span class="p">,</span> <span class="n">inports</span><span class="p">):</span>

<div class="viewcode-block" id="GraphicsBlock.step">
<a class="viewcode-back" href="../../internals.html#bdsim.GraphicsBlock.step">[docs]</a>
<span class="k">def</span> <span class="nf">step</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">t</span><span class="p">,</span> <span class="n">inports</span><span class="p">):</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">step</span><span class="p">(</span><span class="n">t</span><span class="p">,</span> <span class="n">inports</span><span class="p">)</span>

<span class="c1"># bring the figure up to date in a backend-specific way</span>
Expand All @@ -154,15 +167,21 @@ <h1>Source code for bdsim.graphics</h1><div class="highlight"><pre>
<span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">fatal</span><span class="p">(</span><span class="s2">&quot;cannot save movie, please install ffmpeg&quot;</span><span class="p">)</span></div>

<div class="viewcode-block" id="GraphicsBlock.done"><a class="viewcode-back" href="../../internals.html#bdsim.GraphicsBlock.done">[docs]</a> <span class="k">def</span> <span class="nf">done</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">block</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>

<div class="viewcode-block" id="GraphicsBlock.done">
<a class="viewcode-back" href="../../internals.html#bdsim.GraphicsBlock.done">[docs]</a>
<span class="k">def</span> <span class="nf">done</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">block</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">fig</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">fig</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">start_event_loop</span><span class="p">(</span><span class="mf">0.001</span><span class="p">)</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">movie</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">writer</span><span class="o">.</span><span class="n">finish</span><span class="p">()</span>
<span class="c1"># self.cleanup()</span>
<span class="n">plt</span><span class="o">.</span><span class="n">show</span><span class="p">(</span><span class="n">block</span><span class="o">=</span><span class="n">block</span><span class="p">)</span></div>

<div class="viewcode-block" id="GraphicsBlock.savefig"><a class="viewcode-back" href="../../internals.html#bdsim.GraphicsBlock.savefig">[docs]</a> <span class="k">def</span> <span class="nf">savefig</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">filename</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="nb">format</span><span class="o">=</span><span class="s2">&quot;pdf&quot;</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>

<div class="viewcode-block" id="GraphicsBlock.savefig">
<a class="viewcode-back" href="../../internals.html#bdsim.GraphicsBlock.savefig">[docs]</a>
<span class="k">def</span> <span class="nf">savefig</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">filename</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="nb">format</span><span class="o">=</span><span class="s2">&quot;pdf&quot;</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Save the figure as an image file</span>

Expand All @@ -184,7 +203,10 @@ <h1>Source code for bdsim.graphics</h1><div class="highlight"><pre>
<span class="k">except</span><span class="p">:</span>
<span class="k">pass</span></div>

<div class="viewcode-block" id="GraphicsBlock.create_figure"><a class="viewcode-back" href="../../internals.html#bdsim.GraphicsBlock.create_figure">[docs]</a> <span class="k">def</span> <span class="nf">create_figure</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">):</span>

<div class="viewcode-block" id="GraphicsBlock.create_figure">
<a class="viewcode-back" href="../../internals.html#bdsim.GraphicsBlock.create_figure">[docs]</a>
<span class="k">def</span> <span class="nf">create_figure</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">move_figure</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Move figure&#39;s upper left corner to pixel (x, y)&quot;&quot;&quot;</span>
<span class="n">backend</span> <span class="o">=</span> <span class="n">matplotlib</span><span class="o">.</span><span class="n">get_backend</span><span class="p">()</span>
Expand Down Expand Up @@ -358,7 +380,9 @@ <h1>Source code for bdsim.graphics</h1><div class="highlight"><pre>
<span class="bp">self</span><span class="o">.</span><span class="n">bd</span><span class="o">.</span><span class="n">runtime</span><span class="o">.</span><span class="n">DEBUG</span><span class="p">(</span>
<span class="s2">&quot;graphics&quot;</span><span class="p">,</span> <span class="s2">&quot;create figure </span><span class="si">{:d}</span><span class="s2"> at (</span><span class="si">{:d}</span><span class="s2">, </span><span class="si">{:d}</span><span class="s2">)&quot;</span><span class="p">,</span> <span class="n">gstate</span><span class="o">.</span><span class="n">fignum</span><span class="p">,</span> <span class="n">row</span><span class="p">,</span> <span class="n">col</span>
<span class="p">)</span>
<span class="k">return</span> <span class="n">f</span></div></div>
<span class="k">return</span> <span class="n">f</span></div>
</div>

</pre></div>

</div>
Expand All @@ -369,7 +393,7 @@ <h1>Source code for bdsim.graphics</h1><div class="highlight"><pre>

<div role="contentinfo">
<p>&#169; Copyright 2020-, Peter Corke..
<span class="lastupdated">Last updated on 12-Nov-2023.
<span class="lastupdated">Last updated on 05-Aug-2024.
</span></p>
</div>

Expand Down
Loading

0 comments on commit e7c5749

Please sign in to comment.