Skip to content

Commit dcf9ddb

Browse files
Fix drifter depth test (#308)
* fix drifter depth test * clean up * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent a9af0da commit dcf9ddb

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

tests/instruments/test_drifter.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,16 @@ def test_simulate_drifters(tmpdir) -> None:
111111

112112
def test_drifter_depths(tmpdir) -> None:
113113
CONST_TEMPERATURE = 1.0 # constant temperature in fieldset
114+
DEPTH_FACTOR = 3.0 # factor to multiply surface values by at depth for test
114115

115116
v = np.full((2, 2, 2, 2), 1.0)
116117
u = np.full((2, 2, 2, 2), 1.0)
117118
t = np.full((2, 2, 2, 2), CONST_TEMPERATURE)
118119

119120
# different values at depth (random)
120-
v[:, -1, :, :] = 1.0 * np.random.randint(0, 10)
121-
u[:, -1, :, :] = 1.0 * np.random.randint(0, 10)
122-
t[:, -1, :, :] = CONST_TEMPERATURE * np.random.randint(0, 10)
121+
v[:, -1, :, :] = 1.0 * DEPTH_FACTOR
122+
u[:, -1, :, :] = 1.0 * DEPTH_FACTOR
123+
t[:, -1, :, :] = CONST_TEMPERATURE * DEPTH_FACTOR
123124

124125
fieldset = FieldSet.from_data(
125126
{"V": v, "U": u, "T": t},

0 commit comments

Comments
 (0)