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

KDE frequencies bug #425

Closed
trvrb opened this issue Dec 14, 2019 · 0 comments · Fixed by #426
Closed

KDE frequencies bug #425

trvrb opened this issue Dec 14, 2019 · 0 comments · Fixed by #426
Assignees
Labels
bug Something isn't working

Comments

@trvrb
Copy link
Member

trvrb commented Dec 14, 2019

@huddlej ---

After merging #420, we're getting errors on the augur frequencies --method kde step of the seasonal flu test build visible on Travis CI: https://travis-ci.com/nextstrain/seasonal-flu/builds/140726643#L812 and reprinted below:

augur frequencies --method kde --tree results/tree_cdc_h3n2_ha_12y_cell_hi.nwk --metadata results/metadata_h3n2_ha.tsv --narrow-bandwidth 0.08333333333333333 --wide-bandwidth 0.25 --proportion-wide 0.0 --weights config/frequency_weights_by_region.json --weights-attribute region --pivot-interval 6 --min-date 2007.952772073922 --max-date 2019.870636550308 --output auspice/flu_cdc_h3n2_ha_12y_cell_hi_tip-frequencies.json

Traceback (most recent call last):
  File "/Users/trvrb/.pyenv/versions/3.6.1/bin/augur", line 11, in <module>
    load_entry_point('nextstrain-augur', 'console_scripts', 'augur')()
  File "/Users/trvrb/Documents/src/augur/augur/__main__.py", line 10, in main
    return augur.run( argv[1:] )
  File "/Users/trvrb/Documents/src/augur/augur/__init__.py", line 74, in run
    return args.__command__.run(args)
  File "/Users/trvrb/Documents/src/augur/augur/frequencies.py", line 165, in run
    frequencies = kde_frequencies.estimate(tree)
  File "/Users/trvrb/Documents/src/augur/augur/frequency_estimators.py", line 1148, in estimate
    weight_keys, weight_values = zip(*sorted(self.weights.items()))
ValueError: not enough values to unpack (expected 2, got 0)
@trvrb trvrb added the bug Something isn't working label Dec 14, 2019
huddlej added a commit that referenced this issue Dec 16, 2019
Throw an exception if the user has requested weighted KDE frequencies with
weights that do not match any of the tips in the given tree. This commit
explicitly checks for an empty dictionary of weights after filtering for
representation by tips and raise an exception with a meaningful error
message (instead of allowing the code to continue running and throwing a less
meaningful ValueError when no valid weights remain). This commit also adds a
unit test for this behavior.

Closes #425.
huddlej added a commit that referenced this issue Dec 16, 2019
Throw an exception if the user has requested weighted KDE frequencies with
weights that do not match any of the tips in the given tree. This commit
explicitly checks for an empty dictionary of weights after filtering for
representation by tips and raise an exception with a meaningful error
message (instead of allowing the code to continue running and throwing a less
meaningful ValueError when no valid weights remain). This commit also adds a
unit test for this behavior.

Closes #425.
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

Successfully merging a pull request may close this issue.

2 participants