Skip to content

UnboundLocalError: local variable 'module_name' referenced before assignment #2488

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

Closed
yarikoptic opened this issue Mar 7, 2018 · 2 comments · Fixed by #2490
Closed

UnboundLocalError: local variable 'module_name' referenced before assignment #2488

yarikoptic opened this issue Mar 7, 2018 · 2 comments · Fixed by #2490
Milestone

Comments

@yarikoptic
Copy link
Member

Summary

Discovered for myself nipypecli and decided to give it a try while composing cmdline invocation just following the errors it was spitting out at me and stopping when error didn't give a hint what I could have specified incorrectly:

$> nipypecli convert boutiques -m nipype.interfaces.ants.registration -i ANTS -o test
Traceback (most recent call last):
  File "/usr/bin/nipypecli", line 11, in <module>
    load_entry_point('nipype==1.0.1', 'console_scripts', 'nipypecli')()
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/nipype/scripts/cli.py", line 254, in boutiques
    verbose, ignore_template_numbers)
  File "/usr/lib/python2.7/dist-packages/nipype/utils/nipype2boutiques.py", line 56, in generate_boutiques_descriptor
    'command-line'] = "nipype_cmd " + module_name + " " + interface_name + " "
UnboundLocalError: local variable 'module_name' referenced before assignment
@satra
Copy link
Member

satra commented Mar 7, 2018

thanks @yarikoptic - the basic error i can fix, but i think this function may need some improved handling. more generally, we should implement a nipype api so that as a test this function can be run against all interfaces automatically.

@glatard - any chance you or @gkiar can take a look?

@gkiar
Copy link

gkiar commented Mar 8, 2018

Hi @yarikoptic @satra - Regardless of the above error, I believe this function is in need of a roll-over to the latest Boutiques schema (version 0.5) anyways, so I'm happy to take it on and will test it against the above example, and will add a corresponding test for (at least) this interface.

I'll open a PR once that's done :)

@effigies effigies added this to the 1.0.2 milestone Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants