Skip to content

Commit

Permalink
speed up some tests or functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau committed Aug 17, 2023
1 parent fb2afec commit 6bd1277
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion +bids/+util/create_sessions_tsv.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
%%
output_filenames = {};

layout = bids.layout(layout_or_path, 'use_schema', use_schema);
layout = bids.layout(layout_or_path, 'use_schema', use_schema, ...
'index_dependencies', false);

sessions_list = bids.query(layout, 'sessions');
if isempty(sessions_list) && use_schema
Expand Down
6 changes: 2 additions & 4 deletions tests/tests_private/test_list_events.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,17 @@ function test_list_events_basic()

pth_bids_example = get_test_data_dir();

data_sets_to_test = '^ds00.*[0-9]$'; % '^ds.*[0-9]$'
data_sets_to_test = '^ds00[0-9]$'; % '^ds.*[0-9]$'
examples = bids.internal.file_utils('FPList', get_test_data_dir(), 'dir', data_sets_to_test);

for i = 1:size(examples, 1)

BIDS = bids.layout(deblank(examples(i, :)));
BIDS = bids.layout(deblank(examples(i, :)), 'index_dependencies', false);

tasks = bids.query(BIDS, 'tasks');

for j = 1:numel(tasks)

[bids.internal.file_utils(BIDS.pth, 'basename'), ' - ', tasks{j}];

[data, headers, y_labels] = bids.internal.list_events(BIDS, 'func', tasks{j});

bids.internal.plot_diagnostic_table(data, ...
Expand Down
12 changes: 8 additions & 4 deletions tests/tests_utils/test_create_data_dict.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ function test_create_data_dict_basic()

pth_bids_example = get_test_data_dir();

BIDS = bids.layout(fullfile(pth_bids_example, 'ds001'));
BIDS = bids.layout(fullfile(pth_bids_example, 'ds001'), ...
'index_dependencies', false);

tsv_files = bids.query(BIDS, 'data', ...
'sub', '01', ...
Expand Down Expand Up @@ -48,7 +49,8 @@ function test_create_data_dict_schema()

pth_bids_example = get_test_data_dir();

BIDS = bids.layout(fullfile(pth_bids_example, 'ds001'));
BIDS = bids.layout(fullfile(pth_bids_example, 'ds001'), ...
'index_dependencies', false);

tsv_files = bids.query(BIDS, 'data', ...
'suffix', 'events');
Expand Down Expand Up @@ -76,7 +78,8 @@ function test_create_data_dict_schema()

pth_bids_example = get_test_data_dir();

BIDS = bids.layout(fullfile(pth_bids_example, dataset));
BIDS = bids.layout(fullfile(pth_bids_example, dataset), ...
'index_dependencies', false);

tasks = bids.query(BIDS, 'tasks');

Expand Down Expand Up @@ -154,7 +157,8 @@ function test_create_data_dict_several_tsv()

dataset = datasets{i_dataset};

BIDS = bids.layout(fullfile(pth_bids_example, dataset));
BIDS = bids.layout(fullfile(pth_bids_example, dataset), ...
'index_dependencies', false);

tasks = bids.query(BIDS, 'tasks');

Expand Down

0 comments on commit 6bd1277

Please sign in to comment.