Skip to content

Commit

Permalink
Regenerates documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoFara committed Sep 30, 2024
1 parent 0706c3f commit bf77391
Show file tree
Hide file tree
Showing 13 changed files with 78 additions and 39 deletions.
32 changes: 22 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Contribute

Do you like this project? If so, you can contribute to it in various ways, and you don't need to be a developer!
Do you like this project?
If so, you can contribute to it in various ways,
and you don't need to be a developer!

Download the latest GitHub version, then install the dev requirements in ``requirements-dev.txt``.
Download the latest GitHub version,
then install the dev requirements in ``requirements-dev.txt``.

In a nutshell

Expand All @@ -26,16 +29,25 @@ We use unittest. You can use it in two ways:
This section is mainly intended for maintainers.
Fell free to use the tools described here, but they are not necessary in any way.

* To publish a new version, use ``bump2version``. For instance ``bump2version minor``.
* Update CHANGELOG.md with release date and edit subsection titles.
* Regenerate the documentation (uses Sphinx).
* By hand with ``sphinx-build -b html sphinx/ docs/``.
* We also provide a configuration file for users of PyCharm that does the same.
* Clean everything with ``make clean``.
* Commit and add a tag (e. g. v0.4.0).
* Publish a new [GitHub release](https://github.com/HugoFara/pylinkage/releases).
1. To publish a new version, use ``bump2version``. For instance ``bump2version minor``.
2. Update CHANGELOG.md with release date and edit subsection titles.
3. Regenerate the documentation (uses Sphinx).
* By hand with ``sphinx-build -b html sphinx/ docs/``.
* We also provide a configuration file for users of PyCharm that does the same.
* Clean everything with ``make clean``.
4. Commit and add a tag (e. g. v0.4.0).
5. Publish a new [GitHub release](https://github.com/HugoFara/pylinkage/releases).


## Caveats

Pylinkage is a small project to build 2D linkages in a simple way.
It is not intended for complex simulations.
If you want to do much more, my best advice is to start your own project.
If you simply want to have fun developing new features, you are welcome here!

## Contributions for everyone

Don't forget to drop a star, fork it or share it on social media.
This is a community project, and the bigger the community, the more it will thrive!

21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ score, position, coord = pl.particle_swarm_optimization(

# Let's use the result in our linkage!
my_linkage.set_num_constraints(constraints) # Dimensions
my_linkage.set_coords(init_pos) # Intial position
my_linkage.set_coords(init_pos) # Initial position

pl.show_linkage(my_linkage)
```
Expand Down Expand Up @@ -224,7 +224,7 @@ Our objective function, often called the fitness function, is the following:
init_pos = my_linkage.get_coords()

@pl.kinematic_minimizastion
def fitness_func(loci, **kwargs):
def fitness_func(loci, **_kwargs):
"""
Return how fit the locus is to describe a quarter of circle.
Expand Down Expand Up @@ -311,12 +311,21 @@ With a bit of imagination, you have a wonderful windshield wiper!

As of today, we segment the code in main three parts:
* [linkage.py](https://github.com/HugoFara/pylinkage/blob/main/pylinkage/linkage.py) this module describes joints and linkages
* Due to the geometric approach, joints (instances of ``Joint`` object) are defined without links.
* Due to the geometric approach, joints (instances of ``Joint`` object)
are defined without links.
* The ``Linkage`` class that will make your code shorter.
* [optimizer.py](https://github.com/HugoFara/pylinkage/blob/main/pylinkage/optimizer.py) proposes three optimizations based on three techniques:
* The "exhaustive" optimization (``exhaustive_optimization`` function) is a simple grid search 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.
* 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.
* PSO using [PySwarms](https://github.com/ljvmiranda921/pyswarms). We provide a wrapper function to PySwarm from ljvmiranda921, that will progressively be extended.
* The "exhaustive" optimization (``exhaustive_optimization`` function)
is a simple grid search optimization method,
consisting or trying sequentially all positions.
It is here for demonstration purposes only,
and you should not use it if you are looking for an efficient technique.
* 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 shorter than the PySwarms module.
* PSO using [PySwarms](https://github.com/ljvmiranda921/pyswarms).
We provide a wrapper function to PySwarm from ljvmiranda921,
that will progressively be extended.
* [visualizer.py](https://github.com/HugoFara/pylinkage/blob/main/pylinkage/visualizer.py) can make graphic illustrations of your linkage using matplotlib.
* It is also used to visualize your n-dimensional swarm, which is not supported by PySwarms.

Expand Down
2 changes: 1 addition & 1 deletion docs/api/collections.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>collections &mdash; pylinkage 0.5.3 documentation</title>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/geometry.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>geometry &mdash; pylinkage 0.5.3 documentation</title>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/interface.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>interface &mdash; pylinkage 0.5.3 documentation</title>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/optimization.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>optimization &mdash; pylinkage 0.5.3 documentation</title>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/utility.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>utility &mdash; pylinkage 0.5.3 documentation</title>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/visualizer.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>visualizer &mdash; pylinkage 0.5.3 documentation</title>
Expand Down
2 changes: 1 addition & 1 deletion docs/changeloglink.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Changelog &mdash; pylinkage 0.5.3 documentation</title>
Expand Down
2 changes: 1 addition & 1 deletion docs/code_of_conductlink.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Contributor Covenant Code of Conduct &mdash; pylinkage 0.5.3 documentation</title>
Expand Down
23 changes: 16 additions & 7 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Welcome to pylinkage’s documentation! &mdash; pylinkage 0.5.3 documentation</title>
Expand Down Expand Up @@ -238,7 +238,7 @@ <h3>Short demo<a class="headerlink" href="#short-demo" title="Link to this headi

<span class="c1"># Let&#39;s use the result in our linkage!</span>
<span class="n">my_linkage</span><span class="o">.</span><span class="n">set_num_constraints</span><span class="p">(</span><span class="n">constraints</span><span class="p">)</span> <span class="c1"># Dimensions</span>
<span class="n">my_linkage</span><span class="o">.</span><span class="n">set_coords</span><span class="p">(</span><span class="n">init_pos</span><span class="p">)</span> <span class="c1"># Intial position</span>
<span class="n">my_linkage</span><span class="o">.</span><span class="n">set_coords</span><span class="p">(</span><span class="n">init_pos</span><span class="p">)</span> <span class="c1"># Initial position</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>
Expand Down Expand Up @@ -366,7 +366,7 @@ <h4>Optimization<a class="headerlink" href="#optimization" title="Link to this h
<span class="n">init_pos</span> <span class="o">=</span> <span class="n">my_linkage</span><span class="o">.</span><span class="n">get_coords</span><span class="p">()</span>

<span class="nd">@pl</span><span class="o">.</span><span class="n">kinematic_minimizastion</span>
<span class="k">def</span> <span class="nf">fitness_func</span><span class="p">(</span><span class="n">loci</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">fitness_func</span><span class="p">(</span><span class="n">loci</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"> Return how fit the locus is to describe a quarter of circle.</span>

Expand Down Expand Up @@ -450,15 +450,24 @@ <h3>Structure<a class="headerlink" href="#structure" title="Link to this heading
<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>
<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>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>
<ul>
<li><p>The “exhaustive” optimization (<code class="docutils literal notranslate"><span class="pre">exhaustive_optimization</span></code> function) is a simple grid search 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>
<li><p>The “exhaustive” optimization (<code class="docutils literal notranslate"><span class="pre">exhaustive_optimization</span></code> function)
is a simple grid search optimization method,
consisting or trying sequentially 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 shorter 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>
Expand Down
23 changes: 16 additions & 7 deletions docs/readmelink.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Pylinkage &mdash; pylinkage 0.5.3 documentation</title>
Expand Down Expand Up @@ -173,7 +173,7 @@ <h2>Short demo<a class="headerlink" href="#short-demo" title="Link to this headi

<span class="c1"># Let&#39;s use the result in our linkage!</span>
<span class="n">my_linkage</span><span class="o">.</span><span class="n">set_num_constraints</span><span class="p">(</span><span class="n">constraints</span><span class="p">)</span> <span class="c1"># Dimensions</span>
<span class="n">my_linkage</span><span class="o">.</span><span class="n">set_coords</span><span class="p">(</span><span class="n">init_pos</span><span class="p">)</span> <span class="c1"># Intial position</span>
<span class="n">my_linkage</span><span class="o">.</span><span class="n">set_coords</span><span class="p">(</span><span class="n">init_pos</span><span class="p">)</span> <span class="c1"># Initial position</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>
Expand Down Expand Up @@ -301,7 +301,7 @@ <h3>Optimization<a class="headerlink" href="#optimization" title="Link to this h
<span class="n">init_pos</span> <span class="o">=</span> <span class="n">my_linkage</span><span class="o">.</span><span class="n">get_coords</span><span class="p">()</span>

<span class="nd">@pl</span><span class="o">.</span><span class="n">kinematic_minimizastion</span>
<span class="k">def</span> <span class="nf">fitness_func</span><span class="p">(</span><span class="n">loci</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">fitness_func</span><span class="p">(</span><span class="n">loci</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"> Return how fit the locus is to describe a quarter of circle.</span>

Expand Down Expand Up @@ -385,15 +385,24 @@ <h2>Structure<a class="headerlink" href="#structure" title="Link to this heading
<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>
<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>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>
<ul>
<li><p>The “exhaustive” optimization (<code class="docutils literal notranslate"><span class="pre">exhaustive_optimization</span></code> function) is a simple grid search 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>
<li><p>The “exhaustive” optimization (<code class="docutils literal notranslate"><span class="pre">exhaustive_optimization</span></code> function)
is a simple grid search optimization method,
consisting or trying sequentially 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 shorter 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>
Expand Down
2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

0 comments on commit bf77391

Please sign in to comment.