Skip to content

Commit

Permalink
fix: lineage_to_clade missed a . (#79)
Browse files Browse the repository at this point in the history
Previous logic made HK.34 belong to HK.3, because the "comparison_lineage" was missing a trailing `.` in `.startswith()`
  • Loading branch information
corneliusroemer authored Dec 15, 2023
1 parent cf8fe03 commit d051c57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/modify-lineage-colours-and-order.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def lineage_to_clade(lineage, aliasor, fallback, clade_definitions):
if clade_data['clade']=='other':
continue
comparison_lineage = aliasor.uncompress(clade_data['defining_lineage'])
if lineage_full == comparison_lineage or f"{lineage_full}.".startswith(comparison_lineage):
if lineage_full == comparison_lineage or lineage_full.startswith(comparison_lineage + "."):
return clade_data['clade']
return fallback

Expand Down

0 comments on commit d051c57

Please sign in to comment.