Skip to content

Commit

Permalink
fix: disallow None default value, instead use empty tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
skim0119 committed Jun 25, 2024
1 parent 06cc1e0 commit 069e2cd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions elastica/boundary_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class ConstraintBase(ABC, Generic[S]):
def __init__(
self,
*args: Any,
constrained_position_idx: ConstrainingIndex,
constrained_director_idx: ConstrainingIndex,
constrained_position_idx: ConstrainingIndex = (),
constrained_director_idx: ConstrainingIndex = (),
**kwargs: Any,
) -> None:
"""Initialize boundary condition"""
Expand Down
4 changes: 2 additions & 2 deletions elastica/modules/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ def using(
self,
cls: Type[ConstraintBase],
*args: Any,
constrained_position_idx: ConstrainingIndex = None,
constrained_director_idx: ConstrainingIndex = None,
constrained_position_idx: ConstrainingIndex = (),
constrained_director_idx: ConstrainingIndex = (),
**kwargs: Any,
) -> Self:
"""
Expand Down
2 changes: 1 addition & 1 deletion elastica/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

# Indexing types
# TODO: Maybe just use slice??
ConstrainingIndex: TypeAlias = list[int] | tuple[int] | np.typing.NDArray | None
ConstrainingIndex: TypeAlias = list[int] | tuple[int, ...] | np.typing.NDArray
ConnectionIndex: TypeAlias = (
int | np.int_ | list[int] | tuple[int] | np.typing.NDArray | None
)
Expand Down

0 comments on commit 069e2cd

Please sign in to comment.