FCP-INDI / C-PAC

Configurable Pipeline for the Analysis of Connectomes
https://fcp-indi.github.io/
GNU Lesser General Public License v3.0
62 stars 40 forks source link

🐛 Error during 'cpac utils data-config build ./data_settings.yml' re reference before assignment #2065

Open nimzodisaster opened 7 months ago

nimzodisaster commented 7 months ago

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

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

shnizzedy commented 7 months ago

Hi @nimzodisaster, thanks for reporting!

What does

cpac version

say?

nimzodisaster commented 7 months ago

cpac (convenience wrapper) version 1.8.6 C-PAC version v1.8.6.dev1 running on Docker version 24.0.7

shnizzedy commented 7 months ago

Try replacing

freesurfer_dir: None

in your data_settings.yml with

freesurfer_dir:
nimzodisaster commented 7 months ago

That worked. I guess it misreads that key as a string instead of the None keyword. Thanks!

shnizzedy commented 7 months ago

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")