Skip to content

Comments

Solved incorrect nodes positions and figure size in tree graph#87

Merged
leoguignard merged 7 commits intov3.xfrom
uniform_tree2
Sep 8, 2025
Merged

Solved incorrect nodes positions and figure size in tree graph#87
leoguignard merged 7 commits intov3.xfrom
uniform_tree2

Conversation

@jules-vanaret
Copy link
Contributor

This PR solves 2 problems:

  • In plot_all_lineages, the figure grid is initialized with 2 lines by default, even if a single lineage is present. In that case, this leads to a figure with an incompressible white space below the lineage graph.
  • The lineage graphs assigned incorrect depths (vertical positions) to the nodes. Mother and daughters nodes are at the same depth, and some leaf nodes are not reachable in the GUI even when the napari time slider is put to its maximum value.

Both problems can be seen using the following code:

from lineagetree import LineageTree
succs = {
    0: [1],
    1: [2],
    2: [3, 4],
    3: [5],
    5: [6],
    6: [],
    4: [7, 8],
    7: [9],
    9: [10],
    10: [],
    8: [11],
    11: [],
}
lt = LineageTree(successor=succs)
import matplotlib.pyplot as plt
lt.plot_all_lineages()
plt.show()

Results can be seen here:
pr_tree2

@codecov
Copy link

codecov bot commented Sep 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.43%. Comparing base (c431355) to head (b29f4f4).
⚠️ Report is 8 commits behind head on v3.x.

Additional details and impacted files
@@            Coverage Diff             @@
##             v3.x      #87      +/-   ##
==========================================
+ Coverage   86.40%   86.43%   +0.03%     
==========================================
  Files          20       20              
  Lines        1788     1792       +4     
==========================================
+ Hits         1545     1549       +4     
  Misses        243      243              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leoguignard leoguignard merged commit b523c46 into v3.x Sep 8, 2025
3 checks passed
@jules-vanaret jules-vanaret deleted the uniform_tree2 branch September 8, 2025 19:13
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.

2 participants