Skip to content

Add discrete time #1890

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

Merged
merged 1 commit into from
Nov 8, 2021
Merged

Add discrete time #1890

merged 1 commit into from
Nov 8, 2021

Conversation

benjeffery
Copy link
Member

Fixes #1839

@benjeffery benjeffery marked this pull request as ready for review November 5, 2021 13:07
@codecov
Copy link

codecov bot commented Nov 5, 2021

Codecov Report

Merging #1890 (cde024a) into main (345e2b3) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1890      +/-   ##
==========================================
+ Coverage   93.15%   93.16%   +0.01%     
==========================================
  Files          27       27              
  Lines       25001    25032      +31     
  Branches     1104     1104              
==========================================
+ Hits        23289    23321      +32     
+ Misses       1677     1676       -1     
  Partials       35       35              
Flag Coverage Δ
c-tests 92.23% <100.00%> (+0.01%) ⬆️
lwt-tests 89.14% <ø> (ø)
python-c-tests 68.42% <88.88%> (+0.02%) ⬆️
python-tests 98.74% <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 95.01% <100.00%> (+0.03%) ⬆️
python/_tskitmodule.c 90.39% <100.00%> (+0.02%) ⬆️
python/tskit/trees.py 97.80% <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 345e2b3...cde024a. Read the comment docs.

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.

LGTM, one suggestion

c/tskit/trees.c Outdated
bool discrete_times = true;

for (j = 0; j < num_mutations; j++) {
discrete_times = discrete_times && is_discrete(time[j]);
Copy link
Member

@jeromekelleher jeromekelleher Nov 5, 2021

Choose a reason for hiding this comment

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

I think it'd be clearer if we put the special case for is_unknown_time in here - it's more obvious that we're making an exception for it, and we also avoid calling tsk_is_unknown_time for things like genome positions, which can't be unknown time.

@benjeffery
Copy link
Member Author

Fixed up

@mergify mergify bot merged commit 510e515 into tskit-dev:main Nov 8, 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 TreeSequence.discrete_time property
2 participants