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

frequencies: Initialize variables in proper scope #1413

Merged
merged 3 commits into from
Feb 14, 2024

Conversation

victorlin
Copy link
Member

@victorlin victorlin commented Feb 13, 2024

Description of proposed changes

#1398 referenced the weights_attribute variable before it was initialized, resulting in an UnboundLocalError when a non-KDE method (i.e. diffusion) is used with --tree. This brings that variable and another related one to a higher scope where the reference is now valid.

Related issue(s)

Checklist

  • Test added for --method diffusion
  • Checks pass
  • If making user-facing changes, add a message in CHANGES.md summarizing the changes in this PR

Commit "Annotate tips with the minimum necessary information"
(dde857a) referenced the weights_attribute variable before it was
initialized, resulting in an UnboundLocalError when a non-KDE method
(i.e. diffusion) is used with --tree. This brings that variable and
another related one to a higher scope where the reference is now valid.
@victorlin victorlin self-assigned this Feb 13, 2024
@victorlin victorlin changed the title frequences: Initialize variables in proper scope frequencies: Initialize variables in proper scope Feb 13, 2024
Copy link

codecov bot commented Feb 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (704fca7) 67.67% compared to head (313924b) 68.39%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1413      +/-   ##
==========================================
+ Coverage   67.67%   68.39%   +0.71%     
==========================================
  Files          69       69              
  Lines        7518     7517       -1     
  Branches     1844     1843       -1     
==========================================
+ Hits         5088     5141      +53     
+ Misses       2158     2092      -66     
- Partials      272      284      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@victorlin victorlin marked this pull request as ready for review February 13, 2024 23:42
@victorlin victorlin requested a review from a team February 13, 2024 23:42
Copy link
Contributor

@joverlee521 joverlee521 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix 🙏

Looks good to me from inspecting the code changes. I left a question tangential to the bug fix because I'm unfamiliar with how augur frequencies work internally.

@victorlin victorlin merged commit c53b0e9 into master Feb 14, 2024
20 checks passed
@victorlin victorlin deleted the victorlin/fix-diffusion branch February 14, 2024 00:26
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.

frequencies: UnboundLocalError: local variable 'weights_attribute' referenced before assignment
2 participants