Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@

# Calculate tree heights, giving uncoalesced sites the maximum time
def tree_heights(ts):
uncoalesced_height = ts.metadata['SLiM']['tick']
heights = np.zeros(ts.num_trees + 1)
for tree in ts.trees():
if tree.num_roots > 1: # not fully coalesced
heights[tree.index] = ts.metadata['SLiM']['tick']
heights[tree.index] = uncoalesced_height

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary any more! I see that below we recapitate, implying that this tree sequence has all the input roots, and so the heights of all the roots should all be equal to the tick value (+/- 1) already!

else:
children = tree.children(tree.root)
real_root = tree.root if len(children) > 1 else children[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@

# Calculate tree heights, giving uncoalesced sites the maximum time
def tree_heights(ts):
uncoalesced_height = ts.metadata['SLiM']['tick']
heights = np.zeros(ts.num_trees + 1)
for tree in ts.trees():
if tree.num_roots > 1: # not fully coalesced
heights[tree.index] = ts.metadata['SLiM']['tick']
heights[tree.index] = uncoalesced_height
else:
children = tree.children(tree.root)
real_root = tree.root if len(children) > 1 else children[0]
Expand Down
1 change: 1 addition & 0 deletions VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ multitrait branch:
add a built-in "Multispecies Multitrait Phenotype ~ Time" plot for phenotype ~ time, with one line per trait across all species
add a built-in "Phenotype ~ Time" plot for phenotype ~ time, focusing on a single user-selected trait across subpopulations
clean up the way pedigree IDs get recorded, for better efficiency and parallelization
fix recipe 18.10 to reduce metadata accesses (see discussion at https://github.com/tskit-dev/tskit/issues/3472#issuecomment-5210734749)


version 5.2 (Eidos version 4.2):
Expand Down
Loading