Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functions to compute topological quantities #70

Merged
merged 21 commits into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ exclude_lines =
# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:
...
pass
def __repr__
from
import


[run]
branch = True
Expand Down
6 changes: 5 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ ignore = E203, E266, E501, W503, F403, F401, W191
max-line-length = 88
max-complexity = 18
select = B,C,E,F,W,T4,B9
exclude = .git,__pycache__,elastica/rod.py
exclude =
.git,
__pycache__,
docs/conf.py
tests
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ flake8:
@flake8 --version
@flake8 elastica tests

test:
@python -m pytest

all:black flake8
ci:black_check flake8
17 changes: 15 additions & 2 deletions docs/api/rods.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Rods
=====
====

.. automodule:: elastica.rod.rod_base
:members:
:exclude-members: __weakref__

Cosserat Rod
~~~~~~~~~~~~
------------

+------------+-------------------+----------------------------------------+-----------------------------+
| | On Nodes (+1) | On Elements (n_elements) | On Voronoi (-1) |
Expand Down Expand Up @@ -39,9 +39,22 @@ Cosserat Rod
.. automodule:: elastica.rod.cosserat_rod
:exclude-members: __weakref__, __init__, update_accelerations, zeroed_out_external_forces_and_torques, compute_internal_forces_and_torques
:members:
:inherited-members:

.. Constitutive Models
.. ~~~~~~~~~~~~~~~~~~~
.. .. automodule:: elastica.rod.constitutive_model
.. :members:
.. :exclude-members: __weakref__


Knot Theory (Mixin)
~~~~~~~~~~~~~~~~~~~

.. .. autoclass:: elastica.rod.knot_theory.KnotTheory

.. .. autoclass:: elastica.rod.knot_theory.KnotTheoryCompatibleProtocol

.. automodule:: elastica.rod.knot_theory
:exclude-members: __init__
:members:
3 changes: 3 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,8 @@
html_static_path = ['_static']
html_css_files = ['css/*', 'css/logo.css']

# -- Options for autodoc ---------------------------------------------------
autodoc_member_order = 'bysource'

# -- Options for numpydoc ---------------------------------------------------
numpydoc_show_class_members = False
1 change: 1 addition & 0 deletions elastica/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from collections import defaultdict
from elastica.wrappers import *
from elastica.rod.cosserat_rod import *
from elastica.rod.knot_theory import *
from elastica.rigidbody import *
from elastica.boundary_conditions import *
from elastica.external_forces import *
Expand Down
1 change: 1 addition & 0 deletions elastica/rod/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
__doc__ = """Rod classes and its data structures """


from elastica.rod.knot_theory import *
from elastica.rod.data_structures import *
from elastica.rod.rod_base import RodBase
3 changes: 2 additions & 1 deletion elastica/rod/cosserat_rod.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
)
from elastica._rotations import _inv_rotate
from elastica.rod.factory_function import allocate
from elastica.rod.knot_theory import KnotTheory
from elastica._calculus import (
quadrature_kernel_for_block_structure,
difference_kernel_for_block_structure,
Expand All @@ -31,7 +32,7 @@ def _get_z_vector():
return np.array([0.0, 0.0, 1.0]).reshape(3, -1)


class CosseratRod(RodBase):
class CosseratRod(RodBase, KnotTheory):
"""
Cosserat Rod class. This is the preferred class for rods because it is derived from some
of the essential base classes.
Expand Down
Loading