Skip to content

Commit

Permalink
added test for ferguson curve method
Browse files Browse the repository at this point in the history
  • Loading branch information
vcantarella committed Feb 5, 2024
1 parent a6b7d8c commit 8130979
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ documentation = "in construction"

[project.optional-dependencies]
ci = [
"pytest>=4.6",
"pytest",
"coverage",
"flake8",
]
Expand Down
22 changes: 21 additions & 1 deletion tests/test_angles.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# %%
import numpy as np
from hyvr.objects.trough import trough
from hyvr import trough
from hyvr.tools import ferguson_curve


# %%
Expand Down Expand Up @@ -33,3 +34,22 @@ def test_trough_angles():

assert np.nanmax(dip) == 30.0
assert np.nanmin(dip) >= 0.0


def test_curve():
np.random.seed(37)
channel_curve_1 = ferguson_curve(
h=0.1,
k=np.pi / 200,
eps_factor=(np.pi / 1.5) ** 2,
flow_angle=0.0,
s_max=400,
xstart=40.0,
ystart=25.0,
)
curve = np.column_stack([channel_curve_1[0], channel_curve_1[1]])
assert curve[0, 0] == 40.0
assert curve[0, 1] == 25.0
s = channel_curve_1[4]
print(s)
assert s[-1] <= 400.0

0 comments on commit 8130979

Please sign in to comment.