Skip to content

Commit

Permalink
[MAINT] merge main in dev (#644)
Browse files Browse the repository at this point in the history
* BIDS schema update (#628)

Co-authored-by: Remi-Gau <[email protected]>

* Bump actions/checkout from 3 to 4 (#629)

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* BIDS schema update (#633)

Co-authored-by: Remi-Gau <[email protected]>

* BIDS schema update (#634)

Co-authored-by: Remi-Gau <[email protected]>

* BIDS schema update (#635)

Co-authored-by: Remi-Gau <[email protected]>

* [pre-commit.ci] pre-commit autoupdate (#636)

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](pre-commit/pre-commit-hooks@v4.4.0...v4.5.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* BIDS schema update (#637)

Co-authored-by: Remi-Gau <[email protected]>

* BIDS schema update (#639)

Co-authored-by: Remi-Gau <[email protected]>

* BIDS schema update (#640)

Co-authored-by: Remi-Gau <[email protected]>

* Bump matlab-actions/setup-matlab from 1.2.4 to 1.2.5 (#641)

Bumps [matlab-actions/setup-matlab](https://github.com/matlab-actions/setup-matlab) from 1.2.4 to 1.2.5.
- [Release notes](https://github.com/matlab-actions/setup-matlab/releases)
- [Commits](matlab-actions/setup-matlab@v1.2.4...v1.2.5)

---
updated-dependencies:
- dependency-name: matlab-actions/setup-matlab
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump matlab-actions/run-command from 1.2.1 to 1.2.2 (#642)

Bumps [matlab-actions/run-command](https://github.com/matlab-actions/run-command) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/matlab-actions/run-command/releases)
- [Commits](matlab-actions/run-command@v1.2.1...v1.2.2)

---
updated-dependencies:
- dependency-name: matlab-actions/run-command
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* [FIX] update test after schema update (#643)

* fix test after schema update

* set os version for doc

* update schema

* fix typos

* update tests

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Remi-Gau <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
5 people authored Nov 6, 2023
1 parent 8bbabd6 commit 2b8ba88
Show file tree
Hide file tree
Showing 13 changed files with 84 additions and 34 deletions.
2 changes: 1 addition & 1 deletion +bids/+transformers_list/Merge_identical_rows.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
% - If a variable is found, but is empty, it is ignored
% - The content of the other columns corresponds to the last row being merged:
% this means that the content from other columns but the one specified in will be deleted
% execpt for the last one
% except for the last one
%
% CODE EXAMPLE
% ------------
Expand Down
24 changes: 12 additions & 12 deletions +bids/transformers.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@

% (C) Copyright 2022 BIDS-MATLAB developers

SUPPORTED_TRANSFORMERS = lower(cat(1, basic_transfomers, ...
munge_transfomers, ...
logical_transfomers, ...
compute_transfomers));
SUPPORTED_TRANSFORMERS = lower(cat(1, basic_transformers, ...
munge_transformers, ...
logical_transformers, ...
compute_transformers));

p = inputParser;

Expand Down Expand Up @@ -98,16 +98,16 @@

switch transformerName

case lower(basic_transfomers)
case lower(basic_transformers)
output = bids.transformers_list.Basic(trans, data);

case lower(logical_transfomers)
case lower(logical_transformers)
output = bids.transformers_list.Logical(trans, data);

case lower(munge_transfomers)
case lower(munge_transformers)
output = apply_munge(trans, data);

case lower(compute_transfomers)
case lower(compute_transformers)
output = apply_compute(trans, data);

otherwise
Expand Down Expand Up @@ -211,21 +211,21 @@ function not_implemented(name)
false);
end

function BASIC = basic_transfomers()
function BASIC = basic_transformers()
BASIC = {'Add'
'Divide'
'Multiply'
'Power'
'Subtract'};
end

function LOGICAL = logical_transfomers()
function LOGICAL = logical_transformers()
LOGICAL = {'And'
'Or'
'Not'};
end

function MUNGE = munge_transfomers()
function MUNGE = munge_transformers()
MUNGE = {'Assign'
'Concatenate'
'Constant'
Expand All @@ -242,7 +242,7 @@ function not_implemented(name)
'Split'};
end

function COMPUTE = compute_transfomers()
function COMPUTE = compute_transformers()
COMPUTE = {'Mean'
'Product'
'Scale'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run_tests_matlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
- name: Install bids validator
run: npm install -g bids-validator


- name: Install bids example
run: |
cd tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_octave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
steps:

- name: Clone bids-matlab
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
steps:

- name: Clone bids-matlab
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get BIDS schema
run: make update_schema
Expand Down
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ exclude: schema.json
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -12,7 +12,6 @@ repos:
- id: check-json

- repo: local

hooks:
- id: mh_style
name: mh_style
Expand Down
6 changes: 5 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
# Required
version: 2

build:
os: ubuntu-22.04
tools:
python: '3.12'

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py
Expand All @@ -22,6 +27,5 @@ formats:

# Optionally set the version of Python and requirements required to build your docs
python:
version: '3.8'
install:
- requirements: requirements.txt
2 changes: 1 addition & 1 deletion demos/spm/facerep/code/convert_facerep_ds.m
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ function create_readme(output_dir)
'- 2 presentations of 26 Famous and 26 Nonfamous Greyscale photographs, '
' for 0.5s, randomly intermixed, for fame judgment task '
' (one of two right finger key presses).'
'- Parameteric factor "lag" = number of faces intervening '
'- Parametric factor "lag" = number of faces intervening '
' between repetition of a specific face + 1'
'- Minimal SOA=4.5s, with probability 2/3 (ie 1/3 null events)'
''
Expand Down
2 changes: 1 addition & 1 deletion schema.json

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions tests/test_bids_file.m
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ function test_reorder()
'dir'; ...
'run'; ...
'echo'; ...
'part'});
'part'; ...
'chunk'});
assertEqual(file.json_filename, 'wuasub-01_ses-test_task-faceRecognition_run-02_bold.json');

end
Expand Down Expand Up @@ -406,7 +407,7 @@ function test_reorder_schemaless()
'split'
'recording'
'chunk'
'atlas'
'seg'
'res'
'den'
'label'
Expand Down Expand Up @@ -435,7 +436,8 @@ function test_reorder_with_schema()
'dir'
'run'
'echo'
'part'});
'part'
'chunk'});
assertEqual(file.json_filename, 'wuasub-01_ses-test_task-faceRecognition_run-02_bold.json');
end

Expand Down Expand Up @@ -540,7 +542,8 @@ function test_bids_file_parsing_filename_schema_based()
'dir'
'run'
'echo'
'part'});
'part'
'chunk'});

assertEqual(file.prefix, '');
assertEqual(file.suffix, 'bold');
Expand Down
52 changes: 46 additions & 6 deletions tests/test_bids_schema.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,17 @@ function test_return_entities()
entities = schema.return_entities('datatype', 'func', ...
'suffix', 'bold', ...
'required_only', false);
expected_entities = {'sub', 'ses', 'task', 'acq', 'ce', 'rec', 'dir', 'run', 'echo', 'part'};
expected_entities = {'sub', ...
'ses', ...
'task', ...
'acq', ...
'ce', ...
'rec', ...
'dir', ...
'run', ...
'echo', ...
'part', ...
'chunk'};
assertEqual(entities, expected_entities);

schema = bids.Schema();
Expand All @@ -79,7 +89,17 @@ function test_return_entities()
entities = schema.return_entities('datatype', 'func', ...
'suffix', {'bold', 'cbv'}, ...
'required_only', false);
expected_entities = {'sub', 'ses', 'task', 'acq', 'ce', 'rec', 'dir', 'run', 'echo', 'part'};
expected_entities = {'sub', ...
'ses', ...
'task', ...
'acq', ...
'ce', ...
'rec', ...
'dir', ...
'run', ...
'echo', ...
'part', ...
'chunk'};
assertEqual(entities, expected_entities);

% smoke test
Expand All @@ -100,7 +120,7 @@ function test_return_entities_with_only_datatype_as_argument()
entities = schema.return_entities('datatype', 'func', ...
'required_only', false);
expected_entities = {'sub', 'ses', 'task', 'acq', 'ce', 'rec', ...
'dir', 'run', 'echo', 'part', 'recording'};
'dir', 'run', 'echo', 'part', 'recording', 'chunk'};
assertEqual(entities, expected_entities);

end
Expand All @@ -127,7 +147,17 @@ function test_return_entities_for_suffix_modality()
schema = bids.Schema();
[entities, required] = schema.return_entities_for_suffix_modality('bold', 'func');

expected_entities = {'sub', 'ses', 'task', 'acq', 'ce', 'rec', 'dir', 'run', 'echo', 'part'};
expected_entities = {'sub', ...
'ses', ...
'task', ...
'acq', ...
'ce', ...
'rec', ...
'dir', ...
'run', ...
'echo', ...
'part', ...
'chunk'};
assertEqual(entities, expected_entities);

expected_required = {'sub', 'task'};
Expand Down Expand Up @@ -265,7 +295,17 @@ function test_schemaless()
suffix_group = schema.content.rules.datatypes.func.func;
entities = schema.return_entities_for_suffix_group(suffix_group);

expected_output = {'sub', 'ses', 'task', 'acq', 'ce', 'rec', 'dir', 'run', 'echo', 'part'};
expected_output = {'sub', ...
'ses', ...
'task', ...
'acq', ...
'ce', ...
'rec', ...
'dir', ...
'run', ...
'echo', ...
'part', ...
'chunk'};

assertEqual(entities, expected_output);

Expand Down Expand Up @@ -301,7 +341,7 @@ function test_schemaless()
'split'; ...
'recording'; ...
'chunk'; ...
'atlas'; ...
'segmentation'; ...
'resolution'; ...
'density'; ...
'label'; ...
Expand Down
2 changes: 1 addition & 1 deletion tests/test_transformers/test_transformers_side_functions.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function test_get_input()
function status = test_is_run_level()

data = struct('onset', [], 'duration', [], 'foo', 'bar');
assert(bids.transfomers.is_run_level(data));
assert(bids.transformers.is_run_level(data));

end

Expand Down
9 changes: 6 additions & 3 deletions tests/tests_private/test_append_to_layout.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ function test_append_to_layout_basic()
'ce', '', ...
'rec', '', ...
'echo', '', ...
'part', ''));
'part', '', ...
'chunk', ''));

expected.anat.metafile = {};

Expand Down Expand Up @@ -129,7 +130,8 @@ function test_append_to_structure_basic_test()
'ce', '', ...
'rec', '', ...
'echo', '', ...
'part', ''));
'part', '', ...
'chunk', ''));
expected.anat(1, 1).metafile = {};

expected.anat(1, 1).dependencies.explicit = {};
Expand All @@ -147,7 +149,8 @@ function test_append_to_structure_basic_test()
'run', '1', ...
'acq', '', ...
'ce', '', ...
'rec', '')); %#ok<*STRNU>
'rec', '', ...
'chunk', '')); %#ok<*STRNU>

tmp.metafile = {};

Expand Down

0 comments on commit 2b8ba88

Please sign in to comment.