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

Implement TreeSequence.discrete_genome #1819

Merged
merged 1 commit into from
Oct 20, 2021

Conversation

jeromekelleher
Copy link
Member

Closes #1144

This should unplug a few outstanding issues. We could make things a bit more granular and just focus on discrete sites/breakpoints etc, but I don't think it's worth the bother. Tree sequences mixing discrete and continuous coordinates are going to be rare, and probably a result of a mistake somewhere along the way.

Copy link
Member

@benjeffery benjeffery left a comment

Choose a reason for hiding this comment

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

LGTM! Just that one error on the CI. I guess we don't need to test the negative space as it isn't a valid tree sequence even though TableCollection allows it.

c/tskit/trees.c Outdated
static inline bool
is_discrete(double x)
{
return floor(x) == x;
Copy link
Member

Choose a reason for hiding this comment

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

Do floating point representations of integers always resolve to the positive side? Did a quick google and didn't find a source.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, good point. I've changed to trunc just in case we ever end up supporting negative coords.

@codecov
Copy link

codecov bot commented Oct 19, 2021

Codecov Report

Merging #1819 (90f62be) into main (e5dc0f6) will decrease coverage by 0.50%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1819      +/-   ##
==========================================
- Coverage   93.90%   93.39%   -0.51%     
==========================================
  Files          27       27              
  Lines       24634    24814     +180     
  Branches     1094     1094              
==========================================
+ Hits        23132    23175      +43     
- Misses       1467     1604     +137     
  Partials       35       35              
Flag Coverage Δ
c-tests 92.12% <100.00%> (+0.01%) ⬆️
lwt-tests 89.14% <ø> (ø)
python-c-tests 94.53% <100.00%> (-1.00%) ⬇️
python-tests 98.75% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
c/tskit/trees.c 94.92% <100.00%> (+0.03%) ⬆️
python/_tskitmodule.c 91.68% <100.00%> (-2.05%) ⬇️
python/tskit/trees.py 97.83% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e5dc0f6...90f62be. Read the comment docs.

Copy link
Contributor

@petrelharp petrelharp left a comment

Choose a reason for hiding this comment

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

LGTM, on a quick scan!

@benjeffery benjeffery added the AUTOMERGE-REQUESTED Ask Mergify to merge this PR label Oct 20, 2021
@benjeffery
Copy link
Member

I've fixed the conflict and set it to merge

@jeromekelleher
Copy link
Member Author

Thanks @benjeffery - I didn't see the conflict, sorry.

@mergify mergify bot merged commit 5ccccd5 into tskit-dev:main Oct 20, 2021
@mergify mergify bot removed the AUTOMERGE-REQUESTED Ask Mergify to merge this PR label Oct 20, 2021
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.

Add discrete_genome property to TreeSequence
3 participants