From 1e4f4c9bf83bd992b693994021181e1c61bc55d6 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 7 Jul 2024 17:50:37 +0200 Subject: [PATCH] show options in debug mode --- .circleci/config.yml | 10 +++++----- bidspm.m | 2 +- src/bidspm/matlab.py | 8 ++++++-- src/bidspm/parsers.py | 2 +- src/cli/getOptionsFromCliArgument.m | 9 +++++++++ src/infra/checkToolbox.m | 2 +- 6 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6b299549a..ceb567322 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -101,7 +101,7 @@ jobs: --action default_model \ --task balloonanalogrisktask \ --space MNI152NLin2009cAsym \ - --verbosity 2 + --verbosity 3 cat ${HOME}/outputs/ds000001/derivatives/models/*.json @@ -120,7 +120,7 @@ jobs: --action default_model \ --task balloonanalogrisktask \ --space MNI152NLin2009cAsym \ - --verbosity 2 + --verbosity 3 cat ${HOME}/outputs/ds000001/derivatives/models/*.json @@ -152,7 +152,7 @@ jobs: --participant_label 01 02 \ --space MNI152NLin2009cAsym \ --fwhm 8 \ - --verbosity 2 + --verbosity 3 # needed to access the model - checkout @@ -179,7 +179,7 @@ jobs: --skip_validation \ --fwhm 0 \ --participant_label 01 02 \ - --verbosity 2 \ + --verbosity 3 \ --options /options/ds000001.json - run: @@ -201,7 +201,7 @@ jobs: --space MNI152NLin2009cAsym \ --skip_validation \ --fwhm 0 \ - --verbosity 2 \ + --verbosity 3 \ --options /options/ds000001.json deploy: diff --git a/bidspm.m b/bidspm.m index 8ed90fff8..3906e1d56 100644 --- a/bidspm.m +++ b/bidspm.m @@ -261,7 +261,7 @@ function updateMacstoolbox() end if exist(target_dir, 'dir') == 7 - msg = sprintf('updating MACS toolbox: '); + msg = sprintf('updating MACS toolbox\n'); fprintf(1, msg); [status, cmdout] = system(sprintf('git -C %s pull', target_dir)); if status ~= 0 diff --git a/src/bidspm/matlab.py b/src/bidspm/matlab.py index 07ed64aaa..f61073517 100644 --- a/src/bidspm/matlab.py +++ b/src/bidspm/matlab.py @@ -2,12 +2,16 @@ def matlab() -> str: - """Return the path to the Matlab executable. + r"""Return the path to the Matlab executable. Modify this value to match your Matlab installation. The MATLAB 'matlabroot' should tell you where MATLAB is installed. The 'matlab' executable is usually in the 'bin' subdirectory. + + - Windows: ``'C:\\Program Files\\MATLAB\\R20XXx\bin\\matlab.exe'`` + - Mac: ``'/Applications/Matlab_R20XXx.app/bin/matlab'`` + - Linux: ``'/usr/local/MATLAB/R20XXx/bin/matlab'`` """ - return "/usr/local/MATLAB/R2018a/ bin/matlab" + return "/usr/local/MATLAB/R2018a/bin/matlab" diff --git a/src/bidspm/parsers.py b/src/bidspm/parsers.py index 68a0ab5f9..a1c04759b 100644 --- a/src/bidspm/parsers.py +++ b/src/bidspm/parsers.py @@ -94,7 +94,7 @@ def common_parser() -> argparse.ArgumentParser: help=""" Verbosity level. """, - choices=[0, 1, 2], + choices=[0, 1, 2, 3], default=2, type=int, nargs=1, diff --git a/src/cli/getOptionsFromCliArgument.m b/src/cli/getOptionsFromCliArgument.m index 5c35edcd8..eaab7b5db 100644 --- a/src/cli/getOptionsFromCliArgument.m +++ b/src/cli/getOptionsFromCliArgument.m @@ -74,6 +74,11 @@ opt.toolbox.MACS.model.dir = args.Results.models_dir; end + if opt.verbosity > 3 + unfold(opt); + end + unfold(opt); + end function opt = optionsPreprocessing(opt, args, action) @@ -147,10 +152,14 @@ end function opt = getOptions(args) + if isstruct(args.Results.options) opt = args.Results.options; elseif exist(args.Results.options, 'file') == 2 opt = bids.util.jsondecode(args.Results.options); + opt = checkOptions(opt); + logger('INFO', ['options loaded from file:\n', args.Results.options], ... + 'options', opt); end if isempty(opt) % set defaults diff --git a/src/infra/checkToolbox.m b/src/infra/checkToolbox.m index 5fbdb94f9..ac4d076ca 100644 --- a/src/infra/checkToolbox.m +++ b/src/infra/checkToolbox.m @@ -100,7 +100,7 @@ function updateMacstoolbox() end if exist(target_dir, 'dir') == 7 - msg = sprintf('updating MACS toolbox: '); + msg = sprintf('updating MACS toolbox\n'); fprintf(1, msg); system(sprintf('git -C %s pull', ... target_dir));