From 038b75e855ec855207c14b83a782eb54b4df7525 Mon Sep 17 00:00:00 2001 From: HugoFara Date: Tue, 1 Oct 2024 22:24:25 +0200 Subject: [PATCH] Generates documentation. --- docs/_sources/api/pylinkage.joints.rst.txt | 8 - docs/_sources/index.rst.txt | 5 +- docs/_sources/tests/modules.rst.txt | 7 + docs/_sources/tests/tests.collections.rst.txt | 21 + docs/_sources/tests/tests.geometry.rst.txt | 21 + docs/_sources/tests/tests.joints.rst.txt | 21 + docs/_sources/tests/tests.linkage.rst.txt | 21 + .../_sources/tests/tests.optimization.rst.txt | 21 + docs/_sources/tests/tests.rst.txt | 22 + docs/api/collections.html | 185 --------- docs/api/geometry.html | 133 ------ docs/api/joints.html | 137 ------- docs/api/modules.html | 9 +- docs/api/optimization.html | 377 ------------------ docs/api/pylinkage.html | 26 +- docs/api/pylinkage.joints.html | 8 +- docs/api/pylinkage.visualizer.html | 108 ++++- docs/api/utility.html | 134 ------- docs/genindex.html | 265 +++++++++++- docs/index.html | 21 +- docs/objects.inv | Bin 1408 -> 1991 bytes docs/py-modindex.html | 77 +++- docs/search.html | 3 +- docs/searchindex.js | 2 +- .../visualizer.html => tests/modules.html} | 56 ++- docs/tests/tests.collections.html | 159 ++++++++ docs/tests/tests.geometry.html | 194 +++++++++ docs/tests/tests.html | 263 ++++++++++++ docs/tests/tests.joints.html | 241 +++++++++++ .../tests.linkage.html} | 75 ++-- docs/tests/tests.optimization.html | 253 ++++++++++++ sphinx/api/pylinkage.joints.rst | 8 - 32 files changed, 1818 insertions(+), 1063 deletions(-) create mode 100644 docs/_sources/tests/modules.rst.txt create mode 100644 docs/_sources/tests/tests.collections.rst.txt create mode 100644 docs/_sources/tests/tests.geometry.rst.txt create mode 100644 docs/_sources/tests/tests.joints.rst.txt create mode 100644 docs/_sources/tests/tests.linkage.rst.txt create mode 100644 docs/_sources/tests/tests.optimization.rst.txt create mode 100644 docs/_sources/tests/tests.rst.txt delete mode 100644 docs/api/collections.html delete mode 100644 docs/api/geometry.html delete mode 100644 docs/api/joints.html delete mode 100644 docs/api/optimization.html delete mode 100644 docs/api/utility.html rename docs/{api/visualizer.html => tests/modules.html} (54%) create mode 100644 docs/tests/tests.collections.html create mode 100644 docs/tests/tests.geometry.html create mode 100644 docs/tests/tests.html create mode 100644 docs/tests/tests.joints.html rename docs/{api/interface.html => tests/tests.linkage.html} (50%) create mode 100644 docs/tests/tests.optimization.html diff --git a/docs/_sources/api/pylinkage.joints.rst.txt b/docs/_sources/api/pylinkage.joints.rst.txt index 64c976f..3714d27 100644 --- a/docs/_sources/api/pylinkage.joints.rst.txt +++ b/docs/_sources/api/pylinkage.joints.rst.txt @@ -52,14 +52,6 @@ pylinkage.joints.static module :undoc-members: :show-inheritance: -pylinkage.joints.utils module ------------------------------ - -.. automodule:: pylinkage.joints.utils - :members: - :undoc-members: - :show-inheritance: - Module contents --------------- diff --git a/docs/_sources/index.rst.txt b/docs/_sources/index.rst.txt index 1928131..f576d95 100644 --- a/docs/_sources/index.rst.txt +++ b/docs/_sources/index.rst.txt @@ -14,10 +14,11 @@ Welcome to pylinkage's documentation! changeloglink .. toctree:: - :maxdepth: 2 - :caption: Modules + :maxdepth: 3 + :caption: Packages api/modules + tests/modules .. toctree:: :maxdepth: 2 diff --git a/docs/_sources/tests/modules.rst.txt b/docs/_sources/tests/modules.rst.txt new file mode 100644 index 0000000..8529a1d --- /dev/null +++ b/docs/_sources/tests/modules.rst.txt @@ -0,0 +1,7 @@ +tests +===== + +.. toctree:: + :maxdepth: 4 + + tests diff --git a/docs/_sources/tests/tests.collections.rst.txt b/docs/_sources/tests/tests.collections.rst.txt new file mode 100644 index 0000000..12a1e35 --- /dev/null +++ b/docs/_sources/tests/tests.collections.rst.txt @@ -0,0 +1,21 @@ +tests.collections package +========================= + +Submodules +---------- + +tests.collections.test\_collections module +------------------------------------------ + +.. automodule:: tests.collections.test_collections + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: tests.collections + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sources/tests/tests.geometry.rst.txt b/docs/_sources/tests/tests.geometry.rst.txt new file mode 100644 index 0000000..074d0a0 --- /dev/null +++ b/docs/_sources/tests/tests.geometry.rst.txt @@ -0,0 +1,21 @@ +tests.geometry package +====================== + +Submodules +---------- + +tests.geometry.test\_geometry module +------------------------------------ + +.. automodule:: tests.geometry.test_geometry + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: tests.geometry + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sources/tests/tests.joints.rst.txt b/docs/_sources/tests/tests.joints.rst.txt new file mode 100644 index 0000000..d9fbeb1 --- /dev/null +++ b/docs/_sources/tests/tests.joints.rst.txt @@ -0,0 +1,21 @@ +tests.joints package +==================== + +Submodules +---------- + +tests.joints.test\_joints module +-------------------------------- + +.. automodule:: tests.joints.test_joints + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: tests.joints + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sources/tests/tests.linkage.rst.txt b/docs/_sources/tests/tests.linkage.rst.txt new file mode 100644 index 0000000..58ea2e2 --- /dev/null +++ b/docs/_sources/tests/tests.linkage.rst.txt @@ -0,0 +1,21 @@ +tests.linkage package +===================== + +Submodules +---------- + +tests.linkage.test\_linkage module +---------------------------------- + +.. automodule:: tests.linkage.test_linkage + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: tests.linkage + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sources/tests/tests.optimization.rst.txt b/docs/_sources/tests/tests.optimization.rst.txt new file mode 100644 index 0000000..62846fb --- /dev/null +++ b/docs/_sources/tests/tests.optimization.rst.txt @@ -0,0 +1,21 @@ +tests.optimization package +========================== + +Submodules +---------- + +tests.optimization.test\_optimizer module +----------------------------------------- + +.. automodule:: tests.optimization.test_optimizer + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: tests.optimization + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sources/tests/tests.rst.txt b/docs/_sources/tests/tests.rst.txt new file mode 100644 index 0000000..aaa1de4 --- /dev/null +++ b/docs/_sources/tests/tests.rst.txt @@ -0,0 +1,22 @@ +tests package +============= + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + tests.collections + tests.geometry + tests.joints + tests.linkage + tests.optimization + +Module contents +--------------- + +.. automodule:: tests + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/collections.html b/docs/api/collections.html deleted file mode 100644 index 4b52578..0000000 --- a/docs/api/collections.html +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - collections — pylinkage 0.5.3 documentation - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

