Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove wrong statement #2332

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

petrelharp
Copy link
Contributor

@petrelharp petrelharp commented Jan 3, 2025

This statement in the docs was wrong
Screenshot from 2025-01-03 15-45-26
as demonstrated by:

tables = tskit.TableCollection(sequence_length=10)
tables.populations.add_row()
tables.nodes.add_row(time=0, flags=1, population=0)
tables.nodes.add_row(time=0, flags=1, population=0)
tables.nodes.add_row(time=0, flags=1, population=0)
tables.nodes.add_row(time=1, flags=0, population=0)
tables.edges.add_row(left=1, right=5, parent=3, child=1)
tables.edges.add_row(left=1, right=5, parent=3, child=2)

ts.tables.tree_sequence()
print(ts.draw_text())

# 1.00┊       ┊    3  ┊       ┊ 
#     ┊       ┊   ┏┻┓ ┊       ┊ 
# 0.00┊ 0 1 2 ┊ 0 1 2 ┊ 0 1 2 ┊ 
#     0       1       5      10 

mts = msprime.sim_ancestry(initial_state=ts, population_size=1, random_seed=123)
print(mts.draw_text())

# 3.71┊   5   ┊   5   ┊   5   ┊ 
#     ┊  ┏┻━┓ ┊ ┏━┻┓  ┊  ┏┻━┓ ┊ 
# 1.00┊  ┃  ┃ ┊ ┃  3  ┊  ┃  ┃ ┊ 
#     ┊  ┃  ┃ ┊ ┃ ┏┻┓ ┊  ┃  ┃ ┊ 
# 0.79┊  4  ┃ ┊ ┃ ┃ ┃ ┊  4  ┃ ┊ 
#     ┊ ┏┻┓ ┃ ┊ ┃ ┃ ┃ ┊ ┏┻┓ ┃ ┊ 
# 0.00┊ 0 2 1 ┊ 0 1 2 ┊ 0 2 1 ┊ 
#     0       1       5      10 

Note that sim_ancestry has created a node at t=0.79, before the age of the oldest root (which is at 1.0).

However, doing mts = msprime.sim_ancestry(initial_state=ts, population_size=1, start_time=1.0 would start the simulation off at 1.0. We could add something to the docs saying this, but it's kinda a can of worms - for instance, the bit on recapitation says that "you must have all the input roots"; you might think it's okay to just specify start_time instead, but that's not right because you miss the recombinations that have happened to those root branches.

Copy link

codecov bot commented Jan 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.93%. Comparing base (90c8ce1) to head (ba62bd0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2332   +/-   ##
=======================================
  Coverage   90.93%   90.93%           
=======================================
  Files          20       20           
  Lines       12018    12018           
  Branches     2316     2316           
=======================================
  Hits        10929    10929           
  Misses        602      602           
  Partials      487      487           
Flag Coverage Δ
C 90.93% <ø> (ø)
python 98.70% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@benjeffery
Copy link
Member

@Mergifyio rebase

Copy link
Contributor

mergify bot commented Jan 8, 2025

rebase

✅ Branch has been successfully rebased

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants