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

UnboundLocalError in make_sinc_pulse.py #46

Closed
schuenke opened this issue Apr 13, 2021 · 4 comments
Closed

UnboundLocalError in make_sinc_pulse.py #46

schuenke opened this issue Apr 13, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@schuenke
Copy link
Collaborator

Since 7542b39 I get the error UnboundLocalError: local variable 'gz' referenced before assignment when creating an rf pulse with make_sinc_pulse.py.

This happens when I set return_gz = False or when I don't set any return_gz value and thus use the False default value.

@sravan953 sravan953 added the bug Something isn't working label Apr 13, 2021
sravan953 added a commit that referenced this issue Apr 13, 2021
@sravan953
Copy link
Collaborator

Please let me know if pulling from the latest dev commit fixes this issue for you.

@schuenke
Copy link
Collaborator Author

The

    if return_gz:
        return rf, gz, gzr
    else:
        return rf

fixed the issue.

For consistency I would use the same if-else style in the make_gauss_pulse.py as well.

Very minor thing:
the default for return_gz is False, but the docstring reads return_gz:bool, default=True

sravan953 added a commit that referenced this issue Apr 15, 2021
@sravan953
Copy link
Collaborator

Thanks @schuenke for bearing with me. The latest commits must have fixed this for good!

@schuenke
Copy link
Collaborator Author

Issue is fixed now. Thanks @sravan953 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants