Skip to content

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jul 25, 2024
0 parents commit c292c89
Show file tree
Hide file tree
Showing 72 changed files with 15,927 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 55442ba78287e8cf3d38f68df889caaa
tags: 645f666f9bcd5a90fca523b33c5a78b7
Empty file added .nojekyll
Empty file.
Binary file added _images/animation.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/animation_2d.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/plot_objects_0_0.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 added _images/plot_objects_1_0.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 added _images/plot_objects_2_0.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 added _images/plot_objects_3_0.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 added _images/plot_objects_4_0.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 added _images/scene_0_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions _sources/api/core/artists.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Core's Artists
==============

.. automodule:: symmeplot.core.artists
:members:
:show-inheritance:
:inherited-members:
13 changes: 13 additions & 0 deletions _sources/api/core/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SymMePlot Core
==============

This is the core of the SymMePlot project. It contains the core classes from which the
different visualization backends are derived.

.. toctree::
:maxdepth: 2

scene
plot_objects
plot_base
artists
7 changes: 7 additions & 0 deletions _sources/api/core/plot_base.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Core's PlotBase
===============

.. automodule:: symmeplot.core.plot_base
:members:
:show-inheritance:
:inherited-members:
10 changes: 10 additions & 0 deletions _sources/api/core/plot_objects.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Core's Plot Objects
===================

This module contains mixins that can be used to create plot objects with different
backends by inheriting from the appropriate mixin and the backend's `PlotBase` class.

.. automodule:: symmeplot.core.plot_objects
:members:
:show-inheritance:
:inherited-members:
7 changes: 7 additions & 0 deletions _sources/api/core/scene.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Core's Scene
============

.. automodule:: symmeplot.core.scene
:members:
:show-inheritance:
:inherited-members:
18 changes: 18 additions & 0 deletions _sources/api/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
API Reference
=============

This is the API reference for the `symmeplot` package. The package has separate
subpackages for each backend. The backends are:

.. toctree::
:maxdepth: 2

matplotlib/index
pyqtgraph/index

Each of these backends is derived from the `symmeplot.core` package:

.. toctree::
:maxdepth: 2

core/index
6 changes: 6 additions & 0 deletions _sources/api/matplotlib/artists.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Matplotlib's Artists
====================

.. automodule:: symmeplot.matplotlib.artists
:members:
:show-inheritance:
12 changes: 12 additions & 0 deletions _sources/api/matplotlib/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
SymMePlot Matplotlib
====================

Matplotlib backend of SymMePlot.

.. toctree::
:maxdepth: 2

scene
plot_objects
plot_base
artists
7 changes: 7 additions & 0 deletions _sources/api/matplotlib/plot_base.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Matplotlib's PlotBase
=====================

.. automodule:: symmeplot.matplotlib.plot_base
:members:
:show-inheritance:
:inherited-members:
7 changes: 7 additions & 0 deletions _sources/api/matplotlib/plot_objects.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Matplotlib's Plot Objects
=========================

.. automodule:: symmeplot.matplotlib.plot_objects
:members:
:show-inheritance:
:inherited-members:
7 changes: 7 additions & 0 deletions _sources/api/matplotlib/scene.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Matplotlib's Scene
==================

.. automodule:: symmeplot.matplotlib.scene
:members:
:show-inheritance:
:inherited-members:
7 changes: 7 additions & 0 deletions _sources/api/pyqtgraph/artists.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Pyqtgraph's Artists
===================

.. automodule:: symmeplot.pyqtgraph.artists
:members:
:show-inheritance:
:inherited-members:
12 changes: 12 additions & 0 deletions _sources/api/pyqtgraph/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
SymMePlot Pyqtgraph
===================

Pyqtgraph backend of SymMePlot.

.. toctree::
:maxdepth: 2

scene
plot_objects
plot_base
artists
7 changes: 7 additions & 0 deletions _sources/api/pyqtgraph/plot_base.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Pyqtgraph's PlotBase
====================

.. automodule:: symmeplot.pyqtgraph.plot_base
:members:
:show-inheritance:
:inherited-members:
7 changes: 7 additions & 0 deletions _sources/api/pyqtgraph/plot_objects.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Pyqtgraph's Plot Objects
=========================

.. automodule:: symmeplot.pyqtgraph.plot_objects
:members:
:show-inheritance:
:inherited-members:
7 changes: 7 additions & 0 deletions _sources/api/pyqtgraph/scene.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Pyqtgraph's Scene
=================

