Skip to content

Commit

Permalink
less warnings in bids model
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau committed Jan 6, 2024
1 parent 4ffdb41 commit 52fe695
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 19 deletions.
34 changes: 29 additions & 5 deletions src/bids_model/BidsModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,12 @@
spm_get_defaults('stats.fmri.hpf'), ...
nodeName, ...
returnBsmDocURL('options'));
obj.bidsModelError('noHighPassFilter', msg);

opt.verbosity = 0;
if obj.verbose
opt.verbosity = 1;
end
logger('INFO', msg, 'filename', mfilename(), 'options', opt);

else

Expand Down Expand Up @@ -151,7 +156,12 @@
nodeName, ...
nodeName, ...
returnRtdURL('', 'HRF'));
obj.bidsModelError('noHRFderivatives', msg);

opt.verbosity = 0;
if obj.verbose
opt.verbosity = 1;
end
logger('INFO', msg, 'filename', mfilename(), 'options', opt);
end

HRFderivatives = lower(strrep(HRFderivatives, ' ', ''));
Expand Down Expand Up @@ -196,7 +206,12 @@
nodeName, ...
nodeName, ...
returnBsmDocURL('options'));
obj.bidsModelError('noMask', msg);

opt.verbosity = 0;
if obj.verbose
opt.verbosity = 1;
end
logger('INFO', msg, 'filename', mfilename(), 'options', opt);

end

Expand Down Expand Up @@ -241,7 +256,12 @@
spm_get_defaults('mask.thresh'), ...
nodeName, ...
returnRtdURL('', 'software'));
obj.bidsModelError('noInclMaskThresh', msg);

opt.verbosity = 0;
if obj.verbose
opt.verbosity = 1;
end
logger('INFO', msg, 'filename', mfilename(), 'options', opt);

end

Expand Down Expand Up @@ -280,7 +300,11 @@
nodeName, ...
returnRtdURL('', 'software'));

obj.bidsModelError('noTemporalCorrection', msg);
opt.verbosity = 0;
if obj.verbose
opt.verbosity = 1;
end
logger('INFO', msg, 'filename', mfilename(), 'options', opt);

end

Expand Down
14 changes: 0 additions & 14 deletions tests/tests_bids_model/test_bidsModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,6 @@ function test_getModelMask_method()
mask = bm.getModelMask('Name', 'run_level');
assertEqual(mask, 'mask.nii');

if bids.internal.is_octave()
moxunit_throw_test_skipped_exception('Octave:mixed-string-concat warning thrown');
end
bm.verbose = true;
bm.Nodes{1}.Model.Options = rmfield(bm.Nodes{1}.Model.Options, 'Mask');
assertWarning(@()bm.getModelMask('Name', 'run_level'), ...
'BidsModel:noMask');

end

function test_getInclusiveMaskThreshold()
Expand Down Expand Up @@ -241,12 +233,6 @@ function test_getInclusiveMaskThreshold_method()

bm.getInclusiveMaskThreshold('Name', 'subject_level');

if bids.internal.is_octave()
moxunit_throw_test_skipped_exception('Octave:mixed-string-concat warning thrown');
end
assertWarning(@()bm.getInclusiveMaskThreshold('Name', 'subject_level'), ...
'BidsModel:noInclMaskThresh');

end

function test_getGrpLevelContrast_basic()
Expand Down

0 comments on commit 52fe695

Please sign in to comment.