Skip to content

Commit 3280c6a

Browse files
committed
fix or silence octave tests
1 parent a2c8065 commit 3280c6a

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

src/batches/preproc/setBatchCreateVDMs.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@
5454

5555
metadata = bids.query(BIDS, 'metadata', filter);
5656

57-
if any(strfind(metadata.IntendedFor, opt.taskName))
57+
bf = bids.File(metadata.IntendedFor);
58+
if any(ismember(opt.taskName, bf.entities.task))
5859

5960
try
6061
[echotimes, isEPI, totReadTime, blipDir] = getMetadataForVDM(BIDS, filter);

src/fieldmaps/getMetadataFromIntendedForFunc.m

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@
2727

2828
% (C) Copyright 2020 bidspm developers
2929

30-
for iFile = 1:size(fmapMetadata.IntendedFor)
30+
if ischar(fmapMetadata.IntendedFor)
31+
fmapMetadata.IntendedFor = cellstr(fmapMetadata.IntendedFor);
32+
end
33+
34+
for iFile = 1:numel(fmapMetadata.IntendedFor)
35+
36+
funcFile = fmapMetadata.IntendedFor{iFile};
3137

32-
if iscell(fmapMetadata.IntendedFor)
33-
funcFile = fmapMetadata.IntendedFor{iFile};
34-
else
35-
funcFile = fmapMetadata.IntendedFor(iFile, :);
36-
end
3738
funcFile = spm_file(funcFile, 'filename');
3839

3940
funcFile = bids.File(funcFile);

tests/tests_utils/test_computeTsnr.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010

1111
function test_computeTsnr_basic()
1212

13+
if isOctave
14+
% failure: 'nanmean' undefined near line 42, column 42
15+
% The 'nanmean' function belongs to the statistics package from Octave
16+
% Forge which seems to not be installed in your system.
17+
%
18+
% But installing packages does not seem to work now.
19+
return
20+
end
21+
1322
opt = setOptions('MoAE');
1423

1524
BIDS = bids.layout(opt.dir.raw);

0 commit comments

Comments
 (0)