Fix solution edges dropped during GEFF export when not in LinkDB#263
Merged
JoOkuma merged 2 commits intoroyerlab:mainfrom Mar 17, 2026
Merged
Conversation
The left join on LinkDB silently discards solution edges (from NodeDB.parent_id) that have no corresponding entry in the links table. This happens when annotators manually create parent-child connections (e.g. cell divisions) that weren't in the original candidate edge set. Changed the merge from "left" to "outer" so these edges are preserved, with weight filled to 0.0 for the newly added rows. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #263 +/- ##
=======================================
Coverage ? 83.07%
=======================================
Files ? 97
Lines ? 6221
Branches ? 0
=======================================
Hits ? 5168
Misses ? 1053
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
to_geff_from_databasesilently drops solution edges that exist inNodeDB.parent_idbut have no corresponding entry in theLinkDB(links) table.This happens because the export collects solution edges from
NodeDB.parent_id, then merges them onto theLinkDBedges using a left join on(source_id, target_id). Since the left join is anchored onLinkDB, any solution edge without a matching link row is discarded.When it fails
This affects any workflow where an annotator manually creates a parent-child connection that wasn't in the original candidate edge set. The most common case is cell divisions: when an annotator connects a mother cell to a second daughter, this new edge exists only in
NodeDB.parent_idand not inLinkDB. The exported GEFF file will be missing that edge, so the division is lost or appears as a regular track.Fix
Change the merge from
how="left"tohow="outer"so that solution edges not present inLinkDBare preserved in the output. Theweightcolumn is filled with0.0for these added edges since they have no candidate link weight.