Skip to content

Commit 685767d

Browse files
committed
reduce number of warning in tests
1 parent 9c1a64e commit 685767d

File tree

19 files changed

+54
-37
lines changed

19 files changed

+54
-37
lines changed

bidspm.m

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ function bidspm(varargin)
1313

1414
defaultAction = 'init';
1515

16-
isEmptyOrCellstr = @(x) isempty(x) || iscellstr(x);
16+
isEmptyOrCellstr = @(x) isempty(x) || isstring(x);
1717
isFileOrStruct = @(x) isstruct(x) || exist(x, 'file') == 2;
1818

1919
isLogical = @(x) islogial(x) && numel(x) == 1;
2020
isChar = @(x) ischar(x);
2121
isPositiveScalar = @(x) isnumeric(x) && numel(x) == 1 && x >= 0;
2222

23-
isDir = @(x) isdir(x);
23+
isFolder = @(x) isfolder(x);
2424

25-
isCellStr = @(x) iscellstr(x);
25+
isCellStr = @(x) isstring(x);
2626

27-
isLowLevelActionOrDir = @(x) (ismember(x, low_level_actions()) || isdir(x));
27+
isLowLevelActionOrDir = @(x) (ismember(x, low_level_actions()) || isfolder(x));
2828

2929
addOptional(args, 'bids_dir', pwd, isLowLevelActionOrDir);
3030

@@ -48,7 +48,7 @@ function bidspm(varargin)
4848
addParameter(args, 'ignore', {}, isEmptyOrCellstr);
4949

5050
% stats only
51-
addParameter(args, 'preproc_dir', pwd, isDir);
51+
addParameter(args, 'preproc_dir', pwd, isFolder);
5252
addParameter(args, 'model_file', struct([]), isFileOrStruct);
5353
addParameter(args, 'roi_based', false, isLogical);
5454
% group level stats only
@@ -384,7 +384,7 @@ function initBidspm(dev)
384384
opt.verbosity = 2;
385385
opt.msg.color = '';
386386

387-
octaveVersion = '4.0.3';
387+
octaveVersion = '6.4.0';
388388
matlabVersion = '8.6.0';
389389

390390
% octave packages
@@ -547,6 +547,11 @@ function run_tests()
547547

548548
bidspm('action', 'dev');
549549

550+
% to reduce noise in the output
551+
if isOctave
552+
warning('off', 'setGraphicWindow:noGraphicWindow');
553+
end
554+
550555
cd(fileparts(mfilename('fullpath')));
551556

552557
if isGithubCi
@@ -566,8 +571,7 @@ function run_tests()
566571
folderToCover = fullfile(pwd, 'src');
567572
testFolder = fullfile(pwd, 'tests', subfolder);
568573

569-
success = moxunit_runtests( ...
570-
testFolder, ...
574+
success = moxunit_runtests(testFolder, ...
571575
'-verbose', '-recursive', '-with_coverage', ...
572576
'-cover', folderToCover, ...
573577
'-cover_xml_file', 'coverage.xml', ...

demos/MoAE/moae_fmriprep.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
addpath(fullfile(pwd, '..', '..'));
2323
bidspm();
2424

25+
if isOctave
26+
warning('off', 'setGraphicWindow:noGraphicWindow');
27+
end
28+
2529
% Getting the raw dataset
2630
download_data = true;
2731
download_moae_ds(download_data);

demos/MoAE/test_moae.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,15 @@
2222

2323
addpath(fullfile(WD, '..', '..'));
2424

25+
bidspm();
2526
if download_data
26-
bidspm();
2727
download_moae_ds(download_data, clean);
2828
end
2929

30+
if isOctave
31+
warning('off', 'setGraphicWindow:noGraphicWindow');
32+
end
33+
3034
optionsFile = fullfile(WD, 'options', 'options_task-auditory.json');
3135

3236
space = {'IXI549Space'

demos/face_repetition/test_face_rep.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@
1515

1616
addpath(fullfile(WD, '..', '..'));
1717

18+
bidspm();
19+
1820
if download_data
19-
bidspm();
2021
download_face_rep_ds(download_data);
2122
end
2223

24+
if isOctave
25+
warning('off', 'setGraphicWindow:noGraphicWindow');
26+
end
27+
2328
optionsFile = fullfile(WD, 'options', 'options_task-facerepetition.json');
2429

2530
model_file = fullfile(WD, 'models', 'model-faceRepetition_smdl.json');

mlc_config.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/IO/getData.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121

2222
% (C) Copyright 2020 bidspm developers
2323

24-
isDir = @(x) isdir(x);
24+
isFolder = @(x) isfolder(x);
2525

2626
args = inputParser;
2727

2828
addRequired(args, 'opt', @isstruct);
29-
addRequired(args, 'bidsDir', isDir);
29+
addRequired(args, 'bidsDir', isFolder);
3030

3131
try
3232
parse(args, varargin{:});

src/QA/anatomicalQA.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ function anatomicalQA(opt)
1717

1818
% (C) Copyright 2020 bidspm developers
1919

20-
if ~opt.QA.anat.do
21-
return
22-
end
23-
2420
if isOctave()
2521
warning('\nanatomicalQA is not yet supported on Octave. This step will be skipped.');
22+
opt.QA.anat.do = false;
23+
end
24+
25+
if ~opt.QA.anat.do
2626
return
2727
end
2828

src/QA/anatomicalQALesion.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ function anatomicalQALesion(opt)
1616

1717
if isOctave()
1818
warning('\nanatomicalQA is not yet supported on Octave. This step will be skipped.');
19+
opt.QA.anat.do = false;
20+
end
21+
22+
if ~opt.QA.anat.do
1923
return
2024
end
2125

src/QA/functionalQA.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function functionalQA(opt)
109109
']'];
110110
pattern = ['^', prefix, 'sub-', subLabel];
111111
if ~strcmp(sessions{iSes}, '')
112-
pattern = [pattern, '_ses-', sessions{iSes}];
112+
pattern = [pattern, '_ses-', sessions{iSes}]; %#ok<*AGROW>
113113
end
114114
pattern = [pattern, '.*', '_task-' thisTask, '.*'];
115115
if ~strcmp(runs{iRun}, '')

src/batches/stats/setBatchFactorialDesign.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158

159159
icell(1).levels = 1;
160160

161-
assert(iscellstr(icell.scans));
161+
assert(isstring(icell.scans));
162162

163163
matlabbatch = returnFactorialDesignBatch(matlabbatch, rfxDir, icell, thisGroup);
164164

0 commit comments

Comments
 (0)