Skip to content

Conversation

@BadPrograms
Copy link
Collaborator

Added a wanring if the graph cannot be calculated.


def get_gabriel_graph(lT: LineageTree, t: int) -> dict[int, set[int]]:
def get_gabriel_graph(
lT: LineageTree, t: int | None = None
Copy link
Member

Choose a reason for hiding this comment

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

I was expecting to have something like:

t: int | Iterable[int] | None = None

with something like that:

if t is None:
    t = lT.times
elif not isinstance(t, Iterable):
    t = [t]

for time in t:
    ... #compute gabriel graph

Comment on lines 76 to 78
if t and len(lT.time_nodes[t]) < 5:
warn("Need more than 5 timepoints")
return lT.Gabriel_graph
Copy link
Member

Choose a reason for hiding this comment

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

Here there is a small problem, you need at least nb dim + 2 points to compute the Delaunay triangulation so if the lineage tree is in 2D then only 4 points are necessary.

Second the reason why you need nb dim + 2 is that if you have nb dim + 1 or less the triangulation is trivial: each node is connected to each node. In that case wew should still return something

Comment on lines 80 to 84
if t is None:
with catch_warnings():
simplefilter("ignore")
for time in lT.time_nodes:
get_gabriel_graph(lT, time)
Copy link
Member

Choose a reason for hiding this comment

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

This is an ugly way of doing that. I don't think you should silence warnings in general.

@codecov
Copy link

codecov bot commented Jan 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.56%. Comparing base (7191355) to head (17920ff).
⚠️ Report is 5 commits behind head on v3.x.

Additional details and impacted files
@@            Coverage Diff             @@
##             v3.x     #102      +/-   ##
==========================================
+ Coverage   86.49%   86.56%   +0.07%     
==========================================
  Files          20       20              
  Lines        1821     1831      +10     
==========================================
+ Hits         1575     1585      +10     
  Misses        246      246              

☔ 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 a8fe5d3 into v3.x Jan 9, 2026
3 checks passed
@leoguignard leoguignard deleted the gabriel_graph_for_all_timepoints branch January 9, 2026 09:37
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