Skip to content

Commit

Permalink
fix:remove circular dependency of magnetopyelastica
Browse files Browse the repository at this point in the history
  • Loading branch information
armantekinalp committed May 12, 2023
1 parent 5ffa54e commit 9d53228
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 65 deletions.
3 changes: 0 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ make pre-commit-install
If you are planning to contribute to the examples,
extra dependencies can be installed using `poetry install -E examples`.

If you are planning to contribute on the functionality for simulating magnetic Cosserat rods,
implementation details can be found [here](https://github.com/armantekinalp/MagnetoPyElastica).

If you are planning to contribute on documentation, extra dependencies can be installed
using `poetry install -E docs`.
The detail instruction is included
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,25 @@ $ pip install pyelastica
With this you get a minimal version with very little dependencies.

All options:
- `magnetism`: use this if you want to simulate magnetic Cosserat rods
interacting with external magnetic environments (details can be found [here](https://github.com/armantekinalp/MagnetoPyElastica)) .
- `examples`: installs dependencies to run example cases,
found under the folder `examples`.
found under the folder [`examples`](https://github.com/GazzolaLab/PyElastica/tree/master/examples).
- `docs`: packages to build documentation

Options can be combined e.g.
```bash
pip install "pyelastica[magnetism,examples,docs]"
$ pip install "pyelastica[examples,docs]"
```

Documentation of PyElastica is available [here][link-docs-website].

Example cases for simulating magnetic Cosserat rods can be found [here](https://github.com/armantekinalp/MagnetoPyElastica).
If you want to simulate magnetic Cosserat rods interacting with external magnetic environments you can install the derived package using

```bash
$ pip install magneto_pyelastica
```

Details can be found [here](https://github.com/armantekinalp/MagnetoPyElastica).

## Citation

We ask that any publications which use Elastica cite as following:
Expand Down
12 changes: 9 additions & 3 deletions docs/intro_page.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ You can also download the source code for PyElastica directly from `GitHub <http

All options:

- ``magnetism``: use this if you want to simulate magnetic Cosserat rods
interacting with external magnetic environments (details can be found `here <https://github.com/armantekinalp/MagnetoPyElastica>`__).
- ``examples``: installs dependencies to run example cases,
found under the folder `examples <https://github.com/GazzolaLab/PyElastica/tree/master/examples>`__.
- ``docs``: packages to build documentation
Expand All @@ -37,7 +35,15 @@ Options can be combined, e.g.

.. code-block:: bash

$ pip install "pyelastica[magnetism,examples,docs]"
$ pip install "pyelastica[examples,docs]"

If you want to simulate magnetic Cosserat rods interacting with external magnetic environments you can install the derived package using

.. code-block:: bash

$ pip install magneto_pyelastica

Details can be found `here <https://github.com/armantekinalp/MagnetoPyElastica>`__.


Elastica++
Expand Down
12 changes: 9 additions & 3 deletions docs/overview/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,23 @@ $ pip install pyelastica
You can also download the source code for PyElastica directly from [GitHub](https://github.com/GazzolaLab/PyElastica).

All options:
- `magnetism`: use this if you want to simulate magnetic Cosserat rods
interacting with external magnetic environments (details can be found [here](https://github.com/armantekinalp/MagnetoPyElastica)) .
- `examples`: installs dependencies to run example cases,
found under the folder [`examples`](https://github.com/GazzolaLab/PyElastica/tree/master/examples).
- `docs`: packages to build documentation

Options can be combined e.g.
```bash
$ pip install "pyelastica[magnetism,examples,docs]"
$ pip install "pyelastica[examples,docs]"
```

If you want to simulate magnetic Cosserat rods interacting with external magnetic environments you can install the derived package using

```bash
$ pip install magneto_pyelastica
```

Details can be found [here](https://github.com/armantekinalp/MagnetoPyElastica).

## Dependencies

The core of PyElastica is developed using:
Expand Down
2 changes: 2 additions & 0 deletions elastica/transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
def format_vector_shape(vector_collection):
"""
Function for formatting vector shapes into correct format
Parameters
----------
vector_collection: numpy.ndarray
Expand Down Expand Up @@ -61,6 +62,7 @@ def format_vector_shape(vector_collection):
def format_matrix_shape(matrix_collection):
"""
Formats input matrix into correct format
Parameters
----------
matrix_collection: numpy.ndarray
Expand Down
6 changes: 5 additions & 1 deletion elastica/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ def grouper(iterable, n):


def extend_instance(obj, cls):
"""Apply mixins to a class instance after creation
"""
Apply mixins to a class instance after creation
Parameters
----------
obj : object (not class!) targeted for interface extension
Expand All @@ -159,6 +162,7 @@ def extend_instance(obj, cls):
Credits
-------
https://stackoverflow.com/a/31075641
"""
base_cls = obj.__class__
base_cls_name = obj.__class__.__name__
Expand Down
74 changes: 28 additions & 46 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ numpydoc = {version = "^1.3.1", optional = true}
docutils = {version = "^0.18", optional = true}
cma = {version = "^3.2.2", optional = true}
matplotlib = {version = "^3.3.2", optional = true}
magneto_pyelastica = {version = "^0.0.1", optional = true}

[tool.poetry.dev-dependencies]
black = "21.12b0"
Expand Down Expand Up @@ -80,9 +79,6 @@ examples = [
"cma",
"matplotlib",
]
magnetism = [
"magneto_pyelastica",
]

[tool.black]
# https://github.com/psf/black
Expand Down

0 comments on commit 9d53228

Please sign in to comment.