Skip to content

Conversation

@benjeffery
Copy link
Member

Fixes #3293

This seemed to be quite straight-forward? Maybe when we added isolated_as_missing we just didn't apply it to alignements?

@codecov
Copy link

codecov bot commented Oct 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.78%. Comparing base (e66da01) to head (c3dcdcf).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3294      +/-   ##
==========================================
+ Coverage   89.65%   89.78%   +0.13%     
==========================================
  Files          29       29              
  Lines       30607    30964     +357     
  Branches     5614     5665      +51     
==========================================
+ Hits        27441    27802     +361     
+ Misses       1780     1779       -1     
+ Partials     1386     1383       -3     
Flag Coverage Δ
c-tests 86.86% <ø> (ø)
lwt-tests 80.38% <ø> (ø)
python-c-tests 86.91% <ø> (ø)
python-tests 98.83% <ø> (+0.06%) ⬆️
python-tests-no-jit 33.59% <ø> (+0.40%) ⬆️
python-tests-numpy1 50.04% <ø> (-0.80%) ⬇️

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.84% <ø> (+<0.01%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@jeromekelleher jeromekelleher left a comment

Choose a reason for hiding this comment

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

This is definitely a big help, but we should clarify how this relates to #1896 and what's going on more generally.

(default) alignments will continue until the end of the tree sequence.
:param bool isolated_as_missing: If True (default), isolated samples without
mutations are treated as missing data and this method raises an error
when any are detected. If False, missing data are imputed with the
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
when any are detected. If False, missing data are imputed with the
when any are detected. If False, missing data is imputed with the


- ``TreeSequence.alignments`` now accepts ``isolated_as_missing=False`` so that
alignments can be emitted for non-sample nodes (e.g., internal ARG nodes) when
missing data are imputed to the ancestral state. (:user:`benjeffery`, :issue:`3293`)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
missing data are imputed to the ancestral state. (:user:`benjeffery`, :issue:`3293`)
missing data is imputed to the ancestral state. (:user:`benjeffery`, :issue:`3293`)

tree._has_isolated_samples() for tree in self.trees()
):
raise ValueError(
"Missing data not currently supported in alignments; see "
Copy link
Member

Choose a reason for hiding this comment

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

Let's update this to suggest using isolated_as_missing, but note some caveats?

@benjeffery
Copy link
Member Author

I've updated to add more detail in the docs and error.

@jeromekelleher
Copy link
Member

Looks good. Can you change the "data are" to "data is" please? (This is a hill I will die on!)

@benjeffery benjeffery added this to the Python 1.0 milestone Nov 3, 2025
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.

Enable alignments on sc2ts ARG internal nodes

2 participants