Skip to content

Commit

Permalink
Exception -> ValueError
Browse files Browse the repository at this point in the history
  • Loading branch information
navidcy committed Sep 6, 2023
1 parent aa5ed7a commit c423f52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion regional_mom6/regional_mom6.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def quadilateral_area(v1, v2, v3, v4):
& np.isclose(np.dot(v1, v1), np.dot(v3, v3))
& np.isclose(np.dot(v1, v1), np.dot(v4, v4))
):
raise Exception("vectors provided must have the same length")
raise ValueError("vectors provided must have the same length")

R = np.sqrt(np.dot(v1, v1))

Expand Down
2 changes: 1 addition & 1 deletion tests/test_grid_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_quadilateral_area(v1, v2, v3, v4, true_area):


def test_quadilateral_area_exception():
with pytest.raises(Exception) as excinfo:
with pytest.raises(ValueError) as excinfo:
quadilateral_area(v1, v2, v3, v4)

assert str(excinfo.value) == "vectors provided must have the same length"
Expand Down

0 comments on commit c423f52

Please sign in to comment.