Skip to content

Time units error - #1760

Merged
mergify[bot] merged 1 commit into
tskit-dev:mainfrom
benjeffery:time_units_use_2
Oct 8, 2021
Merged

mergify[bot] merged 1 commit into
tskit-dev:mainfrom
benjeffery:time_units_use_2

Conversation

@benjeffery

Copy link
Copy Markdown
Member

Fixes #1644

WIP for feedback.

Is this how you saw this working @jeromekelleher ?

I've added errors to tsk_treeseq_allele_frequency_spectrum when TSK_STAT_BRANCH and tsk_treeseq_general_stat when TSK_STAT_BRANCH.

I have not errored on 'tsk_treeseq_kc_distance' as although it uses branch length, it seems like the dimension isn't important there unless you are comparing kc between different tree sequences and we can't detect that.

@benjeffery

Copy link
Copy Markdown
Member Author

@Mergifyio rebase

@mergify

mergify Bot commented Oct 6, 2021

Copy link
Copy Markdown
Contributor

Command rebase: success

Branch has been successfully rebased

@benjeffery
benjeffery marked this pull request as draft October 6, 2021 11:09
@codecov

codecov Bot commented Oct 6, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #1760 (5d209dd) into main (f00171d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 5d209dd differs from pull request most recent head 55ecfaf. Consider uploading reports for the commit 55ecfaf to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1760   +/-   ##
=======================================
  Coverage   93.35%   93.36%           
=======================================
  Files          27       27           
  Lines       24485    24496   +11     
  Branches     1096     1096           
=======================================
+ Hits        22859    22870   +11     
  Misses       1591     1591           
  Partials       35       35           
Flag Coverage Δ
c-tests 92.09% <100.00%> (+<0.01%) ⬆️
lwt-tests 89.14% <ø> (ø)
python-c-tests 94.50% <ø> (ø)
python-tests 98.76% <ø> (ø)

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

Impacted Files Coverage Δ
c/tskit/core.h 100.00% <ø> (ø)
python/tskit/trees.py 97.84% <ø> (ø)
c/tskit/core.c 97.85% <100.00%> (+0.01%) ⬆️
c/tskit/trees.c 94.89% <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 f00171d...55ecfaf. Read the comment docs.

@jeromekelleher

Copy link
Copy Markdown
Member

Yeah, this is pretty much it @benjeffery I think. It would be good to add a private time_uncalibrated boolean to the tsk_treeseq_t struct though, which we set at init time, so that we don't have to do the tedious strcmping each time.

@benjeffery
benjeffery force-pushed the time_units_use_2 branch 3 times, most recently from 4c44fd4 to e5fcc2b Compare October 7, 2021 12:17
@benjeffery
benjeffery marked this pull request as ready for review October 7, 2021 12:18
@benjeffery

Copy link
Copy Markdown
Member Author

Tests sorted, should be good to go!

@benjeffery

Copy link
Copy Markdown
Member Author

Whoops, I've forgotten the error string and to test from python, back to draft.

@benjeffery
benjeffery marked this pull request as draft October 7, 2021 13:30

@jeromekelleher jeromekelleher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, just needs the same tests in the positive direction?

Comment thread c/tests/test_trees.c Resolved
@benjeffery
benjeffery marked this pull request as ready for review October 7, 2021 15:51
@benjeffery

Copy link
Copy Markdown
Member Author

Should be good to go now.

@jeromekelleher jeromekelleher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, just a stray arg left over from an earlier version I think

Comment thread python/tskit/trees.py Outdated
mode="site",
span_normalise=True,
polarised=False,
allow_uncalibrated=False,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this supposed to be here? I guess we should probably add the option to the Python API, but it'll be quite tedious putting the option in all the stats so maybe we should spin off a separate issue to discuss whether we want to do it? Anyway, we're not doing anything with this arg, so probably should be dropped for now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I haven't followed all of this, but other options for how we'd let people compute branch stats on uncalibrated trees would be:

  • provide a python way to change the time units
  • raise a warning instead of an error

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ah! Yes, I started coding this up, then thought that I don't think that we need this. It is easy to change the time_units from python via tables.time_units.

@jeromekelleher

Copy link
Copy Markdown
Member

Looks like this is being hit by #1762, I'll sort it out.

@mergify
mergify Bot merged commit a0d8424 into tskit-dev:main Oct 8, 2021
@jeromekelleher

Copy link
Copy Markdown
Member

Hmm, looks like mergify isn't requiring tests pass on 32 bit - maybe we should update the config?

@benjeffery
benjeffery deleted the time_units_use_2 branch October 8, 2021 10:59
@benjeffery

Copy link
Copy Markdown
Member Author

Hmm, looks like mergify isn't requiring tests pass on 32 bit - maybe we should update the config?

Gah, nasty oversight. Yes it should.

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 top-level "time_units" field

3 participants