Skip to content

Commit

Permalink
Restore clades to top entry in colorings
Browse files Browse the repository at this point in the history
The intention of the coloring logic is that if an auspice-config provides
the clade_membership key then it is exported at that position in the
colorings list. If clade_membership is not explicitly set in the config
(but is present in a node-data file) then we have (for a very long time)
added it as the very first entry in the colorings list.

PR #728 (augur v22.0.0) erroneously modified the behavior of the second
case described above, which has now been restored by this commit.
  • Loading branch information
jameshadfield committed May 16, 2023
1 parent 5daf6e8 commit d77297e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion augur/export_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,8 +798,9 @@ def node_data_prop_is_normal_trait(name):
"authors", # authors are set as a node property, not a trait property
"author", # see above
"vaccine", # vaccine info is stored as a "special" node prop
'clade_membership', # explicitly set as a coloring if present
'branch_length',
'num_date',
'num_date', # explicitly set as a coloring if present
'raw_date',
'numdate',
'clock_length',
Expand Down
8 changes: 4 additions & 4 deletions tests/functional/export_v2/dataset-with-branch-labels.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
},
"colorings": [
{
"key": "gt",
"title": "Genotype",
"key": "clade_membership",
"title": "Clade",
"type": "categorical"
},
{
"key": "clade_membership",
"title": "Clade",
"key": "gt",
"title": "Genotype",
"type": "categorical"
}
],
Expand Down

0 comments on commit d77297e

Please sign in to comment.