From bd004dfabb4b2cf45276f7a5863b52aae6d07888 Mon Sep 17 00:00:00 2001 From: smoia Date: Fri, 6 Mar 2020 19:31:22 +0100 Subject: [PATCH 1/2] Prettified pagination --- docs/heuristic.rst | 144 ++++++++------------------------------------- docs/howto.rst | 101 +++++++++++++++---------------- 2 files changed, 72 insertions(+), 173 deletions(-) diff --git a/docs/heuristic.rst b/docs/heuristic.rst index 52e9ce138..2d6f18300 100644 --- a/docs/heuristic.rst +++ b/docs/heuristic.rst @@ -10,73 +10,19 @@ Anatomy of a heuristic file --------------------------- Let's have a look under the hood of the heuristic files used in the `tutorial `_. -It's the file ``heur_tutorial.py`` in ``phys2bids/phy2bids/heuristics/``:: - - import fnmatch - - - def heur(physinfo, name, task='', acq='', direct='', rec='', run=''): - # ############################## # - # ## Modify here! ## # - # ## ## # - # ## Possible variables are: ## # - # ## -task (required) ## # - # ## -run ## # - # ## -rec ## # - # ## -acq ## # - # ## -direct ## # - # ## ## # - # ## ## # - # ## See example below ## # - # ############################## # - - if fnmatch.fnmatchcase(physinfo, '*tutorial*'): - task = 'test' - run = '00' - rec = 'labchart' - elif physinfo == 'Example': - task = 'rest' - run = '01' - acq = 'resp' - # ############################## # - # ## Don't modify below this! ## # - # ############################## # - else: - # #!# Transform sys.exit in debug warnings or raiseexceptions! - # #!# Make all of the above a dictionary - raise Warning(f'The heuristic {__file__} could not deal with {physinfo}') - - if not task: - raise KeyError(f'No "task" attribute found') - - name = name + '_task-' + task - - # filename spec: sub-