collections

-
-

Agent

-
-
-class pylinkage.collections.agent.Agent(score, dimensions, init_positions)
-

Bases: Agent

-

A class that uniformizes a linkage optimization.

-

It is roughly a namedtuple with preassigned fields.

-
- -
-
-

MutableAgent

-
-
-class pylinkage.collections.mutable_agent.MutableAgent(score=None, dimensions=None, init_position=None)
-

Bases: object

-

A custom class that is mutable, subscriptable, and supports index assignment.

-

You should only use it as a dictionary of 3 elements. No backward compatibility guaranty on other use cases.

-
-
-__init__(score=None, dimensions=None, init_position=None)
-
- -
-
-dimensions: tuple
-
- -
-
-init_positions: tuple
-
- -
-
-score: float
-
- -
- -
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/api/geometry.html b/docs/api/geometry.html deleted file mode 100644 index b3b456b..0000000 --- a/docs/api/geometry.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - geometry — pylinkage 0.5.3 documentation - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

geometry

-
-

Base module for geometric abstractions

-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/api/joints.html b/docs/api/joints.html deleted file mode 100644 index dffb636..0000000 --- a/docs/api/joints.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - joints — pylinkage 0.5.3 documentation - - - - - - - - - - - - - - - - - - - -
- - -
- -
-
-
- -
-
-
-
- -
-

