diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c89a310fb..6e303b2e7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 diff --git a/README.md b/README.md index e2bc0cfba..9c5556985 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/docs/intro_page.rst.inc b/docs/intro_page.rst.inc index 7d8f0a73e..df54d1050 100644 --- a/docs/intro_page.rst.inc +++ b/docs/intro_page.rst.inc @@ -27,8 +27,6 @@ You can also download the source code for PyElastica directly from `GitHub `__). - ``examples``: installs dependencies to run example cases, found under the folder `examples `__. - ``docs``: packages to build documentation @@ -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 `__. Elastica++ diff --git a/docs/overview/installation.md b/docs/overview/installation.md index 54ffc3f08..1355d9cfa 100644 --- a/docs/overview/installation.md +++ b/docs/overview/installation.md @@ -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: diff --git a/elastica/transformations.py b/elastica/transformations.py index 882094c48..733114011 100644 --- a/elastica/transformations.py +++ b/elastica/transformations.py @@ -17,6 +17,7 @@ def format_vector_shape(vector_collection): """ Function for formatting vector shapes into correct format + Parameters ---------- vector_collection: numpy.ndarray @@ -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 diff --git a/elastica/utils.py b/elastica/utils.py index 5d84741c9..bbf9baa2d 100644 --- a/elastica/utils.py +++ b/elastica/utils.py @@ -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 @@ -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__ diff --git a/poetry.lock b/poetry.lock index 6b2d37497..df0668b0e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry and should not be changed by hand. +# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand. [[package]] name = "accessible-pygments" @@ -108,14 +108,14 @@ uvloop = ["uvloop (>=0.15.2)"] [[package]] name = "certifi" -version = "2022.12.7" +version = "2023.5.7" description = "Python package for providing Mozilla's CA Bundle." category = "main" optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2022.12.7-py3-none-any.whl", hash = "sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18"}, - {file = "certifi-2022.12.7.tar.gz", hash = "sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3"}, + {file = "certifi-2023.5.7-py3-none-any.whl", hash = "sha256:c6c2e98f5c7869efca1f8916fed228dd91539f9f1b444c314c06eef02980c716"}, + {file = "certifi-2023.5.7.tar.gz", hash = "sha256:0f0d56dc5a6ad56fd4ba36484d6cc34451e1c6548c61daad8c320169f91eddc7"}, ] [[package]] @@ -504,14 +504,14 @@ pyflakes = ">=2.3.0,<2.4.0" [[package]] name = "fonttools" -version = "4.39.3" +version = "4.39.4" description = "Tools to manipulate font files" category = "main" optional = true python-versions = ">=3.8" files = [ - {file = "fonttools-4.39.3-py3-none-any.whl", hash = "sha256:64c0c05c337f826183637570ac5ab49ee220eec66cf50248e8df527edfa95aeb"}, - {file = "fonttools-4.39.3.zip", hash = "sha256:9234b9f57b74e31b192c3fc32ef1a40750a8fbc1cd9837a7b7bfc4ca4a5c51d7"}, + {file = "fonttools-4.39.4-py3-none-any.whl", hash = "sha256:106caf6167c4597556b31a8d9175a3fdc0356fdcd70ab19973c3b0d4c893c461"}, + {file = "fonttools-4.39.4.zip", hash = "sha256:dba8d7cdb8e2bac1b3da28c5ed5960de09e59a2fe7e63bb73f5a59e57b0430d2"}, ] [package.extras] @@ -752,24 +752,6 @@ files = [ {file = "llvmlite-0.38.1.tar.gz", hash = "sha256:0622a86301fcf81cc50d7ed5b4bebe992c030580d413a8443b328ed4f4d82561"}, ] -[[package]] -name = "magneto-pyelastica" -version = "0.0.1" -description = "Python software for simulating magnetic Cosserat rods." -category = "main" -optional = true -python-versions = ">=3.8,<3.11" -files = [ - {file = "magneto_pyelastica-0.0.1-py3-none-any.whl", hash = "sha256:1366a98b099de3599fd683df91de1255bf3f00b8e5a3f28f47deb087ba5e9d95"}, - {file = "magneto_pyelastica-0.0.1.tar.gz", hash = "sha256:32f5b54f4b941730bacd7054ba1d0f4b6195cadb42bd9d7e1eb38fa6f1b978c7"}, -] - -[package.dependencies] -pyelastica = ">=0.3,<0.4" - -[package.extras] -examples = ["cma[examples] (>=3.2.2)", "matplotlib[examples] (>=3.3.2,<4.0.0)"] - [[package]] name = "markdown-it-py" version = "2.2.0" @@ -1003,14 +985,14 @@ testing-docutils = ["pygments", "pytest (>=7,<8)", "pytest-param-files (>=0.3.4, [[package]] name = "nodeenv" -version = "1.7.0" +version = "1.8.0" description = "Node.js virtual environment builder" category = "dev" optional = false python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*" files = [ - {file = "nodeenv-1.7.0-py2.py3-none-any.whl", hash = "sha256:27083a7b96a25f2f5e1d8cb4b6317ee8aeda3bdd121394e5ac54e498028a042e"}, - {file = "nodeenv-1.7.0.tar.gz", hash = "sha256:e0e7f7dfb85fc5394c6fe1e8fa98131a2473e04311a45afb6508f7cf1836fa2b"}, + {file = "nodeenv-1.8.0-py2.py3-none-any.whl", hash = "sha256:df865724bb3c3adc86b3876fa209771517b0cfe596beff01a92700e0e8be4cec"}, + {file = "nodeenv-1.8.0.tar.gz", hash = "sha256:d51e0c37e64fbf47d017feac3145cdbb58836d7eee8c6f6d3b6880c5456227d2"}, ] [package.dependencies] @@ -1216,18 +1198,18 @@ tests = ["check-manifest", "coverage", "defusedxml", "markdown2", "olefile", "pa [[package]] name = "platformdirs" -version = "3.5.0" +version = "3.5.1" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "platformdirs-3.5.0-py3-none-any.whl", hash = "sha256:47692bc24c1958e8b0f13dd727307cff1db103fca36399f457da8e05f222fdc4"}, - {file = "platformdirs-3.5.0.tar.gz", hash = "sha256:7954a68d0ba23558d753f73437c55f89027cf8f5108c19844d4b82e5af396335"}, + {file = "platformdirs-3.5.1-py3-none-any.whl", hash = "sha256:e2378146f1964972c03c085bb5662ae80b2b8c06226c54b2ff4aa9483e8a13a5"}, + {file = "platformdirs-3.5.1.tar.gz", hash = "sha256:412dae91f52a6f84830f39a8078cecd0e866cb72294a5c66808e74d5e88d251f"}, ] [package.extras] -docs = ["furo (>=2023.3.27)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.23,!=1.23.4)"] +docs = ["furo (>=2023.3.27)", "proselint (>=0.13)", "sphinx (>=6.2.1)", "sphinx-autodoc-typehints (>=1.23,!=1.23.4)"] test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.3.1)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] [[package]] @@ -1523,21 +1505,21 @@ files = [ [[package]] name = "requests" -version = "2.29.0" +version = "2.30.0" description = "Python HTTP for Humans." category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "requests-2.29.0-py3-none-any.whl", hash = "sha256:e8f3c9be120d3333921d213eef078af392fba3933ab7ed2d1cba3b56f2568c3b"}, - {file = "requests-2.29.0.tar.gz", hash = "sha256:f2e34a75f4749019bb0e3effb66683630e4ffeaf75819fb51bebef1bf5aef059"}, + {file = "requests-2.30.0-py3-none-any.whl", hash = "sha256:10e94cc4f3121ee6da529d358cdaeaff2f1c409cd377dbc72b825852f2f7e294"}, + {file = "requests-2.30.0.tar.gz", hash = "sha256:239d7d4458afcb28a692cdd298d87542235f4ca8d36d03a15bfc128a6559a2f4"}, ] [package.dependencies] certifi = ">=2017.4.17" charset-normalizer = ">=2,<4" idna = ">=2.5,<4" -urllib3 = ">=1.21.1,<1.27" +urllib3 = ">=1.21.1,<3" [package.extras] socks = ["PySocks (>=1.5.6,!=1.5.7)"] @@ -1854,20 +1836,21 @@ files = [ [[package]] name = "urllib3" -version = "1.26.15" +version = "2.0.2" description = "HTTP library with thread-safe connection pooling, file post, and more." category = "main" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" +python-versions = ">=3.7" files = [ - {file = "urllib3-1.26.15-py2.py3-none-any.whl", hash = "sha256:aa751d169e23c7479ce47a0cb0da579e3ede798f994f5816a74e4f4500dcea42"}, - {file = "urllib3-1.26.15.tar.gz", hash = "sha256:8a388717b9476f934a21484e8c8e61875ab60644d29b9b39e11e4b9dc1c6b305"}, + {file = "urllib3-2.0.2-py3-none-any.whl", hash = "sha256:d055c2f9d38dc53c808f6fdc8eab7360b6fdbbde02340ed25cfbcd817c62469e"}, + {file = "urllib3-2.0.2.tar.gz", hash = "sha256:61717a1095d7e155cdb737ac7bb2f4324a858a1e2e6466f6d03ff630ca68d3cc"}, ] [package.extras] -brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] -secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] -socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] +brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] +secure = ["certifi", "cryptography (>=1.9)", "idna (>=2.0.0)", "pyopenssl (>=17.1.0)", "urllib3-secure-extra"] +socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] +zstd = ["zstandard (>=0.18.0)"] [[package]] name = "virtualenv" @@ -1907,11 +1890,10 @@ docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] [extras] -docs = ["Sphinx", "sphinx-book-theme", "readthedocs-sphinx-search", "sphinx-autodoc-typehints", "myst-parser", "numpydoc", "docutils"] +docs = ["Sphinx", "docutils", "myst-parser", "numpydoc", "readthedocs-sphinx-search", "sphinx-autodoc-typehints", "sphinx-book-theme"] examples = ["cma", "matplotlib"] -magnetism = ["magneto_pyelastica"] [metadata] lock-version = "2.0" python-versions = ">=3.8,<3.11" -content-hash = "4b347d7999fd31005be943c17f8dd339a97d1428964c21adab387f046937260b" +content-hash = "d6875ca8b2537e46d0a84e52987dc45240171c47c72d0f8e8c82b72a03a2e225" diff --git a/pyproject.toml b/pyproject.toml index 3dd5701d5..5930ac6db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" @@ -80,9 +79,6 @@ examples = [ "cma", "matplotlib", ] -magnetism = [ - "magneto_pyelastica", -] [tool.black] # https://github.com/psf/black