Skip to content

Commit

Permalink
Merge branch 'update/mypy' of https://github.com/GazzolaLab/PyElastica
Browse files Browse the repository at this point in the history
…into update/mypy
  • Loading branch information
skim0119 committed Jun 26, 2024
2 parents e3ac13e + bb4b2c5 commit 3d99647
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
8 changes: 6 additions & 2 deletions elastica/external_forces.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down
2 changes: 1 addition & 1 deletion elastica/modules/protocol.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion elastica/rod/cosserat_rod.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion elastica/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 3d99647

Please sign in to comment.