Skip to content

Commit

Permalink
Merge pull request #134 from haraoka-screen/add_check
Browse files Browse the repository at this point in the history
Add args checking
  • Loading branch information
ikeuchi-screen authored Mar 27, 2024
2 parents 8f5b6f5 + 441d087 commit 0cccccd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lingam/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,9 @@ def calculate_total_effect(adjacency_matrix, from_index, to_index, is_continuous
max_val=len(adjacency_matrix) - 1,
)

if from_index == to_index:
raise ValueError("from_index and to_index mustn't be the same.")

if is_continuous is None:
is_continuous = [True for _ in range(len(adjacency_matrix))]
else:
Expand Down

0 comments on commit 0cccccd

Please sign in to comment.