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

Allow multi-sample tips for Tree.draw_svg() #3010

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

hyanwong
Copy link
Member

@hyanwong hyanwong commented Oct 7, 2024

As discussed with @benjeffery, these are induced by passing a different (postorder) list as the order parameter. This additional use of "order" is deliberately not documented. Here's an example:

Screenshot 2024-10-07 at 15 28 01

The stored SVGs have changed because as part of the refactoring I properly rounded some floating point values, so now e.g. positions like 7.0 are stored as simply 7 in the SVG, for clarity and efficiency.

@hyanwong
Copy link
Member Author

hyanwong commented Oct 7, 2024

Note that this should allow us to e.g. collapse clades containing all non-tracked nodes. I will follow up with another PR to deal with large untracked polytomies.

Copy link

codecov bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 98.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 89.82%. Comparing base (2b18c5c) to head (a54f16e).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
python/tskit/drawing.py 98.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3010   +/-   ##
=======================================
  Coverage   89.82%   89.82%           
=======================================
  Files          29       29           
  Lines       31986    32030   +44     
  Branches     6197     6207   +10     
=======================================
+ Hits        28730    28772   +42     
  Misses       1859     1859           
- Partials     1397     1399    +2     
Flag Coverage Δ
c-tests 86.69% <ø> (ø)
lwt-tests 80.78% <ø> (ø)
python-c-tests 89.05% <ø> (ø)
python-tests 99.02% <98.00%> (-0.03%) ⬇️

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

Files with missing lines Coverage Δ
python/tskit/trees.py 98.80% <ø> (ø)
python/tskit/drawing.py 99.35% <98.00%> (-0.15%) ⬇️

@hyanwong hyanwong force-pushed the multi-sample-tips branch 2 times, most recently from 4bb3779 to b2f59f3 Compare October 7, 2024 15:32
@hyanwong hyanwong mentioned this pull request Oct 7, 2024
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, just need to cover a missed error condition if poss

node_x_coord[c] for c in self.tree.children(u) if c in node_x_coord
]
if len(child_coords) == 0:
raise ValueError(
Copy link
Member

Choose a reason for hiding this comment

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

Should try to cover this if possible

@benjeffery benjeffery added this to the Python 0.5.9 milestone Oct 8, 2024
@hyanwong hyanwong force-pushed the multi-sample-tips branch 2 times, most recently from 9d2965b to 0f4dc43 Compare October 8, 2024 10:51
…ferent postorder

This additional use of "order" is deliberately not documented.
@benjeffery benjeffery added the AUTOMERGE-REQUESTED Ask Mergify to merge this PR label Oct 8, 2024
@mergify mergify bot merged commit 586a81e into tskit-dev:main Oct 8, 2024
21 checks passed
@mergify mergify bot removed the AUTOMERGE-REQUESTED Ask Mergify to merge this PR label Oct 8, 2024
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.

3 participants