Skip to content

Python 0.5.3

Compare
Choose a tag to compare
@github-actions github-actions released this 03 Oct 18:50
· 296 commits to main since this release
1919abe

Fixes

  • The Variant object can now be initialized with 64 bit numpy ints as
    returned e.g. from np.where (@hyanwong, #2518, #2514)

  • Fix tree.mrca for the case of a tree with multiple roots.
    (@benjeffery, #2533, #2521)

Features

  • The ts.nodes method now takes an order parameter so that nodes
    can be visited in time order (@hyanwong, #2471, #2370)

  • Add samples argument to TreeSequence.genotype_matrix.
    Default is None, where all the sample nodes are selected.
    (@szhan, #2493, #678)

  • ts.draw and the draw_svg methods now have an optional omit_sites
    parameter, aiding drawing large trees with many sites and mutations
    (@hyanwong, #2519, #2516)

Breaking Changes

  • Single statistics computed with TreeSequence.general_stat are now
    returned as numpy scalars if windows=None, AND; samples is a single
    list or None (for a 1-way stat), OR indexes is None or a single list of
    length k (instead of a list of length-k lists).
    (@gtsambos, #2417, #2308)

  • Accessor methods such as ts.edge(n) and ts.node(n) now allow negative
    indexes (@hyanwong, #2478, #1008)

  • ts.subset() produces valid tree sequences even if nodes are shuffled
    out of time order (@hyanwong, #2479, #2473), and the
    same for tables.subset() (@hyanwong, #2489). This involves
    sorting the returned tables, potentially changing the returned edge order.

Performance improvements

  • TreeSequence.link_ancestors no longer continues to process edges once all
    of the sample and ancestral nodes have been accounted for, improving memory
    overhead and overall performance
    (@gtsambos, #2456, #2442)