-
Notifications
You must be signed in to change notification settings - Fork 60
fix shadowed variable #1132
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 shadowed variable #1132
Conversation
| for iFree, (nNeg, iFree, negMask) in enumerate(negList): | ||
| if iFree not in badParameters and nNeg: | ||
| for nNeg, iFree, negMask in negList[1:]: | ||
| if nNeg: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first iFree was shadowed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is quite long ago, but I think you are missing the point of pixels already included in the list to be re-fitted. One pixel can have more than one element with negative areas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iFree is defined twice so that is clearly an issue
for iFree, (nNeg, iFree, negMask) in enumerate(negList):
Then there is
if iFree not in badParameters
How can iFree potentially appear more than once in badParameters?
I understand that one pixel can have more than one negative peak area but that is unrelated to this. badParameters is the list of peak area indices that will be excluded from the fit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Got your point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I have to figure out is why the enumeration was necessary. It makes no sense if it is not to be used.
No description provided.