Skip to content

Commit 820a9d2

Browse files
oestebanjhlegarreta
authored andcommitted
fix: first error, moving to next
1 parent 749e2f8 commit 820a9d2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/test_model.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,16 @@ def test_average_model():
213213
avgmodel_median = model.AverageDWIModel(dataset)
214214

215215
# Verify that average cannot be calculated in shells with one single value
216+
# The two first gradients are considered low-b orientations because of the
217+
# default threshold and are pulled out (so now index is 0 for b=500).
216218
with pytest.raises(RuntimeError):
217-
avgmodel_mean.fit_predict(2)
219+
avgmodel_mean.fit_predict(0)
218220

219221
assert np.allclose(avgmodel_mean.fit_predict(3), 1000)
220222
assert np.allclose(avgmodel_median.fit_predict(3), 1000)
221223

222-
grads = list(gtab[:, -1])
223-
del grads[1]
224-
assert np.allclose(avgmodel_mean_full.fit_predict(1), np.mean(grads))
224+
grads = list(gtab[2:, -1])
225+
assert np.allclose(avgmodel_mean_full.fit_predict(0), np.mean(grads))
225226

226227
avgmodel_mean_2000 = model.AverageDWIModel(dataset, stat="mean", atol_low=1100)
227228
avgmodel_median_2000 = model.AverageDWIModel(dataset, atol_low=1100)

0 commit comments

Comments
 (0)