Skip to content

Conversation

@hyanwong
Copy link
Member

@hyanwong hyanwong commented Mar 3, 2021

Description

The first step to putting a y-axis on SVG plots.

Fixes #840

PR Checklist:

  • Tests that fully cover new/changed functionality.
  • Documentation including tutorial content if appropriate.
  • Changelogs, if there are API changes.

@hyanwong
Copy link
Member Author

hyanwong commented Mar 3, 2021

This took a bit of reworking to include mutations above the root. But worth sorting as this will impact implementing a Y-axis scale, which we can now do by looking at node_y_coord_map and mut_y_coord_map. We should first implement a Y-scale on trees, and then generalise to tree sequence. This PR also includes a few nice example plots in tests/data/svg, e.g. the following for jumbled sample nodes

Screenshot 2021-03-03 at 12 27 09

and this for a log time scale:

Screenshot 2021-03-03 at 12 27 30

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.

Looks good, although haven't delved into all the details. Getting full coverage in tests will be a faff.

@hyanwong hyanwong force-pushed the svg-mutation-times branch from bad2a19 to 342cb7b Compare March 3, 2021 12:46
@codecov
Copy link

codecov bot commented Mar 3, 2021

Codecov Report

Merging #1230 (3becc79) into main (8f5bf4f) will increase coverage by 0.01%.
The diff coverage is 97.82%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1230      +/-   ##
==========================================
+ Coverage   93.72%   93.74%   +0.01%     
==========================================
  Files          26       26              
  Lines       21532    21583      +51     
  Branches      909      921      +12     
==========================================
+ Hits        20181    20232      +51     
- Misses       1312     1313       +1     
+ Partials       39       38       -1     
Flag Coverage Δ
c-tests 92.50% <ø> (ø)
lwt-tests 92.97% <ø> (ø)
python-c-tests 94.93% <97.82%> (+0.02%) ⬆️
python-tests 98.63% <97.82%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
python/tskit/drawing.py 99.04% <97.82%> (+0.07%) ⬆️

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 8f5bf4f...3becc79. Read the comment docs.

@hyanwong
Copy link
Member Author

hyanwong commented Mar 3, 2021

Looks good, although haven't delved into all the details. Getting full coverage in tests will be a faff.

What extra coverage would you like? E.g. should we check that a mutation high above a root is still within the tree box, and that the root branch is long enough? You can see this in the example SVGs, but it's not explicitly checked, which would be sensible, I guess. I'm not sure what else would be useful. Perhaps an example from the WF simulator for some multi-root trees, especially if we can make the JukeCantor routine place mutations at defined times?

@jeromekelleher
Copy link
Member

My bad, looks like you have 100% coverage with the examples.

@hyanwong hyanwong force-pushed the svg-mutation-times branch from 342cb7b to 402119c Compare March 3, 2021 14:45
@hyanwong
Copy link
Member Author

hyanwong commented Mar 3, 2021

My bad, looks like you have 100% coverage with the examples.

OK, review comments done. Probably worth saving more extensive testing until we have y-scales, when it should be a bit more obvious where the mutations are, whether it's a log scale, etc. So maybe merge this if it's OK, and I'll get on with that.

@hyanwong hyanwong force-pushed the svg-mutation-times branch from 402119c to 2a14c14 Compare March 3, 2021 15:01
@hyanwong hyanwong force-pushed the svg-mutation-times branch from a427b2a to 3becc79 Compare March 3, 2021 15:23
@hyanwong
Copy link
Member Author

Rolled into #1236 too, so we could either close this PR and review all the changes together over there, or merge this first and rebase. Either is fine by me.

@jeromekelleher
Copy link
Member

Looks like a fair bit has changed in #1236, so will probably be reviewing twice if we go through it here too?

@hyanwong
Copy link
Member Author

Looks like a fair bit has changed in #1236, so will probably be reviewing twice if we go through it here too?

Yeah, closing.

@hyanwong hyanwong closed this Mar 10, 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.

draw_ methods ignore mutation_time

2 participants