Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
14 tasks
nimzodisaster opened this issue Feb 7, 2024 · 5 comments

Comments

@nimzodisaster
Copy link
Contributor

nimzodisaster commented Feb 7, 2024

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

@nimzodisaster nimzodisaster changed the title 🐛 [User-reported Bug] 🐛 [User-reported Bug] Error during 'cpac utils data-config build ./data_settings.yml' re reference before assignment Feb 7, 2024
@shnizzedy
Copy link
Member

Hi @nimzodisaster, thanks for reporting!

What does

cpac version

say?

@nimzodisaster
Copy link
Contributor Author

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

@shnizzedy
Copy link
Member

Try replacing

freesurfer_dir: None

in your data_settings.yml with

freesurfer_dir:

@nimzodisaster
Copy link
Contributor Author

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

@shnizzedy
Copy link
Member

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

@shnizzedy shnizzedy changed the title 🐛 [User-reported Bug] Error during 'cpac utils data-config build ./data_settings.yml' re reference before assignment 🐛 Error during 'cpac utils data-config build ./data_settings.yml' re reference before assignment Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants