Skip to content

Commit

Permalink
Fixed formatting issue in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nmnaughton committed Apr 8, 2020
1 parent db2b781 commit 525c8eb
Show file tree
Hide file tree
Showing 14 changed files with 319 additions and 312 deletions.
32 changes: 22 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"sphinx.ext.viewcode",
"sphinx_rtd_theme",
"sphinx.ext.mathjax",
"recommonmark",
]

# Add any paths that contain templates here, relative to this directory.
Expand All @@ -49,17 +50,28 @@
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []

autodoc_default_flags = [
"members",
"private-members",
"special-members",
"show-inheritance",
]
# autodoc_default_flags = [
# "members",
# "private-members",
# "special-members",
# "show-inheritance",
# ]

autodoc_default_options = {
'members': True,
'private-members': True,
'special-members': True,
'show-inheritance': True,
}

source_parsers = {
".md": "recommonmark.parser.CommonMarkParser",
source_suffix = {
'.rst': 'restructuredtext',
'.txt': 'markdown',
'.md': 'markdown',
}
source_suffix = [".rst", ".md"]

# source_parsers = { ".md": "recommonmark.parser.CommonMarkParser",}
# source_suffix = [".rst", ".md"]
# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand All @@ -70,4 +82,4 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
# html_static_path = ["_static"]
3 changes: 2 additions & 1 deletion docs/intro_page.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ PyElastica
.. image:: https://codecov.io/gh/mattialabteam/elastica-python/branch/master/graph/badge.svg?token=O8nBw9I5vr
:target: https://codecov.io/gh/mattialabteam/elastica-python
:alt: codecov

PyElastica is the python implementation of Elastica. The easiest way to install PyElastica is with PIP:

.. code:: console
Expand All @@ -28,4 +29,4 @@ Elastica++
~~~~~~~~~~
Elastica++ is a C++ implementation of Elastica.

.. _project website: https://cosseratrods.org
.. _project website: https://cosseratrods.org
6 changes: 0 additions & 6 deletions docs/requirements.txt

This file was deleted.

56 changes: 28 additions & 28 deletions elastica/boundary_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ class OneEndFixedRod(FreeRod):
this boundary condition fixes position and directors
at the first node and first element of the rod.
Attributes
----------
fixed_positions : numpy.ndarray
2D (dim, 1) array containing data with 'float' type.
fixed_directors : numpy.ndarray
3D (dim, dim, 1) array containing data with 'float' type.
Attributes
----------
fixed_positions : numpy.ndarray
2D (dim, 1) array containing data with 'float' type.
fixed_directors : numpy.ndarray
3D (dim, dim, 1) array containing data with 'float' type.
"""

def __init__(self, fixed_position, fixed_directors):
Expand Down Expand Up @@ -103,28 +103,28 @@ class HelicalBucklingBC(FreeRod):
The applied boundary condition is twist and slack on to
the first and last nodes and elements of the rod.
Attributes
----------
twisting_time: float
Time to complete twist.
final_start_position: numpy.ndarray
2D (dim, 1) array containing data with 'float' type.
Position of first node of rod after twist completed.
final_end_position: numpy.ndarray
2D (dim, 1) array containing data with 'float' type.
Position of last node of rod after twist completed.
ang_vel: numpy.ndarray
2D (dim, 1) array containing data with 'float' type.
Angular velocity of rod during twisting time.
shrink_vel: numpy.ndarray
2D (dim, 1) array containing data with 'float' type.
Shrink velocity of rod during twisting time.
final_start_directors: numpy.ndarray
3D (dim, dim, blocksize) array containing data with 'float' type.
Directors of first element of rod after twist completed.
final_end_directors: numpy.ndarray
3D (dim, dim, blocksize) array containing data with 'float' type.
Directors of last element of rod after twist completed.
Attributes
----------
twisting_time: float
Time to complete twist.
final_start_position: numpy.ndarray
2D (dim, 1) array containing data with 'float' type.
Position of first node of rod after twist completed.
final_end_position: numpy.ndarray
2D (dim, 1) array containing data with 'float' type.
Position of last node of rod after twist completed.
ang_vel: numpy.ndarray
2D (dim, 1) array containing data with 'float' type.
Angular velocity of rod during twisting time.
shrink_vel: numpy.ndarray
2D (dim, 1) array containing data with 'float' type.
Shrink velocity of rod during twisting time.
final_start_directors: numpy.ndarray
3D (dim, dim, blocksize) array containing data with 'float' type.
Directors of first element of rod after twist completed.
final_end_directors: numpy.ndarray
3D (dim, dim, blocksize) array containing data with 'float' type.
Directors of last element of rod after twist completed.
"""
Expand Down
12 changes: 6 additions & 6 deletions elastica/callback_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ class MyCallBack(CallBackBaseClass):
This is just an example of a callback class, this class as an example/template to write
new call back classes in your client file.
Attributes
----------
sample_every: int
Collect data using make_callback method every sampling step.
callback_params: dict
Collected callback data is saved in this dictionary.
Attributes
----------
sample_every: int
Collect data using make_callback method every sampling step.
callback_params: dict
Collected callback data is saved in this dictionary.
"""

def __init__(self, step_skip: int, callback_params):
Expand Down
68 changes: 34 additions & 34 deletions elastica/external_forces.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ class GravityForces(NoForces):
"""
This class applies a constant gravitational force to the entire rod.
Attributes
----------
acc_gravity: numpy.ndarray
1D (dim) array containing data with 'float' type. Gravitational acceleration vector.
Attributes
----------
acc_gravity: numpy.ndarray
1D (dim) array containing data with 'float' type. Gravitational acceleration vector.
"""

Expand All @@ -92,14 +92,14 @@ class EndpointForces(NoForces):
"""
This class applies constant forces on the endpoint nodes.
Attributes
----------
start_force: numpy.ndarray
2D (dim, 1) array containing data with 'float' type. Force applied to first node of the rod-like object.
end_force: numpy.ndarray
2D (dim, 1) array containing data with 'float' type. Force applied to last node of the rod-like object.
ramp_up_time: float
Applied forces are ramped up until ramp up time.
Attributes
----------
start_force: numpy.ndarray
2D (dim, 1) array containing data with 'float' type. Force applied to first node of the rod-like object.
end_force: numpy.ndarray
2D (dim, 1) array containing data with 'float' type. Force applied to last node of the rod-like object.
ramp_up_time: float
Applied forces are ramped up until ramp up time.
"""

Expand Down Expand Up @@ -135,10 +135,10 @@ class UniformTorques(NoForces):
"""
This class applies a uniform torque to the entire rod.
Attributes
----------
torque: numpy.ndarray
2D (dim, 1) array containing data with 'float' type. Total torque applied to a rod-like object.
Attributes
----------
torque: numpy.ndarray
2D (dim, 1) array containing data with 'float' type. Total torque applied to a rod-like object.
"""

Expand Down Expand Up @@ -167,10 +167,10 @@ class UniformForces(NoForces):
"""
This class applies a uniform force to the entire rod.
Attributes
----------
force: numpy.ndarray
2D (dim, 1) array containing data with 'float' type. Total force applied to a rod-like object.
Attributes
----------
force: numpy.ndarray
2D (dim, 1) array containing data with 'float' type. Total force applied to a rod-like object.
"""

def __init__(self, force, direction=np.array([0.0, 0.0, 0.0])):
Expand Down Expand Up @@ -205,20 +205,20 @@ class MuscleTorques(NoForces):
as a traveling wave. For implementation details refer to Gazzola et. al.
RSoS. (2018).
Attributes
----------
direction: numpy.ndarray
2D (dim, 1) array containing data with 'float' type. Muscle torque direction.
angular_frequency: float
Angular frequency of traveling wave.
wave_number: float
Wave number of traveling wave.
phase_shift: float
Phase shift of traveling wave.
ramp_up_time: float
Applied muscle torques are ramped up until ramp up time.
my_spline: numpy.ndarray
1D (blocksize) array containing data with 'float' type. Generated spline.
Attributes
----------
direction: numpy.ndarray
2D (dim, 1) array containing data with 'float' type. Muscle torque direction.
angular_frequency: float
Angular frequency of traveling wave.
wave_number: float
Wave number of traveling wave.
phase_shift: float
Phase shift of traveling wave.
ramp_up_time: float
Applied muscle torques are ramped up until ramp up time.
my_spline: numpy.ndarray
1D (blocksize) array containing data with 'float' type. Generated spline.
"""

Expand Down
76 changes: 38 additions & 38 deletions elastica/interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,20 @@ class InteractionPlane:
force on a rod-like object. For more details regarding the contact module refer to
Eqn 4.8 of Gazzola et al. RSoS (2018).
Attributes
----------
k: float
Stiffness coefficient between the plane and the rod-like object.
nu: float
Dissipation coefficient between the plane and the rod-like object.
plane_origin: numpy.ndarray
2D (dim, 1) array containing data with 'float' type.
Origin of the plane.
plane_normal: numpy.ndarray
2D (dim, 1) array containing data with 'float' type.
The normal vector of the plane.
surface_tol: float
Penetration tolerance between the plane and the rod-like object.
Attributes
----------
k: float
Stiffness coefficient between the plane and the rod-like object.
nu: float
Dissipation coefficient between the plane and the rod-like object.
plane_origin: numpy.ndarray
2D (dim, 1) array containing data with 'float' type.
Origin of the plane.
plane_normal: numpy.ndarray
2D (dim, 1) array containing data with 'float' type.
The normal vector of the plane.
surface_tol: float
Penetration tolerance between the plane and the rod-like object.
"""

Expand Down Expand Up @@ -212,26 +212,26 @@ class AnisotropicFrictionalPlane(NoForces, InteractionPlane):
A detailed explanation of the implemented equations
can be found in Gazzola et al. RSoS. (2018).
Attributes
----------
k: float
Stiffness coefficient between the plane and the rod-like object.
nu: float
Dissipation coefficient between the plane and the rod-like object.
plane_origin: numpy.ndarray
2D (dim, 1) array containing data with 'float' type.
Origin of the plane.
plane_normal: numpy.ndarray
2D (dim, 1) array containing data with 'float' type.
The normal vector of the plane.
slip_velocity_tol: float
Velocity tolerance to determine if the element is slipping or not.
static_mu_array: numpy.ndarray
1D (3,) array containing data with 'float' type.
[forward, backward, sideways] static friction coefficients.
kinetic_mu_array: numpy.ndarray
1D (3,) array containing data with 'float' type.
[forward, backward, sideways] kinetic friction coefficients.
Attributes
----------
k: float
Stiffness coefficient between the plane and the rod-like object.
nu: float
Dissipation coefficient between the plane and the rod-like object.
plane_origin: numpy.ndarray
2D (dim, 1) array containing data with 'float' type.
Origin of the plane.
plane_normal: numpy.ndarray
2D (dim, 1) array containing data with 'float' type.
The normal vector of the plane.
slip_velocity_tol: float
Velocity tolerance to determine if the element is slipping or not.
static_mu_array: numpy.ndarray
1D (3,) array containing data with 'float' type.
[forward, backward, sideways] static friction coefficients.
kinetic_mu_array: numpy.ndarray
1D (3,) array containing data with 'float' type.
[forward, backward, sideways] kinetic friction coefficients.
"""

def __init__(
Expand Down Expand Up @@ -661,10 +661,10 @@ class SlenderBodyTheory(NoForces):
forces on the body using the slender body theory given in
Eq. 4.13 of Gazzola et al. RSoS (2018).
Attributes
----------
dynamic_viscosity: float
Dynamic viscosity of the fluid.
Attributes
----------
dynamic_viscosity: float
Dynamic viscosity of the fluid.
"""

Expand Down

0 comments on commit 525c8eb

Please sign in to comment.