Skip to content

Commit

Permalink
Documentation updates for version 0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoFara committed Jul 14, 2021
1 parent adb445c commit 2c4848e
Show file tree
Hide file tree
Showing 18 changed files with 146 additions and 118 deletions.
2 changes: 1 addition & 1 deletion docs/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '0.5.0',
VERSION: '0.5.1',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
2 changes: 1 addition & 1 deletion docs/api/exceptions.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>exceptions &mdash; pylinkage 0.5.0 documentation</title>
<title>exceptions &mdash; pylinkage 0.5.1 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion docs/api/geometry.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>geometry &mdash; pylinkage 0.5.0 documentation</title>
<title>geometry &mdash; pylinkage 0.5.1 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion docs/api/linkage.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>linkage &mdash; pylinkage 0.5.0 documentation</title>
<title>linkage &mdash; pylinkage 0.5.1 documentation</title>



Expand Down
8 changes: 7 additions & 1 deletion docs/api/optimizer.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>optimizer &mdash; pylinkage 0.5.0 documentation</title>
<title>optimizer &mdash; pylinkage 0.5.1 documentation</title>



Expand Down Expand Up @@ -230,6 +230,12 @@ <h1>optimizer<a class="headerlink" href="#optimizer" title="Permalink to this he
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pylinkage.optimizer.tqdm_verbosity">
<span class="sig-prename descclassname"><span class="pre">pylinkage.optimizer.</span></span><span class="sig-name descname"><span class="pre">tqdm_verbosity</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">iterable</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbose</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pylinkage.optimizer.tqdm_verbosity" title="Permalink to this definition"></a></dt>
<dd><p>Wrapper for tqdm, that let you specify if you want verbosity.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pylinkage.optimizer.trials_and_errors_optimization">
<span class="sig-prename descclassname"><span class="pre">pylinkage.optimizer.</span></span><span class="sig-name descname"><span class="pre">trials_and_errors_optimization</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">eval_func</span></em>, <em class="sig-param"><span class="pre">linkage</span></em>, <em class="sig-param"><span class="pre">parameters=None</span></em>, <em class="sig-param"><span class="pre">n_results=10</span></em>, <em class="sig-param"><span class="pre">divisions=5</span></em>, <em class="sig-param"><span class="pre">bounds=None</span></em>, <em class="sig-param"><span class="pre">order_relation=&lt;built-in</span> <span class="pre">function</span> <span class="pre">max&gt;</span></em>, <em class="sig-param"><span class="pre">verbose=True</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pylinkage.optimizer.trials_and_errors_optimization" title="Permalink to this definition"></a></dt>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/utility.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>utility &mdash; pylinkage 0.5.0 documentation</title>
<title>utility &mdash; pylinkage 0.5.1 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion docs/api/visualizer.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>visualizer &mdash; pylinkage 0.5.0 documentation</title>
<title>visualizer &mdash; pylinkage 0.5.1 documentation</title>



Expand Down
165 changes: 93 additions & 72 deletions docs/changeloglink.html

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Index &mdash; pylinkage 0.5.0 documentation</title>
<title>Index &mdash; pylinkage 0.5.1 documentation</title>



Expand Down Expand Up @@ -551,6 +551,10 @@ <h2 id="S">S</h2>

<h2 id="T">T</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="api/optimizer.html#pylinkage.optimizer.tqdm_verbosity">tqdm_verbosity() (in module pylinkage.optimizer)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="api/optimizer.html#pylinkage.optimizer.trials_and_errors_optimization">trials_and_errors_optimization() (in module pylinkage.optimizer)</a>
</li>
Expand Down
35 changes: 18 additions & 17 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Welcome to pylinkage’s documentation! &mdash; pylinkage 0.5.0 documentation</title>
<title>Welcome to pylinkage’s documentation! &mdash; pylinkage 0.5.1 documentation</title>



