Skip to content

Commit baf1665

Browse files
committed
mh autofix
1 parent 414447a commit baf1665

File tree

5 files changed

+21
-34
lines changed

5 files changed

+21
-34
lines changed

manualTests/test_makeRawDataset.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ function test_makeRawDataset()
126126

127127
%% actually do the conversion of the source data thus created
128128
clear;
129-
129+
130130
outputDir = fullfile(fileparts(mfilename('fullpath')), 'output');
131131
cfg.dir.output = outputDir;
132132
convertSourceToRaw(cfg);
133-
133+
134134
end

src/convertSourceToRaw.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,3 @@ function convertSourceToRaw(cfg)
4141
end
4242

4343
end
44-
45-
46-
47-

src/subfun/parseFunc.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function parseFunc(rawDir, subjName, sesName)
1717
sprintf('^%s.*_task-.*_bold_date-.*$', subjName));
1818

1919
removeDateSuffix(filenames, subjectPath);
20-
20+
2121
% do stim
2222
filenames = file_utils('List', subjectPath, ...
2323
sprintf('^%s.*_task-.*_stim_date-.*tsv$', subjName));
@@ -37,9 +37,9 @@ function compressFiles(filenames, subjectPath)
3737
end
3838

3939
for i = 1:numel(filenames)
40-
41-
gzip(fullfile(subjectPath, filenames{i}))
42-
delete(fullfile(subjectPath, filenames{i}))
40+
41+
gzip(fullfile(subjectPath, filenames{i}));
42+
delete(fullfile(subjectPath, filenames{i}));
4343

4444
end
45-
end
45+
end

src/subfun/removeDateSuffix.m

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,30 @@ function removeDateSuffix(filenames, subjectPath)
22
% removeDateSuffix(filenames, subjectPath)
33
%
44
%
5-
5+
66
if isempty(filenames)
77
filenames = {};
88
else
99
filenames = cellstr(filenames);
1010
end
11-
11+
1212
for i = 1:numel(filenames)
13-
13+
1414
[~, name, ext] = fileparts(filenames{i});
15-
15+
1616
if strcmp(ext, '.gz')
1717
[~, name, ext2] = fileparts(name);
1818
ext = [ext2, ext]; %#ok<AGROW>
1919
end
20-
20+
2121
[parts, ~] = regexp(name, '(?:_date-)+', 'split', 'match');
22-
22+
2323
% remove suffix file if there was one
2424
if ~strcmp(filenames{i}, [parts{1} ext])
2525
movefile(fullfile(subjectPath, filenames{i}), ...
2626
fullfile(subjectPath, [parts{1} ext]));
2727
end
28-
28+
2929
end
30-
31-
32-
33-
end
30+
31+
end

tests/test_removeDateSuffix.m

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@
66
initTestSuite;
77
end
88

9-
109
function test_removeDateSuffixBasic()
1110

1211
%% set up
1312
cfg.dir.output = fullfile(fileparts(mfilename('fullpath')), '..', 'output');
14-
13+
1514
% clean up
1615
if isdir(cfg.dir.output)
1716
rmdir(cfg.dir.output, 's');
1817
end
1918
[~, ~, ~] = mkdir(cfg.dir.output);
20-
19+
2120
% TODO
2221
% make sure we use the default date parameter (to implement?)
2322
% cfg = checkCFG(cfg);
@@ -30,7 +29,7 @@ function test_removeDateSuffixBasic()
3029
eventsName = 'test_events_date-202008050730.tsv';
3130
stimName = 'test_stim_date-202008050730.tsv';
3231
stimNameZipped = 'test2_stim_date-202008050730.tsv.gz';
33-
32+
3433
filesToProcess = { ...
3534
boldName ;
3635
boldName2 ;
@@ -46,12 +45,12 @@ function test_removeDateSuffixBasic()
4645
fullfile('..', 'dummyData', 'dummyData.nii.gz'), ...
4746
fullfile(cfg.dir.output, filesToProcess{iFile}));
4847
end
49-
48+
5049
%% do stuff
5150
filenames = file_utils('List', cfg.dir.output, '^test.*$');
5251

5352
removeDateSuffix(filenames, cfg.dir.output);
54-
53+
5554
%% expected data
5655
expectedBoldName = 'test_bold.nii.gz';
5756
expectedBoldName2 = 'test2_bold.nii.gz';
@@ -71,9 +70,3 @@ function test_removeDateSuffixBasic()
7170
assertEqual(exist(fullfile(cfg.dir.output, expectedBoldName), 'file'), 2);
7271

7372
end
74-
75-
76-
77-
78-
79-

0 commit comments

Comments
 (0)