Skip to content

Linear joint / Package Structure Rewrite

Latest
Compare
Choose a tag to compare
@HugoFara HugoFara released this 02 Oct 15:38
· 2 commits to main since this release

This release is a huge effort to make pylinkage better!
It features abstract Joint, the new Linear joint, and the package structure was rewritten to make contributions easier.

Added

  • New joint: the Linear joint!
  • New sub-package: optimization.collections.
    optimization.collections.Agent and optimization.collections.MutableAgent are two new classes that should standardize the format of
    optimization, related to (#5).
    • Agent is immutable and inherits from a namedtuple. It is recommended to use it, as it is a bit faster.
    • MutableAgent is mutable. It may be deprecated/removed if Agent is satisfactory.
  • New sub-package: geometry.
    • It introduces two new functions line_from_points and circle_line_intersection.
  • New examples:
  • Linkage.set_completely is a new method combining both Linkage.set_num_constraints and Linkage.set_coords.
  • New exception NotCompletelyDefinedError, when a joint is reloading but its anchor coordinates are set to None.
  • Some run configuration files added for users of PyCharm:
    • Run all tests with "All Tests".
    • Regenerate documentation with "Sphinx Documentation".

Changed

  • Optimization return type changed (#5):
    • trials_and_error_optimization return an array of MutableAgent.
    • particle_swarm_optimization return an array of one Agent.
    • It should not be a breaking change for most users.
  • Changes to the "history" style.
    • It is no longer a global variable in example scripts.
    • It was in format iterations[dimensions, score], now it is a standard iterations[score, dimensions, initial pos].
    • repr_polar_swarm (in example scripts) changed to follow the new format.
    • swarm_tiled_repr takes (index, swarm) as input argument. swarm is (score, dim, pos) for each agent for this
      iteration.
  • repr_polar_swarm reload frame only when a new buildable linkage is generated.
    • This makes the display much faster.
    • For each iteration, you may see linkages that do not exist anymore.
  • Folders reorganization:
    • The geometry module is now a package (pylinkage/geometry)
    • New package pylinkage/linkage:
      • pylinkage/linkage.py separated and inserted in this package.
    • New package: pylinkage/joints
      • Joints definition are in respective files.
    • New package pylinkage/optimization/
      • pylinkage/optimizer.py split and inserted in.
      • Trials-and-errors related functions goes to grid_search.py.
      • Particle swarm optimization is at particle_swarm.py.
      • New file utils.py for generate_bounds.
    • Tests follow the same renaming.
    • From the user perspective, no change (execution may be a bit faster)
    • source/ renamed to sphinx/ because it was confusing and only for Sphinx configuration.
  • Transition from Numpydoc to reST for docstrings (#12).
  • __secant_circles_intersections__ renamed to
    secant_circles_intersections (in pylinkage/geometry/secants.py).

Fixed

  • swarm_tiled_repr in visualizer.py was wrongly assigning dimensions.
  • Setting locus_highlight in plot_static_linkage would result in an error.
  • Pivot.reload was returning arbitrary point when we had an infinity of solutions.
  • The highlighted locus was sometimes buggy in plot_static_linkage in
    visualizer.py.

Deprecated

  • Using tqdm_verbosity is deprecated in favor of using disable=True in a tqdm object.
  • The Pivot class is deprecated in favor of the Revolute class.
    The name "Pivot joint" is not standard.
    Related to #13.
  • The hyperstaticity method is renamed indeterminacy in Linkage
    (linkage.py)

Removed

  • Drops support for Python 3.7 and 3.8 as both versions reached end-of-life.
  • movement_bounding_bow is replaced by movement_bounding_box (typo in function name).