From 2632b20d3f61adcaa4125f2dfc4f1ef007a5d868 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 23 Jul 2024 17:51:32 +0200 Subject: [PATCH] several fixes --- .circleci/config.yml | 12 ++++++------ demos/MoAE/README.md | 14 +++++++------- demos/face_repetition/README.md | 10 +++++----- docs/source/images/mermaid.md | 2 +- docs/source/installation/containers.md | 4 ++-- docs/source/stats/bids_stats_model.md | 2 +- docs/source/usage_notes.rst | 2 +- tests/test_bidspm.py | 8 -------- tests/test_cli.py | 9 ++++++++- 9 files changed, 31 insertions(+), 32 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ffe2747c4..e85a9718e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -113,7 +113,7 @@ jobs: /bids_dataset \ /outputs/ds000001 \ subject \ - --action default_model \ + default_model \ --task balloonanalogrisktask \ --space MNI152NLin2009cAsym \ --verbosity 3 @@ -130,7 +130,7 @@ jobs: /bids_dataset \ /outputs/ds000001 \ dataset \ - --action default_model \ + default_model \ --task balloonanalogrisktask \ --space MNI152NLin2009cAsym \ --verbosity 3 @@ -150,7 +150,7 @@ jobs: /outputs/ds000001 \ /outputs/ds000001 \ dataset \ - --action create_roi \ + create_roi \ --roi_atlas wang \ --roi_name V1v V1d \ --space IXI549Space \ @@ -190,7 +190,7 @@ jobs: /bids_dataset \ /outputs/ds000001 \ subject \ - --action smooth \ + smooth \ --task balloonanalogrisktask \ --participant_label 01 02 \ --space MNI152NLin2009cAsym \ @@ -212,7 +212,7 @@ jobs: /bids_dataset \ /outputs/ds000001 \ subject \ - --action stats \ + stats \ --preproc_dir /outputs/ds000001/derivatives/bidspm-preproc \ --model_file /models/model-balloonanalogrisktaskDefault_smdl.json \ --ignore slicetiming \ @@ -235,7 +235,7 @@ jobs: /bids_dataset \ /outputs/ds000001 \ dataset \ - --action stats \ + stats \ --preproc_dir /outputs/ds000001/derivatives/bidspm-preproc \ --model_file /models/model-balloonanalogrisktaskDefault_smdl.json \ --space MNI152NLin2009cAsym \ diff --git a/demos/MoAE/README.md b/demos/MoAE/README.md index 92b1f5419..cf7b76aae 100644 --- a/demos/MoAE/README.md +++ b/demos/MoAE/README.md @@ -19,7 +19,7 @@ bidspm \ $PWD/inputs/raw \ $PWD/outputs/derivatives \ subject \ - --action preprocess \ + preprocess \ --participant_label 01 \ --space individual IXI549Space \ --task auditory \ @@ -37,7 +37,7 @@ bidspm \ $PWD/inputs/fmriprep \ $PWD/outputs/derivatives \ subject \ - --action smooth \ + smooth \ --participant_label 01 \ --space '^.*MNI.*$' \ --task auditory \ @@ -52,7 +52,7 @@ bidspm \ $PWD/inputs/raw \ $PWD/outputs/derivatives \ dataset \ - --action default_model \ + default_model \ --space IXI549Space \ --task auditory \ --verbosity 2 \ @@ -66,7 +66,7 @@ bidspm \ $PWD/inputs/raw \ $PWD/outputs/derivatives \ subject \ - --action stats \ + stats \ --preproc_dir $PWD/outputs/derivatives/bidspm-preproc \ --model_file $PWD/models/model-MoAE_smdl.json \ --fwhm 6 @@ -77,7 +77,7 @@ bidspm \ $PWD/inputs/raw \ $PWD/outputs/derivatives \ subject \ - --action stats \ + stats \ --preproc_dir $PWD/outputs/derivatives/bidspm-preproc \ --model_file $PWD/outputs/derivatives/models/model-defaultAuditory_smdl.json \ --fwhm 6 @@ -96,7 +96,7 @@ docker run -it --rm \ /derivatives \ subject \ --task auditory \ - --action preprocess \ + preprocess \ --fwhm 8 ``` @@ -111,7 +111,7 @@ docker run -it --rm \ /raw \ /derivatives \ subject \ - --action stats \ + stats \ --preproc_dir /derivatives/bidspm-preproc \ --model_file /models/model-MoAE_smdl.json \ --fwhm 6 diff --git a/demos/face_repetition/README.md b/demos/face_repetition/README.md index d0ed1a467..f38cfd6f2 100644 --- a/demos/face_repetition/README.md +++ b/demos/face_repetition/README.md @@ -12,7 +12,7 @@ bidspm \ $PWD/outputs/raw \ $PWD/outputs/derivatives \ subject \ - --action preprocess \ + preprocess \ --participant_label 01 \ --space individual IXI549Space \ --task facerepetition \ @@ -25,7 +25,7 @@ bidspm \ $PWD/outputs/raw \ $PWD/outputs/derivatives \ subject \ - --action preprocess \ + preprocess \ --space individual IXI549Space \ --anat_only \ --skip_validation @@ -38,7 +38,7 @@ bidspm \ $PWD/outputs/raw \ $PWD/outputs/derivatives \ subject \ - --action create_roi \ + create_roi \ --roi_atlas wang \ --roi_name MST hMT ``` @@ -48,7 +48,7 @@ bidspm \ $PWD/outputs/raw \ $PWD/outputs/derivatives \ subject \ - --action create_roi \ + create_roi \ --roi_atlas hpcex \ --roi_name MST MT ``` @@ -65,7 +65,7 @@ docker run -it --rm \ /raw \ /derivatives \ subject \ - --action create_roi \ + create_roi \ --roi_atlas hcpex \ --roi_name MST MT ``` diff --git a/docs/source/images/mermaid.md b/docs/source/images/mermaid.md index 24f369785..3c61a24ef 100644 --- a/docs/source/images/mermaid.md +++ b/docs/source/images/mermaid.md @@ -17,4 +17,4 @@ graph TD batch_02 --> E[SPM12] end - CLI -->|--action results\n--participant-label 01 02\n--model_file smdl.json| bidsResults + CLI -->|results\n--participant-label 01 02\n--model_file smdl.json| bidsResults diff --git a/docs/source/installation/containers.md b/docs/source/installation/containers.md index 0520329c2..2fb6f0e15 100644 --- a/docs/source/installation/containers.md +++ b/docs/source/installation/containers.md @@ -48,7 +48,7 @@ docker run -it --rm \ /derivatives \ subject \ --task auditory \ - --action preprocess \ + preprocess \ --fwhm 8 ``` @@ -68,7 +68,7 @@ docker run -it --rm \ /raw \ /derivatives \ subject \ - --action stats \ + stats \ --preproc_dir /derivatives/bidspm-preproc \ --model_file /models/smdl.json \ --fwhm 8 diff --git a/docs/source/stats/bids_stats_model.md b/docs/source/stats/bids_stats_model.md index bf3a6e8a1..dc7e631af 100644 --- a/docs/source/stats/bids_stats_model.md +++ b/docs/source/stats/bids_stats_model.md @@ -477,7 +477,7 @@ Subject level contrast averaging beta across runs ```{figure} ./images/gui_contrast_cross_session.png --- -name: contrast_subject +name: contrast_subject_cross_sessions align: center --- Subject level contrast averaging beta across runs diff --git a/docs/source/usage_notes.rst b/docs/source/usage_notes.rst index 0c00b296e..91c8f5c4c 100644 --- a/docs/source/usage_notes.rst +++ b/docs/source/usage_notes.rst @@ -11,5 +11,5 @@ Command line API ================ .. argparse:: - :ref: src.bidspm.parsers.common_parser + :ref: src.bidspm.parsers.sub_command_parser :prog: bidspm diff --git a/tests/test_bidspm.py b/tests/test_bidspm.py index 410feb5f1..77e9fdca9 100644 --- a/tests/test_bidspm.py +++ b/tests/test_bidspm.py @@ -22,7 +22,6 @@ generate_command_stats, new_line, preprocess, - run_command, stats, ) @@ -59,13 +58,6 @@ def test_append_base_arguments(): ) -def test_run_command(): - """Test run_command.""" - cmd = "disp('hello'); exit();" - return_code = run_command(cmd, platform="octave") - assert return_code == 0 - - @pytest.mark.parametrize( "action", [ diff --git a/tests/test_cli.py b/tests/test_cli.py index 8c7f899f8..c17a83e75 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -2,7 +2,7 @@ import pytest -from bidspm.cli import cli +from bidspm.cli import cli, run_command def test_bidspm_error_dir(caplog): @@ -15,3 +15,10 @@ def test_bidspm_error_dir(caplog): assert ["The 'bids_dir' does not exist:\n\t/foo/bar"] == [ rec.message for rec in caplog.records ] + + +def test_run_command(): + """Test run_command.""" + cmd = "disp('hello'); exit();" + return_code = run_command(cmd, platform="octave") + assert return_code == 0