Currently, when loading tracks where the segmentation contains node IDs that don't exist in the graph, the error message is unclear:
Failed to load tracks: object of type 'NoneType' has no len()
This happens when the graph is a subset of the segmentation, which can occur in valid scenarios:
- User manually tracked only some cells in the segmentation
- Tracking algorithm filtered certain objects (by size, confidence, etc.)
- User deleted some tracks from the graph but underlying segmentation still has those objects
Proposed improvement:
Instead of a cryptic NoneType error, the code should:
- Detect when segmentation has IDs not in the graph
- Either warn and skip those IDs (if this is a valid use case), or
- Provide a clear error message like "Segmentation contains node X which doesn't exist in the graph"
Context:
Discovered during testing of PR #231: #231 (comment)
Currently, when loading tracks where the segmentation contains node IDs that don't exist in the graph, the error message is unclear:
This happens when the graph is a subset of the segmentation, which can occur in valid scenarios:
Proposed improvement:
Instead of a cryptic NoneType error, the code should:
Context:
Discovered during testing of PR #231: #231 (comment)