Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
fix CI bug - attempt 1


fix CI bug - attempt 2
  • Loading branch information
Remi-Gau committed Feb 8, 2021
1 parent 37d48a1 commit a30bc6e
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
11 changes: 10 additions & 1 deletion +bids/+internal/append_to_layout.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,19 @@
% the following loop could probably be improved with some cellfun magic
% cellfun(@(x, y) any(strcmp(x,y)), {p.type}, suffix_groups)
for i = 1:size(schema.datatypes.(modality), 1)
if any(strcmp(suffix, schema.datatypes.(modality)(i).suffixes))

this_suffix_group = schema.datatypes.(modality)(i);

% for CI
if iscell(this_suffix_group)
this_suffix_group = this_suffix_group{1};
end

if any(strcmp(suffix, this_suffix_group.suffixes))
idx = i;
break
end

end

if isempty(idx)
Expand Down
5 changes: 5 additions & 0 deletions +bids/+internal/return_modality_extensions.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

extensions = '(';

% for CI
if iscell(modality)
modality = modality{1};
end

for iExt = 1:numel(modality.extensions)
if ~strcmp(modality.extensions{iExt}, '.json')
extensions = [extensions, modality.extensions{iExt}, '|']; %#ok<AGROW>
Expand Down
5 changes: 5 additions & 0 deletions +bids/+internal/return_modality_suffixes.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

suffixes = '_(';

% For CI
if iscell(modality)
modality = modality{1};
end

for iExt = 1:numel(modality(:).suffixes)
suffixes = [suffixes, modality.suffixes{iExt}, '|']; %#ok<AGROW>
end
Expand Down
5 changes: 5 additions & 0 deletions +bids/+schema/return_modality_entities.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
function entities = return_modality_entities(suffix_group, schema)

% for CI
if iscell(suffix_group)
suffix_group = suffix_group{1};
end

entity_names = fieldnames(suffix_group.entities);

for i = 1:size(entity_names, 1)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_load_schema.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
initTestSuite;
end

function test_load_schema_basic()
function test_load_schema_path()

use_schema = fullfile(fileparts(mfilename('fullpath')), 'schema');

Expand Down

0 comments on commit a30bc6e

Please sign in to comment.