.. automodule:: symmeplot.pyqtgraph.scene
:members:
:show-inheritance:
:inherited-members:
54 changes: 54 additions & 0 deletions _sources/guides/installation.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Installation
============

Installation Users
------------------

SymMePlot is available on both PyPI and Conda-Forge. To install the latest release from
PyPI, run: ::

pip install symmeplot

To use the `matplotlib`_ backend, you’ll need to install `matplotlib`_ as well: ::

pip install matplotlib

To use the `pyqtgraph`_ backend, you’ll need to install `pyqtgraph`_ with some optional
dependencies as well: ::

pip install pyqtgraph pyopengl pyqt6

Installation Developers
-----------------------
SymMePlot uses `poetry`_ as package manager. To install SymMePlot after installing
`poetry`_ and cloning the repository, run: ::

poetry install

SymMePlot offers dependency groups to assist developers:

- ``lint``: packages required for linting.
- ``test``: packages required for testing.
- ``docs``: packages required for building the documentation.

To install optional dependencies from a specific group, run: ::

poetry install --with <group>

The backends are optional dependencies. These can be installed using: ::

poetry install --extras mpl_backend
poetry install --extras pg_backend

To install everything at once, run: ::

poetry install --with lint,test,docs --all-extras

To quickly check code for linting errors, it is recommended to set up ``pre-commit``
hooks by executing: ::

pre-commit install

.. _poetry: https://python-poetry.org
.. _matplotlib: https://matplotlib.org
.. _pyqtgraph: https://www.pyqtgraph.org
82 changes: 82 additions & 0 deletions _sources/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
Welcome to symmeplot's documentation!
=====================================

SymMePlot is a visualization tool designed for mechanical systems created using the
mechanics module in SymPy_, :mod:`sympy.physics.mechanics`.

The :mod:`sympy.physics.mechanics` module allows users to define mechanical systems
symbolically to derive their analytic equations of motion. During this process, users
can construct various objects such as reference frames, points, bodies, and more.

SymMePlot enhances this process by providing a way to visualize these constructed
objects. It integrates with visualization backends like Matplotlib_, and creates visual
representations based on the parametrization of the symbols involved in the system.

To install :mod:`symmeplot` with the :mod:`matplotlib` visualization run: ::

pip install symmeplot matplotlib

Most of your programs are expected to follow this structure:

1. Creation of the system in sympy using the objects from
:mod:`sympy.physics.mechanics`.
2. Create a figure with a 3D axes with :mod:`matplotlib`.
3. Initiate a :class:`Scene<symmeplot.matplotlib.scene.Scene3D>` with the inertial frame
and absolute origin.
4. Add your frames, vectors and points to the plotter instance.
5. Lambdify and evaluate the system.
6. Plot the system.

Here is a simple example of how it looks in practice: ::

import numpy as np
from symmeplot.matplotlib import Scene3D
from sympy.physics.mechanics import Point, ReferenceFrame, dynamicsymbols

# Create the system in sympy
N = ReferenceFrame("N")
A = ReferenceFrame("A")
q = dynamicsymbols("q")
A.orient_axis(N, N.z, q)
N0 = Point("N_0")
v = 0.2 * N.x + 0.2 * N.y + 0.7 * N.z
A0 = N0.locatenew("A_0", v)
# Create the instance of the scene specifying the inertial frame and origin
scene = Scene3D(N, N0, scale=0.5)
# Add the objects to the system
scene.add_vector(v)
scene.add_frame(A, A0, ls="--")
scene.add_point(A0, color="g")
# Evaluate the system.
scene.lambdify_system(q)
scene.evaluate_system(0.5)
# Plot the system
scene.plot()

# You can also animate this system.
ani = scene.animate(lambda q: (q,), frames=np.linspace(0, 2 * np.pi, 60))
ani.save("animation.gif", fps=30)

.. image:: animation.gif
:alt: animation
:align: center

To convert the plot to a 2D variant, at the following line before `scene.plot()`: ::

scene.as_orthogonal_projection_plot()

.. image:: animation_2d.gif
:alt: animation
:align: center

Contents
========

.. toctree::
:maxdepth: 2

guides/installation
api/index

.. _SymPy: https://www.sympy.org
.. _Matplotlib: https://matplotlib.org/
Loading

0 comments on commit c292c89

Please sign in to comment.