test_tau_bounds.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:Population-Model-Compare 作者: selotape 项目源码 文件源码
def test_large_pop_tree():
    ROOT = Population(name='ROOT')

    AB = Population(name='AB', father=ROOT)
    A = Population(name='A', father=AB)
    B = Population(name='B', father=AB)

    CD = Population(name='CD', father=ROOT)
    C = Population(name='C', father=CD)
    D = Population(name='D', father=CD)

    a = Event(time=0.0, lca_pop=A)
    b = Event(time=0.0, lca_pop=B)
    ab = Event(time=0.5, left=a, right=b)

    c = Event(time=0.0, lca_pop=C)
    d = Event(time=0.0, lca_pop=D)
    cd = Event(time=0.6, left=c, right=d)

    r = Event(time=1.0, left=ab, right=cd)

    tau_bounds = find_tau_bounds(r)

    for pop, event in ((A, a), (B, b), (C, c), (D, d), (AB, ab), (CD, cd), (ROOT, r)):
        assert isclose(tau_bounds[pop], event.time)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号