Skip to content

make sort stricter #705

@petrelharp

Description

@petrelharp

With subset, we can reorder tables. But we still can't easily take two sets of completely equivalent tables and put them in the same order. From the requirements:

  • nodes we can order using subset
  • pops and indivs will be ordered by earliest node by subset
  • edge order is undefined among parents of the same time
  • mutation order is undefined among mutations of the same time
  • migration order is undefined among migrations of the same time

The ordering could be total by adding parent to the edge sort key, and node to the mutation and migration sort keys.

This would be nice to do since when doing union #623 we would like to make sure that when subsetting on the shared nodes the tables are equal. It'd probably be useful for other testing.

Table sorting is a bottleneck in forwards sims, so perhaps we want to make the "strict sort" optional; and if strict=True we first sort with the above additions to the keys, then do subset(range(num_nodes)). This would be guaranteed to always get the same order no matter the original order of the tables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions