Skip to content

Commit 6d285ef

Browse files
committed
Add warning to FreeSurfer outdir ingress
1 parent 6e07437 commit 6d285ef

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

CPAC/pipeline/engine.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,10 +1320,9 @@ def connect_block(self, wf, cfg, rpool):
13201320
option_val = option_config[-1]
13211321
if option_val in self.grab_tiered_dct(cfg, key_list[:-1]):
13221322
opts.append(option_val)
1323-
else: # AND, if there are multiple option-val's (in a list) in the docstring, it gets iterated below in 'for opt in option' etc. AND THAT'S WHEN YOU HAVE TO DELINEATE WITHIN THE NODE BLOCK CODE!!!
1323+
else:
13241324
opts = [None]
13251325
all_opts += opts
1326-
13271326
for name, block_dct in self.node_blocks.items(): # <--- iterates over either the single node block in the sequence, or a list of node blocks within the list of node blocks, i.e. for option forking.
13281327
switch = self.check_null(block_dct['switch'])
13291328
config = self.check_null(block_dct['config'])
@@ -1395,7 +1394,6 @@ def connect_block(self, wf, cfg, rpool):
13951394
switch = self.grab_tiered_dct(cfg, key_list)
13961395
if not isinstance(switch, list):
13971396
switch = [switch]
1398-
13991397
if True in switch:
14001398
for pipe_idx, strat_pool in rpool.get_strats(
14011399
inputs, debug).items(): # strat_pool is a ResourcePool like {'desc-preproc_T1w': { 'json': info, 'data': (node, out) }, 'desc-brain_mask': etc.}
@@ -1418,7 +1416,6 @@ def connect_block(self, wf, cfg, rpool):
14181416
input_name = interface[1]
14191417
strat_pool.copy_resource(input_name, interface[0])
14201418
replaced_inputs.append(interface[0])
1421-
14221419
try:
14231420
wf, outs = block_function(wf, cfg, strat_pool,
14241421
pipe_x, opt)
@@ -1736,7 +1733,11 @@ def ingress_raw_anat_data(wf, rpool, cfg, data_paths, unique_id, part_id,
17361733
dl_dir=cfg.pipeline_setup['working_directory']['path'])
17371734
rpool.set_data(key, fs_ingress, 'outputspec.data',
17381735
{}, "", f"fs_{key}_ingress")
1739-
1736+
else:
1737+
warnings.warn(str(
1738+
LookupError("\n[!] Path does not exist for "
1739+
f"{fullpath}.\n")))
1740+
17401741
return rpool
17411742

17421743

0 commit comments

Comments
 (0)