diff --git a/elastica/external_forces.py b/elastica/external_forces.py index 6d377acb..d7f5185e 100644 --- a/elastica/external_forces.py +++ b/elastica/external_forces.py @@ -508,8 +508,12 @@ def __init__( start_force_mag: float, end_force_mag: float, ramp_up_time: float = 0.0, - tangent_direction: NDArray[np.float64] = np.array([0, 0, 1]), - normal_direction: NDArray[np.float64] = np.array([0, 1, 0]), + tangent_direction: NDArray[np.floating] = np.array( + [0.0, 0.0, 1.0] + ), # FIXME: avoid mutable default + normal_direction: NDArray[np.floating] = np.array( + [0.0, 1.0, 0.0] + ), # FIXME: avoid mutable default ) -> None: """ diff --git a/elastica/modules/protocol.py b/elastica/modules/protocol.py index b9a52ec7..4ca93a17 100644 --- a/elastica/modules/protocol.py +++ b/elastica/modules/protocol.py @@ -1,5 +1,5 @@ from typing import Protocol, Generator, TypeVar, Any, Type, overload -from typing_extensions import Self # 3.11: from typing import Self +from typing_extensions import Self # python 3.11: from typing import Self from abc import abstractmethod diff --git a/elastica/rod/cosserat_rod.py b/elastica/rod/cosserat_rod.py index 8ac1d081..1027d226 100644 --- a/elastica/rod/cosserat_rod.py +++ b/elastica/rod/cosserat_rod.py @@ -188,7 +188,7 @@ def __init__( internal_couple: NDArray[np.float64], ring_rod_flag: bool, ) -> None: - self.n_nodes = n_elements + 1 if ring_rod_flag else n_elements + self.n_nodes = n_elements + 1 if not ring_rod_flag else n_elements self.n_elems = n_elements self.position_collection = position self.velocity_collection = velocity diff --git a/elastica/typing.py b/elastica/typing.py index 07ac71f5..1ba1a4ee 100644 --- a/elastica/typing.py +++ b/elastica/typing.py @@ -40,7 +40,6 @@ SystemIdxType: TypeAlias = int BlockSystemType: TypeAlias = "BlockSystemProtocol" -# NoForces | NoContact | FreeJoint | FreeBC | DamperBase | CallBackBaseClass # Mostly used in explicit stepper: for symplectic, use kinetic and dynamic state StateType: TypeAlias = "State"