Skip to content

Commit

Permalink
Fix submodules import errors for autodoc
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Oct 4, 2023
1 parent fc09a7c commit a9bf126
Show file tree
Hide file tree
Showing 13 changed files with 125 additions and 32 deletions.
1 change: 1 addition & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
SPHINXPROJ = JAXsim

# Put it first so that "make" without argument is like "make help".
help:
Expand Down
11 changes: 7 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# Configuration file for the Sphinx documentation builder.
import pathlib
import sys
import os

# -- Version information

sys.path.insert(0, pathlib.Path(__file__).parents[2].absolute())
version_file = (
pathlib.Path(__file__).parents[1].absolute() / "src" / "jaxsim" / "version.txt"
)
sys.path.insert(0, os.path.abspath("."))
sys.path.insert(0, os.path.abspath("../"))

module_path = pathlib.Path(__file__).parent.parent.absolute() / "src"
sys.path.insert(0, str(module_path))
version_file = str(module_path / "jaxsim" / "version.txt")

with open(version_file) as file_handler:
__version__ = file_handler.read().strip()
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Prerequisites
JAXsim requires Python 3.10 or later.

Basic Installation
------------
------------------

You can install the project with `pypa/pip`, preferably in a `virtual environment`_:

Expand Down
5 changes: 2 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A scalable physics engine implemented with JAX. With JIT batteries 🔋
Features
--------

- Physics engine in reduced coordinates implemented with `JAX`_ in Python.
- Physics engine in reduced coordinates implemented with `JAX <https://github.com/google/jax>`_ in Python.
- Supported JIT compilation of Python code for increased performance.
- Transparent support to execute the simulation on CPUs, GPUs, and TPUs.
- Possibility to run parallel multi-body simulations on hardware accelerators for significantly increased throughput.
Expand All @@ -38,15 +38,14 @@ Planned features:
guide/install

.. toctree::
:maxdepth: 3
:maxdepth: 2
:caption: JAXsim API Reference

modules/high_level
modules/math
modules/physics
modules/parsers
modules/simulation
modules/sixd
modules/utils


Expand Down
1 change: 1 addition & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if "%SPHINXBUILD%" == "" (
)
set SOURCEDIR=.
set BUILDDIR=_build
set SPHINXPROJ=JaxSim

if "%1" == "" goto help

Expand Down
10 changes: 9 additions & 1 deletion docs/modules/high_level.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
High Level
==========

.. automodule:: src.jaxsim.high_level
.. autoclass:: jaxsim.high_level.model.Model
:members:
:inherited-members:

.. autoclass:: jaxsim.high_level.joint.Joint
:members:
:inherited-members:

.. autoclass:: jaxsim.high_level.link.Link
:members:
:inherited-members:
36 changes: 34 additions & 2 deletions docs/modules/math.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,38 @@
Math
====

.. automodule:: src.jaxsim.math
.. automodule:: jaxsim.math.adjoint
:members:
:inherited-members:
:inherited-members:

.. automodule:: jaxsim.math.conv
:members:
:inherited-members:

.. automodule:: jaxsim.math.cross
:members:
:inherited-members:

.. automodule:: jaxsim.math.inertia
:members:
:inherited-members:

.. automodule:: jaxsim.math.joint
:members:
:inherited-members:

.. automodule:: jaxsim.math.plucker
:members:
:inherited-members:

.. automodule:: jaxsim.math.quaternion
:members:
:inherited-members:

.. automodule:: jaxsim.math.rotation
:members:
:inherited-members:

.. automodule:: jaxsim.math.skew
:members:
:inherited-members:
16 changes: 14 additions & 2 deletions docs/modules/parsers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@
Parsers
=======

.. automodule:: src.jaxsim.parsers
.. automodule:: jaxsim.parsers.descriptions.collision
:members:
:inherited-members:
:inherited-members:

.. automodule:: jaxsim.parsers.descriptions.joint
:members:
:inherited-members:

.. automodule:: jaxsim.parsers.descriptions.link
:members:
:inherited-members:

.. automodule:: jaxsim.parsers.descriptions.model
:members:
:inherited-members:
50 changes: 48 additions & 2 deletions docs/modules/physics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,52 @@
Physics
=======

.. automodule:: src.jaxsim.physics
.. _algos:

Algos
-----

.. automodule:: jaxsim.physics.algos

.. autofunction:: jaxsim.physics.algos.aba.aba

.. autofunction:: jaxsim.physics.algos.crba.crba


.. autofunction:: jaxsim.physics.algos.forward_kinematics.forward_kinematics

.. autofunction:: jaxsim.physics.algos.jacobian.jacobian

.. autofunction:: jaxsim.physics.algos.rnea.rnea

.. automodule:: jaxsim.physics.algos.soft_contacts
:members:
:inherited-members:

.. automodule:: jaxsim.physics.algos.terrain
:members:
:inherited-members:

.. automodule:: jaxsim.physics.algos.utils
:members:
:inherited-members:
:inherited-members:

Model
-----

.. automodule:: jaxsim.physics.model
:members:
:inherited-members:

.. automodule:: jaxsim.physics.model.ground_contact
:members:
:inherited-members:

.. automodule:: jaxsim.physics.model.physics_model_state
:members:
:inherited-members:

.. automodule:: jaxsim.physics.model.physics_model
:members:
:inherited-members:

10 changes: 5 additions & 5 deletions docs/modules/simulation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
Simulation
==========

.. automodule:: src.jaxsim.simulation
.. automodule:: jaxsim.simulation

.. autoclass:: src.jaxsim.simulation.SimulatorData
.. autoclass:: jaxsim.simulation.simulator.SimulatorData
:members:
:inherited-members:

.. autoclass:: src.jaxsim.simulation.JaxSim
:members:
:inherited-members:
.. autoclass:: jaxsim.simulation.simulator.JaxSim
:members:
:inherited-members:
9 changes: 0 additions & 9 deletions docs/modules/sixd.rst

This file was deleted.

4 changes: 2 additions & 2 deletions docs/modules/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@


Utils
==========
=====

.. automodule:: src.jaxsim.utils
.. automodule:: jaxsim.utils
:members:
:inherited-members:
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sphinx==7.1.2
sphinx-rtd-theme==1.3.0rc1
sphinx_autodoc_typehints
sphinx_copybutton
sphinx_copybutton

0 comments on commit a9bf126

Please sign in to comment.