Skip to content

Commit 51bd03a

Browse files
update
1 parent 0b7af8f commit 51bd03a

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ def algorithmlist(algorithms):
264264
for algorithm in algorithms["algorithms"]:
265265
algorithm_dict = algorithms.get(algorithm, {})
266266
requires_matlab = algorithm_dict.get("requires_matlab", False)
267-
yield algorithm, requires_matlab, algorithm_dict.get('deep_learning', False)
267+
if not algorithm_dict.get('deep_learning', False):
268+
yield algorithm, requires_matlab
268269

269270

270271
def bound_input(datafile, algorithms):

tests/IVIMmodels/unit_tests/test_ivim_fit.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ def to_list_if_needed(value):
8181
assert elapsed_time < max_time, f"Algorithm {name} took {elapsed_time} seconds, which is longer than 2 second to fit per voxel" #less than 0.5 seconds per voxel
8282

8383
def test_default_bounds_and_initial_guesses(algorithmlist,eng):
84-
algorithm, kwargs = algorithmlist
85-
if kwargs.get("requires_matlab", False):
84+
algorithm, requires_matlab = algorithmlist
85+
if requires_matlab:
8686
if eng is None:
8787
pytest.skip(reason="Running without matlab; if Matlab is available please run pytest --withmatlab")
8888
else:
@@ -157,7 +157,7 @@ def test_bounds(bound_input, eng):
157157
assert passDp, f"Fit still passes when initial guess Ds is out of fit bounds; potentially initial guesses not respected for: {name}" '''
158158

159159
def test_volume(algorithmlist,eng, threeddata):
160-
algorithm, kwargs = algorithmlist
160+
algorithm, requires_matlab = algorithmlist
161161
data, Dim, fim, Dpim, bvals = threeddata
162162
# Get index of b=0
163163
b0_index = np.where(bvals == 0.)[0][0]
@@ -166,7 +166,7 @@ def test_volume(algorithmlist,eng, threeddata):
166166
invalid_mask = data[:, :, :, b0_index] < 0.01
167167
data[invalid_mask,:] = np.nan
168168

169-
if kwargs.get("requires_matlab", False):
169+
if requires_matlab:
170170
if eng is None:
171171
pytest.skip(reason="Running without matlab; if Matlab is available please run pytest --withmatlab")
172172
else:
@@ -190,7 +190,7 @@ def test_volume(algorithmlist,eng, threeddata):
190190

191191

192192
def test_parallel(algorithmlist,eng,threeddata):
193-
algorithm, kwargs = algorithmlist
193+
algorithm, requires_matlab = algorithmlist
194194
data, Dim, fim, Dpim, bvals = threeddata
195195
# Get index of b=0
196196
b0_index = np.where(bvals == 0)[0][0]
@@ -199,7 +199,7 @@ def test_parallel(algorithmlist,eng,threeddata):
199199
invalid_mask = data[:, :, :, b0_index] < 0.01
200200
data[invalid_mask,:] = np.nan
201201
print('testing ' + str(np.sum(~invalid_mask)) + ' voxels of a matrix size ' + str(np.shape(data)))
202-
if kwargs.get("requires_matlab", False):
202+
if requires_matlab:
203203
if eng is None:
204204
pytest.skip(reason="Running without matlab; if Matlab is available please run pytest --withmatlab")
205205
else:

0 commit comments

Comments
 (0)