tskit-dev / tskit

Population-scale genomics
MIT License
147 stars 69 forks source link

Add 'mid' property to Interval class #2960

Open currocam opened 2 weeks ago

currocam commented 2 weeks ago

Description

Add mid property to the Interval and Tree class, as requested in #2903

PR Checklist:

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 86.65%. Comparing base (d3c59ba) to head (a55d4c0).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2960 +/- ## ========================================== - Coverage 89.63% 86.65% -2.98% ========================================== Files 29 11 -18 Lines 30176 22932 -7244 Branches 5877 4254 -1623 ========================================== - Hits 27047 19872 -7175 + Misses 1790 1754 -36 + Partials 1339 1306 -33 ``` | [Flag](https://app.codecov.io/gh/tskit-dev/tskit/pull/2960/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tskit-dev) | Coverage Δ | | |---|---|---| | [c-tests](https://app.codecov.io/gh/tskit-dev/tskit/pull/2960/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tskit-dev) | `86.20% <ø> (ø)` | | | [lwt-tests](https://app.codecov.io/gh/tskit-dev/tskit/pull/2960/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tskit-dev) | `80.78% <ø> (ø)` | | | [python-c-tests](https://app.codecov.io/gh/tskit-dev/tskit/pull/2960/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tskit-dev) | `88.72% <ø> (ø)` | | | [python-tests](https://app.codecov.io/gh/tskit-dev/tskit/pull/2960/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tskit-dev) | `?` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tskit-dev#carryforward-flags-in-the-pull-request-comment) to find out more. [see 18 files with indirect coverage changes](https://app.codecov.io/gh/tskit-dev/tskit/pull/2960/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tskit-dev)
currocam commented 2 weeks ago

ci/circleci: build-32 and codecov/project don't pass, but I don't know how those errors are related with my PR

petrelharp commented 2 weeks ago

Hm - well, there's currently just one test, but two methods added (although one calls the other). Perhaps add another test for the Interval property (so it is tested autonomously)? The CI failures might be just transient.

currocam commented 2 weeks ago

Hi, I just added the second test! Thank you for reviewing the changes

And for making such amazing piece of software! I've used a lot doing my master's thesis and I hope I will keep doing after I finish :)

jeromekelleher commented 2 weeks ago

Looks like you have a few lint issues that need to be fixed also.

jeromekelleher commented 2 weeks ago

Thanks @currocam! It's probably worth installing pre-commit, following the dev docs here. (pre-commit install, should do it).

It would be good to rebase and squash the commits also, as this is a small change. This guide may be helpful.

currocam commented 2 weeks ago

Hi! Thank you very much! I was in fact in the process of install pre-commit, thanks for pointing that out!

jeromekelleher commented 2 weeks ago

Great, looks ready to merge 👍

benjeffery commented 1 week ago

@mergifyio rebase

mergify[bot] commented 1 week ago

rebase

☑️ Nothing to do

- [ ] `-conflict` [📌 rebase requirement] - [X] `-closed` [📌 rebase requirement] - [X] `queue-position=-1` [📌 rebase requirement] - [X] any of: - [X] `#commits-behind>0` [📌 rebase requirement] - [ ] `#commits>1` [📌 rebase requirement] - [ ] `-linear-history` [📌 rebase requirement]