File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -212,15 +212,16 @@ def test_average_model():
212212 avgmodel_median = model .AverageDWIModel (dataset )
213213
214214 # Verify that average cannot be calculated in shells with one single value
215+ # The two first gradients are considered low-b orientations because of the
216+ # default threshold and are pulled out (so now index is 0 for b=500).
215217 with pytest .raises (RuntimeError ):
216- avgmodel_mean .fit_predict (2 )
218+ avgmodel_mean .fit_predict (0 )
217219
218220 assert np .allclose (avgmodel_mean .fit_predict (3 ), 1000 )
219221 assert np .allclose (avgmodel_median .fit_predict (3 ), 1000 )
220222
221- grads = list (gtab [:, - 1 ])
222- del grads [1 ]
223- assert np .allclose (avgmodel_mean_full .fit_predict (1 ), np .mean (grads ))
223+ grads = list (gtab [2 :, - 1 ])
224+ assert np .allclose (avgmodel_mean_full .fit_predict (0 ), np .mean (grads ))
224225
225226 avgmodel_mean_2000 = model .AverageDWIModel (dataset , stat = "mean" , atol_low = 1100 )
226227 avgmodel_median_2000 = model .AverageDWIModel (dataset , atol_low = 1100 )
You can’t perform that action at this time.
0 commit comments