corneliusroemer / pango_aliasor

Utility to alias and dealias pango lineages
MIT License
21 stars 6 forks source link

Partition lineage namespace #12

Closed aswarren closed 9 months ago

aswarren commented 1 year ago

Description of proposed changes

Common use of pango_aliasor for me was reconciling lineages that are to be included in a plot with those recorded in a public health table. e.g. to_graph=[XBB, XBB.1.5, XBB.1.16*] In such cases for stack plots it is necessary to partition the records and namespace based on the relations between the labels such that double counting isn't a problem. This code produces a data structure to enable that check.

e.g. namer = Aliasor() partitions= namer.partition_focus(to_graph)

Each lineage in to_graph would be a key in partitions. The values are lists of existing variants that respect the partitioning suggested by the presence of the other lineages.

For posterity. This may represent mission creep for this package. So it's fine to reject.