Skip to content

Improve error message when segmentation contains nodes not in graph #233

Description

@cmalinmayor

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:

  1. Detect when segmentation has IDs not in the graph
  2. Either warn and skip those IDs (if this is a valid use case), or
  3. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Future

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions