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

Clarify mutation order in Site() object #3067

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

Conversation

hyanwong
Copy link
Member

@hyanwong hyanwong commented Dec 5, 2024

This is useful to know without having to dive into the order requirements docs. I'm often looking this up to find the inherited state at a node.

This is useful to know without having to dive into the order requirements docs
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.86%. Comparing base (d1d5bb7) to head (96777dc).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3067   +/-   ##
=======================================
  Coverage   89.86%   89.86%           
=======================================
  Files          29       29           
  Lines       32150    32150           
  Branches     5768     5768           
=======================================
  Hits        28890    28890           
  Misses       1859     1859           
  Partials     1401     1401           
Flag Coverage Δ
c-tests 86.71% <ø> (ø)
lwt-tests 80.78% <ø> (ø)
python-c-tests 89.05% <ø> (ø)
python-tests 98.98% <ø> (ø)

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

Files with missing lines Coverage Δ
python/tskit/trees.py 98.80% <ø> (ø)

@jeromekelleher
Copy link
Member

Note that there are are loopholes in the mutation data requirements which means that it's possible for this to not actually be true (which is a bug, but not one we can easily resolve now)

@hyanwong
Copy link
Member Author

hyanwong commented Dec 5, 2024

Right, I know that the sorting process doesn't necessarily enforce parent/child correctness (and this is noted in the docs, and in #2732) but they also say:

when there are multiple mutations per site, mutations should be ordered by decreasing time, if known, and parent mutations must occur before their children..
Violations of these sorting requirements are detected at load time.

I guess violations of mutation parent order are not (yet?) detected at load time, so the doc wording should be changed to point out this bug?

Edit - I see this is part of #2757 (comment)

@jeromekelleher
Copy link
Member

It's a bit tricky. Maybe you could put in a link to the definitions instead of explaining, so at least it's all in one place?

@hyanwong
Copy link
Member Author

hyanwong commented Dec 5, 2024

Maybe we just leave this open until it's (eventually) fixed? It does my head in trying to figure out from the rather involved mutation sorting requirements that the most recent mutations for a site are (should be) at the end of the list. I feel that just needs to be stated simply somewhere, for the non-technical reader.

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

Successfully merging this pull request may close these issues.

2 participants