joints

-
-

Joints definition

- - - -
-
-
- - -
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/api/modules.html b/docs/api/modules.html index 32e9554..f0e05c1 100644 --- a/docs/api/modules.html +++ b/docs/api/modules.html @@ -49,12 +49,13 @@
  • Readme
  • Changelog
  • -

    Modules

    +

    Packages

    Quick Links

    @@ -152,7 +153,7 @@

    pylinkageUnbuildableError -
  • Module contents
  • +
  • Module contents
  • diff --git a/docs/api/optimization.html b/docs/api/optimization.html deleted file mode 100644 index 398b265..0000000 --- a/docs/api/optimization.html +++ /dev/null @@ -1,377 +0,0 @@ - - - - - - - optimization — pylinkage 0.5.3 documentation - - - - - - - - - - - - - - - - - - - -
    - - -
    - -
    -
    -
    - -
    -
    -
    -
    - -
    -

    optimization

    - -
    -

    Particle Swarm Optimization

    -

    Implementation of a particle swarm optimization.

    -

    Created on Fri Mar 8, 13:51:45 2019.

    -

    @author: HugoFara

    -
    -
    -pylinkage.optimization.particle_swarm.particle_swarm_optimization(eval_func, linkage, center=None, dimensions=None, n_particles=100, leader=3.0, follower=0.1, inertia=0.6, neighbors=17, iters=200, bounds=None, order_relation=<built-in function max>, verbose=True, **kwargs)
    -

    Particle Swarm Optimization wrapper for pyswarms.

    -

    This function is a simple wrapper to optimize a linkage using PSO. It will -mainly call the LocalBestPSO function from pyswarms.single.

    -
    -
    Parameters:
    -
      -
    • eval_func (Callable -> float) – The evaluation function. -Input: (linkage, num_constraints, initial_coordinates). -Output: score (float). -The swarm will look for the HIGHEST score.

    • -
    • linkage (pylinkage.linkage.Linkage) – Linkage to be optimized. Make sure to give an optimized linkage for -better results

    • -
    • center (list) – A list of initial dimensions. If None, dimensions will be generated -randomly between bounds. The default is None.

    • -
    • dimensions (int) – Number of dimensions of the swarm space, number of parameters. -If None, it takes the value len(tuple(linkage.get_num_constraints())). -The default is None.

    • -
    • n_particles (float) – Number of particles in the swarm. The default is 100.

    • -
    • inertia (float) – Inertia of each particle, w in pyswarms. The default is .3.

    • -
    • leader (float) – Learning coefficient of each particle, c1 in pyswarms. -The default is .2.

    • -
    • follower (float) – Social coefficient, c2 in pyswarms. The default is .5.

    • -
    • neighbors (int) – Number of neighbors to consider. The default is 17.

    • -
    • iters (int) – Number of iterations to describe. The default is 200.

    • -
    • bounds (sequence of two list of float) – Bounds to the space, in format (lower_bound, upper_bound). (Default value = None)

    • -
    • order_relation (Callable(float, float) -> float) – How to compare scores. -There should not be anything else than the built-in -max and min functions. -The default is max.

    • -
    • verbose (bool) – The optimization state will be printed in the console if True. -(Default value = True).

    • -
    • kwargs (dict) – keyword arguments to pass to pyswarm.local.single.LocalBestPSO.

    • -
    -
    -
    Returns:
    -

    List of Agents: best score, best dimensions and initial positions.

    -
    -
    Return type:
    -

    List[Agent]

    -
    -
    -
    - -
    -
    -

    Utility

    -

    This utility module provides various useful functions for optimization.

    -

    Created on Mon Jul 12 00:00:01 2021.

    -

    @author: HugoFara

    -
    -
    -pylinkage.optimization.utils.generate_bounds(center, min_ratio=5, max_factor=5)
    -

    Simple function to generate bounds from a linkage.

    -
    -
    Parameters:
    -
      -
    • center (Iterable) – 1-D sequence, often in the form of linkage.get_num_constraints().

    • -
    • min_ratio (float) – Minimal compression ratio for the bounds. Minimal bounds will be of the -shape center[x] / min_ratio. -(Default value = 5)

    • -
    • max_factor (float) – Dilation factor for the upper bounds. Maximal bounds will be of the -shape center[x] * max_factor. -(Default value = 5)

    • -
    -
    -
    -
    - -
    -
    -pylinkage.optimization.utils.kinematic_maximization(func)
    -

    Standard run for any linkage before a complete fitness evaluation.

    -

    This decorator makes a kinematic simulation, before passing the loci to the -decorated function. In case of error, the penalty value is -float(‘inf’)

    -
    -
    Parameters:
    -

    func (Callable) – Fitness function to be decorated.

    -
    -
    -
    - -
    -
    -pylinkage.optimization.utils.kinematic_minimization(func)
    -

    Standard run for any linkage before a complete fitness evaluation.

    -

    This decorator makes a kinematic simulation, before passing the loci to the -decorated function. In case of error, the penalty value is float(‘inf’)

    -
    -
    Parameters:
    -

    func (Callable) – Fitness function to be decorated.

    -
    -
    -
    - -
    -
    - - -
    -
    - -
    -
    -
    -
    - - - - \ No newline at end of file diff --git a/docs/api/pylinkage.html b/docs/api/pylinkage.html index 2db15d0..fa21d9f 100644 --- a/docs/api/pylinkage.html +++ b/docs/api/pylinkage.html @@ -49,7 +49,7 @@
  • Readme
  • Changelog
  • -

    Modules

    +

    Packages

    +
  • tests
  • Quick Links

    @@ -303,13 +303,19 @@

    Subpackagespylinkage.visualizer package @@ -345,8 +351,14 @@

    Submodules -

    Module contents

    +
    +

    Module contents

    +

    PyLinkage is a module to create, optimize and visualize linkages.

    +

    Please see the documentation at https://hugofara.github.io/pylinkage/. +A copy of the documentation should have been distributed on your system in the +docs/ folder.

    +

    Created on Thu Jun 10 21:30:52 2021

    +

    @author: HugoFara

    diff --git a/docs/api/pylinkage.joints.html b/docs/api/pylinkage.joints.html index cc5ae6c..b2207d9 100644 --- a/docs/api/pylinkage.joints.html +++ b/docs/api/pylinkage.joints.html @@ -49,7 +49,7 @@
  • Readme
  • Changelog
  • -

    Modules

    +

    Packages

    Quick Links

    -

    Modules

    +

    Packages

    Quick Links

    -

    Modules

    +

    Packages

    Quick Links

    @@ -374,9 +419,28 @@

    P

  • particle_swarm_optimization() (in module pylinkage.optimization.particle_swarm)
  • Pivot (class in pylinkage.joints.revolute) +
  • +
  • pivot1 (tests.joints.test_joints.TestFixed attribute) + +
  • +
  • plot_kinematic_linkage() (in module pylinkage.visualizer.animated)
  • plot_static_linkage() (in module pylinkage.visualizer.static)
  • +
  • prepare_linkage() (in module tests.optimization.test_optimizer) +
  • +
  • + pylinkage + +
  • pylinkage.collections @@ -447,6 +511,8 @@

    P

  • module
  • + + - -
  • set_completely() (pylinkage.linkage.linkage.Linkage method)
  • - - +
  • step() (pylinkage.linkage.linkage.Linkage method) +
  • +
  • swarm_tiled_repr() (in module pylinkage.visualizer.animated)
  • @@ -662,10 +744,171 @@

    S

    T

    @@ -675,6 +918,10 @@

    U

    +
    diff --git a/docs/index.html b/docs/index.html index 7e010cd..606e187 100644 --- a/docs/index.html +++ b/docs/index.html @@ -48,9 +48,10 @@
  • Readme
  • Changelog
  • -

    Modules

    +

    Packages

    Quick Links

    -

    Modules

    +

    Packages

    Quick Links

    -

    Modules

    +

    Packages

    Quick Links

    Modules

    Quick Links

    -

    Modules

    +

    Packages