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

Fix unbound local error in online_cnmf when use_corr_img is true but is1p is false #1384

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

ethanbb
Copy link
Contributor

@ethanbb ethanbb commented Aug 9, 2024

Description

Currently, in the method OnACID._prepare_object , d1 and d2 are only set when self.is1p is true, but are only used if the parameter online['use_corr_img'] is true. I was trying to run it with use_corr_imgbut without setting the other parameters in a way that causesis1p` to be true, so I got an unbound local error.

Since these variables are only used in one place in this function, I just moved the line that defines them to be right before they are used. I'm not 100% sure the functionality is correct, but the line just reads from estimates.dims, which seems pretty straightforward.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Has your PR been tested?

Did not run the tests myself (relying on CI) but I did check that making this change prevented the error I was getting when trying to call fit_online with these parameters.

@pgunn pgunn merged commit 65d8580 into flatironinstitute:dev Aug 9, 2024
3 checks passed
@ethanbb ethanbb deleted the onacid-unbound-fix branch August 9, 2024 19:14
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 this pull request may close these issues.

2 participants