π Error during 'cpac utils data-config build ./data_settings.yml' re reference before assignment
nimzodisaster opened this issue Β· comments
Describe the bug
I am trying to build the data_settings
I receive the following error:
`(rs) jlee38@:/mnt/drive/rs$ cpac utils data-config build ./data_settings.yml
Loading π³ Docker
....
....
Traceback (most recent call last):
File "/code/run.py", line 827, in
Generating data configuration file..
run_main()
File "/code/run.py", line 367, in run_main
main.main(args=sys.argv[sys.argv.index('--') + 1:])
File "/usr/share/fsl/6.0/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/usr/share/fsl/6.0/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/share/fsl/6.0/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/share/fsl/6.0/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/share/fsl/6.0/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/share/fsl/6.0/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/code/CPAC/main.py", line 356, in build
run(data_settings_file)
File "/code/CPAC/utils/build_data_config.py", line 1849, in run
data_dct = get_nonBIDS_data(settings_dct['anatomicalTemplate'],
File "/code/CPAC/utils/build_data_config.py", line 1589, in get_nonBIDS_data
for dir in os.listdir(str(os.path.dirname(freesurfer_glob))):
UnboundLocalError: local variable 'freesurfer_glob' referenced before assignment
`
Attached is the data_settings file I used
data_settings.yml.txt
To reproduce
No response
Preconfig
- default
- abcd-options
- anat-only
- blank
- ccs-options
- fmriprep-options
- fx-options
- monkey
- monkey-ABCD
- ndmg
- nhp-macaque
- preproc
- rbc-options
- rodent
Custom pipeline configuration
No response
Run command
No response
Expected behavior
I expect to get subject configs file
Acceptance criteria
successfully execute
Screenshots
No response
C-PAC version
1.8.6.dev1
Container platform
Docker
Docker and/or Singularity version(s)
24.0.7
Additional context
No response
cpac (convenience wrapper) version 1.8.6
C-PAC version v1.8.6.dev1 running on Docker version 24.0.7
Try replacing
freesurfer_dir: None
in your data_settings.yml
with
freesurfer_dir:
That worked. I guess it misreads that key as a string instead of the None keyword.
Thanks!
Great, glad it worked!
We can keep this issue open though, to make this clearer. I think this is actually a design flaw in the template data_settings.yml
since the ways to encode None
in YAML are [, null, Null, NULL, ~]
(not "None
")