Expand Down Expand Up @@ -169,14 +169,15 @@ <h1>Welcome to pylinkage’s documentation!<a class="headerlink" href="#welcome-
</li>
<li class="toctree-l1"><a class="reference internal" href="changeloglink.html">Changelog</a><ul>
<li class="toctree-l2"><a class="reference internal" href="changeloglink.html#unreleased">[Unreleased]</a></li>
<li class="toctree-l2"><a class="reference internal" href="changeloglink.html#id1">[0.5.0] - 2021-07-12</a></li>
<li class="toctree-l2"><a class="reference internal" href="changeloglink.html#id2">[0.4.1] - 2021-07-11</a></li>
<li class="toctree-l2"><a class="reference internal" href="changeloglink.html#id5">[0.4.0] - 2021-07-06</a></li>
<li class="toctree-l2"><a class="reference internal" href="changeloglink.html#id9">[0.3.0] - 2021-07-05</a></li>
<li class="toctree-l2"><a class="reference internal" href="changeloglink.html#id13">[0.2.2] - 2021-06-22</a></li>
<li class="toctree-l2"><a class="reference internal" href="changeloglink.html#id16">[0.2.1] - 2021-06-16</a></li>
<li class="toctree-l2"><a class="reference internal" href="changeloglink.html#id20">[0.2.0] - 2021-06-14</a></li>
<li class="toctree-l2"><a class="reference internal" href="changeloglink.html#id23">[0.0.1] - 2021-06-12</a></li>
<li class="toctree-l2"><a class="reference internal" href="changeloglink.html#id1">[0.5.1] - 2021-07-14</a></li>
<li class="toctree-l2"><a class="reference internal" href="changeloglink.html#id2">[0.5.0] - 2021-07-12</a></li>
<li class="toctree-l2"><a class="reference internal" href="changeloglink.html#id5">[0.4.1] - 2021-07-11</a></li>
<li class="toctree-l2"><a class="reference internal" href="changeloglink.html#id8">[0.4.0] - 2021-07-06</a></li>
<li class="toctree-l2"><a class="reference internal" href="changeloglink.html#id12">[0.3.0] - 2021-07-05</a></li>
<li class="toctree-l2"><a class="reference internal" href="changeloglink.html#id16">[0.2.2] - 2021-06-22</a></li>
<li class="toctree-l2"><a class="reference internal" href="changeloglink.html#id19">[0.2.1] - 2021-06-16</a></li>
<li class="toctree-l2"><a class="reference internal" href="changeloglink.html#id23">[0.2.0] - 2021-06-14</a></li>
<li class="toctree-l2"><a class="reference internal" href="changeloglink.html#id26">[0.0.1] - 2021-06-12</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="api/geometry.html">geometry</a><ul>
Expand Down Expand Up @@ -206,7 +207,7 @@ <h1>Welcome to pylinkage’s documentation!<a class="headerlink" href="#welcome-
</ul>
</div>
<a class="reference external image-reference" href="https://pypi.python.org/pypi/pylinkage/"><img alt="PyPI version fury.io" src="https://badge.fury.io/py/pylinkage.svg" /></a>
<a class="reference external image-reference" href="https://raw.githubusercontent.com/HugoFara/leggedsnake/main/LICENSE.rst"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue.svg" /></a>
<a class="reference external image-reference" href="https://raw.githubusercontent.com/HugoFara/leggedsnake/master/LICENSE.rst"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue.svg" /></a>
</div>
<div class="section" id="pylinkage">
<h1>pylinkage<a class="headerlink" href="#pylinkage" title="Permalink to this headline"></a></h1>
Expand All @@ -217,31 +218,31 @@ <h2>Installation<a class="headerlink" href="#installation" title="Permalink to t
<h3>Using pip<a class="headerlink" href="#using-pip" title="Permalink to this headline"></a></h3>
<p>This package is in the PyPi as <a class="reference external" href="https://pypi.org/project/pylinkage/">pylinkage</a>, and can be installed using:
<code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">pylinkage</span></code></p>
<p>It is the recommended way downloading it, since the release versions are synced.</p>
<p>It is the recommended way of downloading it.</p>
</div>
<div class="section" id="setting-up-virtual-environment">
<h3>Setting up Virtual Environment<a class="headerlink" href="#setting-up-virtual-environment" title="Permalink to this headline"></a></h3>
<p>We provide an <a class="reference external" href="https://github.com/HugoFara/leggedsnake/environment.yml">environment.yml</a> file for conda. Use <code class="docutils literal notranslate"><span class="pre">conda</span> <span class="pre">env</span> <span class="pre">update</span> <span class="pre">--file</span> <span class="pre">environment.yml</span> <span class="pre">--name</span> <span class="pre">pylinkage-env</span></code> to install the requirements in a separate environment.</p>
<p>We provide an <a class="reference external" href="https://github.com/HugoFara/leggedsnake/blob/master/environment.yml">environment.yml</a> file for conda. Use <code class="docutils literal notranslate"><span class="pre">conda</span> <span class="pre">env</span> <span class="pre">update</span> <span class="pre">--file</span> <span class="pre">environment.yml</span> <span class="pre">--name</span> <span class="pre">pylinkage-env</span></code> to install the requirements in a separate environment.</p>
</div>
</div>
<div class="section" id="usage">
<h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline"></a></h2>
<p>As of today, the code is segmented in three parts:</p>
<ul class="simple">
<li><p><a class="reference external" href="https://github.com/HugoFara/pylinkage/blob/main/pylinkage/linkage.py">linkage.py</a> this module describes joints and linkages</p>
<li><p><a class="reference external" href="https://github.com/HugoFara/pylinkage/blob/master/pylinkage/linkage.py">linkage.py</a> this module describes joints and linkages</p>
<ul>
<li><p>Due to the geometric approach, joints (instances of <code class="docutils literal notranslate"><span class="pre">Joint</span></code> object) are defined without links.</p></li>
<li><p>The <code class="docutils literal notranslate"><span class="pre">Linkage</span></code> class that will make your code shorter.</p></li>
</ul>
</li>
<li><p><a class="reference external" href="https://github.com/HugoFara/pylinkage/blob/main/pylinkage/optimizer.py">optimizer.py</a> proposes three optimizations based on three techniques:</p>
<li><p><a class="reference external" href="https://github.com/HugoFara/pylinkage/blob/master/pylinkage/optimizer.py">optimizer.py</a> proposes three optimizations based on three techniques:</p>
<ul>
<li><p>The “exhaustive” optimization (<code class="docutils literal notranslate"><span class="pre">exhaustive_optimization</span></code> function) is a dumb optimization method, consisting or trying sequencially all positions. It is here for demonstration purposes only, and you should not use it if you are looking for an efficient technique.</p></li>
<li><p>The built-in Particle Swarm Optimizer (PSO). I started with it, so it offers a large set of useful options for linkage optimization. However, it is here for legacy purposes, and is much short than the PySwarms module.</p></li>
<li><p>PSO using <a class="reference external" href="https://github.com/ljvmiranda921/pyswarms">PySwarms</a>. We provide a wrapper function to PySwarm from ljvmiranda921, that will progressively be extended.</p></li>
</ul>
</li>
<li><p><a class="reference external" href="https://github.com/HugoFara/pylinkage/blob/main/pylinkage/visualizer.py">visualizer.py</a> can make graphic illustrations of your linkage using matplotlib.</p>
<li><p><a class="reference external" href="https://github.com/HugoFara/pylinkage/blob/master/pylinkage/visualizer.py">visualizer.py</a> can make graphic illustrations of your linkage using matplotlib.</p>
<ul>
<li><p>It is also used to visualise your n-dimensional swarm, which is not supported by PySwarms.</p></li>
</ul>
Expand Down Expand Up @@ -325,7 +326,7 @@ <h3>Visualization<a class="headerlink" href="#visualization" title="Permalink to
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">pl</span><span class="o">.</span><span class="n">show_linkage</span><span class="p">(</span><span class="n">my_linkage</span><span class="p">)</span>
</pre></div>
</div>
<a class="reference external image-reference" href="https://github.com/HugoFara/pylinkage/raw/main/docs/examples/images/Kinematic%20My%20four-bar%20linkage.gif"><img alt="A four-bar linkage animated" src="https://github.com/HugoFara/pylinkage/raw/main/docs/examples/images/Kinematic%20My%20four-bar%20linkage.gif" /></a>
<a class="reference external image-reference" href="https://github.com/HugoFara/pylinkage/raw/master/docs/examples/images/Kinematic%20My%20four-bar%20linkage.gif"><img alt="A four-bar linkage animated" src="https://github.com/HugoFara/pylinkage/raw/master/docs/examples/images/Kinematic%20My%20four-bar%20linkage.gif" /></a>
<p>Last recap, rearranging names:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># Main motor</span>
<span class="n">crank</span> <span class="o">=</span> <span class="n">pl</span><span class="o">.</span><span class="n">Crank</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">joint0</span><span class="o">=</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="n">angle</span><span class="o">=</span><span class="mf">.31</span><span class="p">,</span> <span class="n">distance</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="s2">&quot;B&quot;</span><span class="p">)</span>
Expand Down Expand Up @@ -424,7 +425,7 @@ <h3>Optimization<a class="headerlink" href="#optimization" title="Permalink to t
</div>
<p>Here the result can vary, but it is rarely above 0.2.</p>
<p>So we made something that says it works, let’s verify it:</p>
<a class="reference external image-reference" href="https://github.com/HugoFara/pylinkage/raw/main/docs/examples/images/Kinematic%20Windscreen%20wiper.gif"><img alt="An optimized four-bar linkage animated" src="https://github.com/HugoFara/pylinkage/raw/main/docs/examples/images/Kinematic%20Windscreen%20wiper.gif" /></a>
<a class="reference external image-reference" href="https://github.com/HugoFara/pylinkage/raw/master/docs/examples/images/Kinematic%20Windscreen%20wiper.gif"><img alt="An optimized four-bar linkage animated" src="https://github.com/HugoFara/pylinkage/raw/master/docs/examples/images/Kinematic%20Windscreen%20wiper.gif" /></a>
<p>With a bit of imagination you have a wonderful windscreen wiper!</p>
</div>
</div>
Expand Down
Binary file modified docs/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/py-modindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Python Module Index &mdash; pylinkage 0.5.0 documentation</title>
<title>Python Module Index &mdash; pylinkage 0.5.1 documentation</title>



Expand Down
Loading

0 comments on commit 2c4848e

Please sign in to comment.