cohenlabUNC/clpipe

Var referenced before assignment

wasciutto opened this issue · 2 comments

User reported this error from 1.8.0.4:

UnboundLocalError: local variable 'confounds_export_path' referenced before assignment" 

If this is truly in 1.8.0 then it needs to be fixed ASAP.

the try/catch use of confounds_export_path probably leaves this value unassigned when the workflow setup function raises any value error.

if not confounds_only:
probably needs to be nested in the try

No, there is a deeper problem here - confounds failing should not be able to let the image run anyways, incase there is a dependency.

Also, confounds_path here causes the same problem.

This leads to me thinking that build_postprocessing_workflow should probably handle building both workflows, instead of having them passed in. The logic for confounds being off/on in relation to confound dependent steps (e.g. confound regression) can be handled there.