From 197eba98558a869f7ca4b80a65cfd0ab12f20f1d Mon Sep 17 00:00:00 2001 From: Seung Hyun Kim Date: Tue, 16 Aug 2022 07:20:20 -0500 Subject: [PATCH 1/6] refactor tests: wrappers -> modules --- tests/{test_wrappers => test_modules}/test_base_system.py | 4 ++-- tests/{test_wrappers => test_modules}/test_callbacks.py | 8 ++++---- tests/{test_wrappers => test_modules}/test_connections.py | 8 ++++---- tests/{test_wrappers => test_modules}/test_constraints.py | 8 ++++---- tests/{test_wrappers => test_modules}/test_damping.py | 8 ++++---- tests/{test_wrappers => test_modules}/test_forcing.py | 8 ++++---- .../{test_wrappers => test_modules}/test_memory_block.py | 4 ++-- tests/test_restart.py | 2 +- 8 files changed, 25 insertions(+), 25 deletions(-) rename tests/{test_wrappers => test_modules}/test_base_system.py (98%) rename tests/{test_wrappers => test_modules}/test_callbacks.py (97%) rename tests/{test_wrappers => test_modules}/test_connections.py (98%) rename tests/{test_wrappers => test_modules}/test_constraints.py (98%) rename tests/{test_wrappers => test_modules}/test_damping.py (97%) rename tests/{test_wrappers => test_modules}/test_forcing.py (97%) rename tests/{test_wrappers => test_modules}/test_memory_block.py (96%) diff --git a/tests/test_wrappers/test_base_system.py b/tests/test_modules/test_base_system.py similarity index 98% rename from tests/test_wrappers/test_base_system.py rename to tests/test_modules/test_base_system.py index 60bb8f68f..da0889e79 100644 --- a/tests/test_wrappers/test_base_system.py +++ b/tests/test_modules/test_base_system.py @@ -1,9 +1,9 @@ -__doc__ = """ Test wrappers for base systems """ +__doc__ = """ Test modules for base systems """ import pytest import numpy as np -from elastica.wrappers import ( +from elastica.modules import ( BaseSystemCollection, Constraints, Forcing, diff --git a/tests/test_wrappers/test_callbacks.py b/tests/test_modules/test_callbacks.py similarity index 97% rename from tests/test_wrappers/test_callbacks.py rename to tests/test_modules/test_callbacks.py index 95f737bff..6c3d31ff8 100644 --- a/tests/test_wrappers/test_callbacks.py +++ b/tests/test_modules/test_callbacks.py @@ -1,10 +1,10 @@ -__doc__ = """ Test wrappers for callback """ +__doc__ = """ Test modules for callback """ import numpy as np from numpy.testing import assert_allclose import pytest -from elastica.wrappers import CallBacks -from elastica.wrappers.callbacks import _CallBack +from elastica.modules import CallBacks +from elastica.modules.callbacks import _CallBack class TestCallBacks: @@ -61,7 +61,7 @@ def mock_init(self, *args, **kwargs): class TestCallBacksMixin: - from elastica.wrappers import BaseSystemCollection + from elastica.modules import BaseSystemCollection class SystemCollectionWithCallBacksMixedin(BaseSystemCollection, CallBacks): pass diff --git a/tests/test_wrappers/test_connections.py b/tests/test_modules/test_connections.py similarity index 98% rename from tests/test_wrappers/test_connections.py rename to tests/test_modules/test_connections.py index bdd5e5d99..04e422426 100644 --- a/tests/test_wrappers/test_connections.py +++ b/tests/test_modules/test_connections.py @@ -1,9 +1,9 @@ -__doc__ = """ Test wrappers for connections """ +__doc__ = """ Test modules for connections """ import numpy as np import pytest -from elastica.wrappers import Connections -from elastica.wrappers.connections import _Connect +from elastica.modules import Connections +from elastica.modules .connections import _Connect class TestConnect: @@ -176,7 +176,7 @@ def mock_init(self, *args, **kwargs): class TestConnectionsMixin: - from elastica.wrappers import BaseSystemCollection + from elastica.modules import BaseSystemCollection class SystemCollectionWithConnectionsMixedin(BaseSystemCollection, Connections): pass diff --git a/tests/test_wrappers/test_constraints.py b/tests/test_modules/test_constraints.py similarity index 98% rename from tests/test_wrappers/test_constraints.py rename to tests/test_modules/test_constraints.py index 230dbc1cc..4e1c834ff 100644 --- a/tests/test_wrappers/test_constraints.py +++ b/tests/test_modules/test_constraints.py @@ -1,10 +1,10 @@ -__doc__ = """ Test wrappers for constraints """ +__doc__ = """ Test modules for constraints """ import numpy as np from numpy.testing import assert_allclose import pytest -from elastica.wrappers import Constraints -from elastica.wrappers.constraints import _Constraint +from elastica.modules import Constraints +from elastica.modules.constraints import _Constraint class TestConstraint: @@ -207,7 +207,7 @@ def mock_init(self, nu, **kwargs): class TestConstraintsMixin: - from elastica.wrappers import BaseSystemCollection + from elastica.modules import BaseSystemCollection class SystemCollectionWithConstraintsMixedin(BaseSystemCollection, Constraints): pass diff --git a/tests/test_wrappers/test_damping.py b/tests/test_modules/test_damping.py similarity index 97% rename from tests/test_wrappers/test_damping.py rename to tests/test_modules/test_damping.py index 5c6208c96..f84e6ddf8 100644 --- a/tests/test_wrappers/test_damping.py +++ b/tests/test_modules/test_damping.py @@ -1,9 +1,9 @@ -__doc__ = """ Test wrappers for damping """ +__doc__ = """ Test modules for damping """ import numpy as np import pytest -from elastica.wrappers import Damping -from elastica.wrappers.damping import _Damper +from elastica.modules import Damping +from elastica.modules.damping import _Damper class TestDamper: @@ -83,7 +83,7 @@ def test_call_improper_bc_throws_type_error(self, load_damper): class TestDampingMixin: - from elastica.wrappers import BaseSystemCollection + from elastica.modules import BaseSystemCollection class SystemCollectionWithDampingMixedin(BaseSystemCollection, Damping): pass diff --git a/tests/test_wrappers/test_forcing.py b/tests/test_modules/test_forcing.py similarity index 97% rename from tests/test_wrappers/test_forcing.py rename to tests/test_modules/test_forcing.py index 1b1d11827..27e221a40 100644 --- a/tests/test_wrappers/test_forcing.py +++ b/tests/test_modules/test_forcing.py @@ -1,9 +1,9 @@ -__doc__ = """ Test wrappers for forcings """ +__doc__ = """ Test modules for forcings """ import numpy as np import pytest -from elastica.wrappers import Forcing -from elastica.wrappers.forcing import _ExtForceTorque +from elastica.modules import Forcing +from elastica.modules.forcing import _ExtForceTorque class TestExtForceTorque: @@ -67,7 +67,7 @@ def mock_init(self, *args, **kwargs): class TestForcingMixin: - from elastica.wrappers import BaseSystemCollection + from elastica.modules import BaseSystemCollection class SystemCollectionWithForcingMixedin(BaseSystemCollection, Forcing): pass diff --git a/tests/test_wrappers/test_memory_block.py b/tests/test_modules/test_memory_block.py similarity index 96% rename from tests/test_wrappers/test_memory_block.py rename to tests/test_modules/test_memory_block.py index 37f3829ce..36716aa37 100644 --- a/tests/test_wrappers/test_memory_block.py +++ b/tests/test_modules/test_memory_block.py @@ -1,10 +1,10 @@ -__doc__ = """" Test wrapper to construct memory block """ +__doc__ = """" Test modules to construct memory block """ import pytest import numpy as np from elastica.rod import RodBase -from elastica.wrappers.memory_block import construct_memory_block_structures +from elastica.modules.memory_block import construct_memory_block_structures from elastica.memory_block.memory_block_rod import MemoryBlockCosseratRod diff --git a/tests/test_restart.py b/tests/test_restart.py index 11b11ff57..0f18f7701 100644 --- a/tests/test_restart.py +++ b/tests/test_restart.py @@ -4,7 +4,7 @@ import numpy as np from numpy.testing import assert_allclose from elastica.utils import Tolerance -from elastica.wrappers import ( +from elastica.modules import ( BaseSystemCollection, Constraints, Forcing, From 1c8c70334e904924b7cebc772011270c87a02401 Mon Sep 17 00:00:00 2001 From: Seung Hyun Kim Date: Tue, 16 Aug 2022 07:21:23 -0500 Subject: [PATCH 2/6] refactor docs: wrappers -> modules --- docs/api/simulator.rst | 14 +++++++------- docs/guide/workflow.md | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/api/simulator.rst b/docs/api/simulator.rst index eb74f8294..3e9283a47 100644 --- a/docs/api/simulator.rst +++ b/docs/api/simulator.rst @@ -1,26 +1,26 @@ Simulator ========= -.. automodule:: elastica.wrappers.base_system +.. automodule:: elastica.modules.base_system :members: :exclude-members: __weakref__, __init__, __str__, insert -.. automodule:: elastica.wrappers.callbacks +.. automodule:: elastica.modules.callbacks :members: :exclude-members: __weakref__, __init__, _callbacks, _CallBack -.. automodule:: elastica.wrappers.connections +.. automodule:: elastica.modules.connections :members: :exclude-members: __weakref__, __init__, __call__, _Connect -.. automodule:: elastica.wrappers.constraints +.. automodule:: elastica.modules.constraints :members: :exclude-members: __weakref__, __init__, _Constraint -.. automodule:: elastica.wrappers.forcing +.. automodule:: elastica.modules.forcing :members: :exclude-members: __weakref__, __init__, __call__, _ExtForceTorque -.. automodule:: elastica.wrappers.damping +.. automodule:: elastica.modules.damping :members: - :exclude-members: __weakref__, __init__, __call__, _Damper \ No newline at end of file + :exclude-members: __weakref__, __init__, __call__, _Damper diff --git a/docs/guide/workflow.md b/docs/guide/workflow.md index 5487f8215..cd07a78f5 100644 --- a/docs/guide/workflow.md +++ b/docs/guide/workflow.md @@ -9,7 +9,7 @@ When using PyElastica, users will setup a simulation in which they define a syst

1. Setup Simulation

```python -from elastica.wrappers import ( +from elastica.modules import ( BaseSystemCollection, Connections, Constraints, @@ -28,7 +28,7 @@ class SystemSimulator( ): pass ``` -This simply combines all the wrappers previously imported together. If a wrapper is not needed for the simulation, it does not need to be added here. +This simply combines all the modules previously imported together. If a modules are not needed for the simulation, it does not need to be added here. Available components are: From b84a2aed75b4e23fb0a6ccb802c80c4a913a8000 Mon Sep 17 00:00:00 2001 From: Seung Hyun Kim Date: Tue, 16 Aug 2022 07:22:43 -0500 Subject: [PATCH 3/6] refactor examples: wrappers -> modules --- examples/Binder/1_Timoshenko_Beam.ipynb | 8 ++++---- examples/Binder/2_Slithering_Snake.ipynb | 8 ++++---- .../ContinuumSnakeVisualization/continuum_snake.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/Binder/1_Timoshenko_Beam.ipynb b/examples/Binder/1_Timoshenko_Beam.ipynb index ec15303a2..5a2f41a3e 100644 --- a/examples/Binder/1_Timoshenko_Beam.ipynb +++ b/examples/Binder/1_Timoshenko_Beam.ipynb @@ -15,7 +15,7 @@ "![timoshenko_beam_figure.png](../../assets/timoshenko_beam_figure.png)\n", "\n", "## Getting Started\n", - "To set up the simulation, the first thing you need to do is import the necessary classes. Here we will only import the classes that we need. The `elastica.wrappers` classes make it easy to construct different simulation systems. Along with these wrappers, we need to import a rod class, classes for the boundary conditions, and time-stepping functions. As a note, this method of explicitly importing all classes can be a bit cumbersome. Future releases will simplify this step." + "To set up the simulation, the first thing you need to do is import the necessary classes. Here we will only import the classes that we need. The `elastica.modules` classes make it easy to construct different simulation systems. Along with these modules, we need to import a rod class, classes for the boundary conditions, and time-stepping functions. As a note, this method of explicitly importing all classes can be a bit cumbersome. Future releases will simplify this step." ] }, { @@ -41,8 +41,8 @@ "source": [ "import numpy as np\n", "\n", - "# Import Wrappers\n", - "from elastica.wrappers import BaseSystemCollection, Constraints, Forcing, Damping\n", + "# Import modules\n", + "from elastica.modules import BaseSystemCollection, Constraints, Forcing, Damping\n", "\n", "# Import Cosserat Rod Class\n", "from elastica.rod.cosserat_rod import CosseratRod\n", @@ -67,7 +67,7 @@ } }, "source": [ - "Now that we have imported all the necessary classes, we want to create our beam system. We do this by combining all the wrappers we need to represent the physics that we to include in the simulation. In this case, that is the `BaseSystemCollection`, `Constraint`, `Forcings` and `Damping` because the simulation will consider a rod that is fixed in place on one end, and subject to an applied force on the other end." + "Now that we have imported all the necessary classes, we want to create our beam system. We do this by combining all the modules we need to represent the physics that we to include in the simulation. In this case, that is the `BaseSystemCollection`, `Constraint`, `Forcings` and `Damping` because the simulation will consider a rod that is fixed in place on one end, and subject to an applied force on the other end." ] }, { diff --git a/examples/Binder/2_Slithering_Snake.ipynb b/examples/Binder/2_Slithering_Snake.ipynb index 648960c4f..4c1c510db 100644 --- a/examples/Binder/2_Slithering_Snake.ipynb +++ b/examples/Binder/2_Slithering_Snake.ipynb @@ -16,7 +16,7 @@ "\n", "\n", "## Getting Started\n", - "To set up the simulation, the first thing you need to do is import the necessary classes. As with the Timoshenko bean, we need to import wrapper functions which allow us to more easily construct different simulation systems. We also need to import a rod class, all the necessary forces to be applied, timestepping functions, and callback classes. " + "To set up the simulation, the first thing you need to do is import the necessary classes. As with the Timoshenko bean, we need to import modules which allow us to more easily construct different simulation systems. We also need to import a rod class, all the necessary forces to be applied, timestepping functions, and callback classes. " ] }, { @@ -31,8 +31,8 @@ "source": [ "import numpy as np\n", "\n", - "# import wrappers\n", - "from elastica.wrappers import BaseSystemCollection, Constraints, Forcing, CallBacks, Damping\n", + "# import modules\n", + "from elastica.modules import BaseSystemCollection, Constraints, Forcing, CallBacks, Damping\n", "\n", "# import rod class, damping and forces to be applied\n", "from elastica.rod.cosserat_rod import CosseratRod\n", @@ -58,7 +58,7 @@ }, "source": [ "## Initialize System and Add Rod\n", - "The first thing to do is initialize the simulator class by combining all the imported wrappers. After initializing, we will generate a rod and add it to the simulation. " + "The first thing to do is initialize the simulator class by combining all the imported modules. After initializing, we will generate a rod and add it to the simulation. " ] }, { diff --git a/examples/Visualization/ContinuumSnakeVisualization/continuum_snake.py b/examples/Visualization/ContinuumSnakeVisualization/continuum_snake.py index 821f3b2ad..51b11aaf6 100644 --- a/examples/Visualization/ContinuumSnakeVisualization/continuum_snake.py +++ b/examples/Visualization/ContinuumSnakeVisualization/continuum_snake.py @@ -1,6 +1,6 @@ import numpy as np from collections import defaultdict -from elastica.wrappers import BaseSystemCollection, Constraints, Forcing, CallBacks +from elastica.modules import BaseSystemCollection, Constraints, Forcing, CallBacks from elastica.rod.cosserat_rod import CosseratRod from elastica.external_forces import GravityForces, MuscleTorques from elastica.interaction import AnisotropicFrictionalPlane From 7572a5cadeed42f72c659b740eb5236d534abae2 Mon Sep 17 00:00:00 2001 From: Seung Hyun Kim Date: Tue, 16 Aug 2022 07:37:34 -0500 Subject: [PATCH 4/6] refactor elastica: wrappers -> modules --- elastica/__init__.py | 2 +- elastica/boundary_conditions.py | 2 -- elastica/{wrappers => modules}/__init__.py | 2 +- elastica/{wrappers => modules}/base_system.py | 2 +- elastica/{wrappers => modules}/callbacks.py | 6 +++--- elastica/{wrappers => modules}/connections.py | 6 +++--- elastica/{wrappers => modules}/constraints.py | 6 +++--- elastica/{wrappers => modules}/damping.py | 6 +++--- elastica/{wrappers => modules}/forcing.py | 6 +++--- .../{wrappers => modules}/memory_block.py | 2 +- elastica/systems/__init__.py | 2 +- elastica/wrappers.py | 21 +++++++++++++++++++ 12 files changed, 41 insertions(+), 22 deletions(-) rename elastica/{wrappers => modules}/__init__.py (86%) rename elastica/{wrappers => modules}/base_system.py (98%) rename elastica/{wrappers => modules}/callbacks.py (95%) rename elastica/{wrappers => modules}/connections.py (97%) rename elastica/{wrappers => modules}/constraints.py (96%) rename elastica/{wrappers => modules}/damping.py (96%) rename elastica/{wrappers => modules}/forcing.py (96%) rename elastica/{wrappers => modules}/memory_block.py (95%) create mode 100644 elastica/wrappers.py diff --git a/elastica/__init__.py b/elastica/__init__.py index d35a20e1d..27f5138a7 100644 --- a/elastica/__init__.py +++ b/elastica/__init__.py @@ -1,5 +1,5 @@ from collections import defaultdict -from elastica.wrappers import * +from elastica.modules import * from elastica.rod.cosserat_rod import * from elastica.rod.knot_theory import * from elastica.rigidbody import * diff --git a/elastica/boundary_conditions.py b/elastica/boundary_conditions.py index 4e11205f4..43a66a501 100644 --- a/elastica/boundary_conditions.py +++ b/elastica/boundary_conditions.py @@ -2,9 +2,7 @@ __all__ = [ "ConstraintBase", "FreeBC", - "FreeRod", # Deprecated: remove v0.3.0 "OneEndFixedBC", - "OneEndFixedRod", # Deprecated: remove v0.3.0 "GeneralConstraint", "FixedConstraint", "HelicalBucklingBC", diff --git a/elastica/wrappers/__init__.py b/elastica/modules/__init__.py similarity index 86% rename from elastica/wrappers/__init__.py rename to elastica/modules/__init__.py index f81141583..6dec136ac 100644 --- a/elastica/wrappers/__init__.py +++ b/elastica/modules/__init__.py @@ -1,5 +1,5 @@ __doc__ = """ -Wrappers are simple objects that you can subclass to provide extended +Modules are simple objects that you can subclass to provide extended functionality to the simulation, such as adding an environment, joints, controllers, etc. """ diff --git a/elastica/wrappers/base_system.py b/elastica/modules/base_system.py similarity index 98% rename from elastica/wrappers/base_system.py rename to elastica/modules/base_system.py index df1ec5b23..c1b9e4bc5 100644 --- a/elastica/wrappers/base_system.py +++ b/elastica/modules/base_system.py @@ -12,7 +12,7 @@ from elastica.rod import RodBase from elastica.rigidbody import RigidBodyBase -from elastica.wrappers.memory_block import construct_memory_block_structures +from elastica.modules.memory_block import construct_memory_block_structures class BaseSystemCollection(MutableSequence): diff --git a/elastica/wrappers/callbacks.py b/elastica/modules/callbacks.py similarity index 95% rename from elastica/wrappers/callbacks.py rename to elastica/modules/callbacks.py index ad021a2a1..af1482add 100644 --- a/elastica/wrappers/callbacks.py +++ b/elastica/modules/callbacks.py @@ -10,7 +10,7 @@ class CallBacks: """ - CallBacks class is a wrapper for calling callback functions, set by the user. If the user + CallBacks class is a module for calling callback functions, set by the user. If the user wants to collect data from the simulation, the simulator class has to be derived from the CallBacks class. @@ -80,7 +80,7 @@ def _callback_execution(self, time, current_step: int, *args, **kwargs): class _CallBack: """ - CallBack wrapper private class + CallBack module private class Attributes ---------- @@ -107,7 +107,7 @@ def __init__(self, sys_idx: int): def using(self, callback_cls, *args, **kwargs): """ - This method is a wrapper to set which callback class is used to collect data + This method is a module to set which callback class is used to collect data from user defined rod-like object. Parameters diff --git a/elastica/wrappers/connections.py b/elastica/modules/connections.py similarity index 97% rename from elastica/wrappers/connections.py rename to elastica/modules/connections.py index af52497a5..8c6cd6267 100644 --- a/elastica/wrappers/connections.py +++ b/elastica/modules/connections.py @@ -11,7 +11,7 @@ class Connections: """ - The Connections class is a wrapper for connecting rod-like objects using joints selected + The Connections class is a module for connecting rod-like objects using joints selected by the user. To connect two rod-like objects, the simulator class must be derived from the Connections class. @@ -106,7 +106,7 @@ def _call_connections(self, *args, **kwargs): class _Connect: """ - Connect wrapper private class + Connect module private class Attributes ---------- @@ -231,7 +231,7 @@ def set_index(self, first_idx, second_idx): def using(self, connect_cls, *args, **kwargs): """ - This method is a wrapper to set which joint class is used to connect + This method is a module to set which joint class is used to connect user defined rod-like objects. Parameters diff --git a/elastica/wrappers/constraints.py b/elastica/modules/constraints.py similarity index 96% rename from elastica/wrappers/constraints.py rename to elastica/modules/constraints.py index a4a8ff086..afcdd8ad7 100644 --- a/elastica/wrappers/constraints.py +++ b/elastica/modules/constraints.py @@ -11,7 +11,7 @@ class Constraints: """ - The Constraints class is a wrapper for enforcing displacement boundary conditions. + The Constraints class is a module for enforcing displacement boundary conditions. To enforce boundary conditions on rod-like objects, the simulator class must be derived from Constraints class. @@ -87,7 +87,7 @@ def _constrain_rates(self, time, *args, **kwargs): class _Constraint: """ - Constraint wrapper private class + Constraint module private class Attributes ---------- @@ -114,7 +114,7 @@ def __init__(self, sys_idx: int): def using(self, bc_cls, *args, **kwargs): """ - This method is a wrapper to set which boundary condition class is used to + This method is a module to set which boundary condition class is used to enforce boundary condition from user defined rod-like objects. Parameters diff --git a/elastica/wrappers/damping.py b/elastica/modules/damping.py similarity index 96% rename from elastica/wrappers/damping.py rename to elastica/modules/damping.py index 0687070af..027eebdad 100644 --- a/elastica/wrappers/damping.py +++ b/elastica/modules/damping.py @@ -14,7 +14,7 @@ class Damping: """ - The Damping class is a wrapper for applying damping + The Damping class is a module for applying damping on rod-like objects, the simulator class must be derived from Damping class. @@ -76,7 +76,7 @@ def _dampen_rates(self, time, *args, **kwargs): class _Damper: """ - Damper wrapper private class + Damper module private class Attributes ---------- @@ -103,7 +103,7 @@ def __init__(self, sys_idx: int): def using(self, damper_cls, *args, **kwargs): """ - This method is a wrapper to set which damper class is used to + This method is a module to set which damper class is used to enforce damping from user defined rod-like objects. Parameters diff --git a/elastica/wrappers/forcing.py b/elastica/modules/forcing.py similarity index 96% rename from elastica/wrappers/forcing.py rename to elastica/modules/forcing.py index 47ad790c6..d8a46b64b 100644 --- a/elastica/wrappers/forcing.py +++ b/elastica/modules/forcing.py @@ -10,7 +10,7 @@ class Forcing: """ - The Forcing class is a wrapper for applying boundary conditions that + The Forcing class is a module for applying boundary conditions that consist of applied external forces. To apply forcing on rod-like objects, the simulator class must be derived from the Forcing class. @@ -89,7 +89,7 @@ def _call_ext_forces_torques(self, time, *args, **kwargs): class _ExtForceTorque: """ - Forcing wrapper private class + Forcing module private class Attributes ---------- @@ -115,7 +115,7 @@ def __init__(self, sys_idx: int): def using(self, forcing_cls, *args, **kwargs): """ - This method is a wrapper to set which forcing class is used to apply forcing + This method is a module to set which forcing class is used to apply forcing to user defined rod-like objects. Parameters diff --git a/elastica/wrappers/memory_block.py b/elastica/modules/memory_block.py similarity index 95% rename from elastica/wrappers/memory_block.py rename to elastica/modules/memory_block.py index bc641b556..6650b530d 100644 --- a/elastica/wrappers/memory_block.py +++ b/elastica/modules/memory_block.py @@ -1,5 +1,5 @@ __doc__ = """ -This function is a wrapper to construct memory blocks for different types of systems, such as +This function is a module to construct memory blocks for different types of systems, such as Cosserat Rods, Rigid Body etc. """ diff --git a/elastica/systems/__init__.py b/elastica/systems/__init__.py index 849e38307..33a39b836 100644 --- a/elastica/systems/__init__.py +++ b/elastica/systems/__init__.py @@ -30,7 +30,7 @@ def is_system_a_collection(system): evolve as the interface evolves. Then we can add those requirements on the interface here. """ - from elastica.wrappers import BaseSystemCollection + from elastica.modules import BaseSystemCollection __sys_get_item = getattr(system, "__getitem__", None) return issubclass(system.__class__, BaseSystemCollection) or callable( diff --git a/elastica/wrappers.py b/elastica/wrappers.py new file mode 100644 index 000000000..af8940f29 --- /dev/null +++ b/elastica/wrappers.py @@ -0,0 +1,21 @@ +import warnings + +__all__ = [ + "BaseSystemCollection", + "Connections", + "Constraints", + "Forcing", + "CallBacks", + "Damping", +] +from elastica.modules.base_system import BaseSystemCollection +from elastica.modules.connections import Connections +from elastica.modules.constraints import Constraints +from elastica.modules.forcing import Forcing +from elastica.modules.callbacks import CallBacks +from elastica.modules.damping import Damping + +warnings.warn( + "elastica.wrappers is refactored to elastica.modules in version 0.3.0.", + DeprecationWarning, +) From 0c19acd127aa2ce86304a3eef35a6d70ae544c18 Mon Sep 17 00:00:00 2001 From: Seung Hyun Kim Date: Tue, 16 Aug 2022 07:40:02 -0500 Subject: [PATCH 5/6] formatting --- tests/test_modules/test_connections.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_modules/test_connections.py b/tests/test_modules/test_connections.py index 04e422426..449c715ed 100644 --- a/tests/test_modules/test_connections.py +++ b/tests/test_modules/test_connections.py @@ -3,7 +3,7 @@ import pytest from elastica.modules import Connections -from elastica.modules .connections import _Connect +from elastica.modules.connections import _Connect class TestConnect: From d693872c5611097f2960d852a12fe692b4d9e4d8 Mon Sep 17 00:00:00 2001 From: Yashraj Bhosale Date: Tue, 16 Aug 2022 14:52:42 +0000 Subject: [PATCH 6/6] update: fix grammar --- docs/guide/workflow.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/workflow.md b/docs/guide/workflow.md index cd07a78f5..5889123fe 100644 --- a/docs/guide/workflow.md +++ b/docs/guide/workflow.md @@ -28,7 +28,7 @@ class SystemSimulator( ): pass ``` -This simply combines all the modules previously imported together. If a modules are not needed for the simulation, it does not need to be added here. +This simply combines all the modules previously imported together. If a module is not needed for the simulation, it does not need to be added here. Available components are: