Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

13 unique label ids #25

Merged
merged 5 commits into from
Nov 27, 2024
Merged

13 unique label ids #25

merged 5 commits into from
Nov 27, 2024

Conversation

cmalinmayor
Copy link
Collaborator

Proposed Change

Use label ids as node ids in the candidate graph. This means that every label must have a unique id across time (and hypotheses). This PR adds a function to convert a segmentation with repeated labels to a segmentation with unique labels and changes the nodes from segmentation functions to use the label as the node id. All the test fixtures were updated to reflect this change.

Theoretically, the segmentation ID features is now redundant, since at graph creation we ensure that the node id matches the segmentation id. However, downstream code does not necessarily keep this invariant (e.g. if you relabel the segmentation, you don't necessarily [want to] relabel the node id, since this is essentially deleting the node and making a new one, along with updating all the incident edges). Therefore, for now, I left the segmentation ID in the graph, but it may be removed in the future once we examine downstream use cases.

Note: This is a breaking change (along with the multi-hypothesis API changes). We should update the major version after merging this PR, as all downstream code must be updated.

Checklist

Go through these things before merge. Actions should run automatically to test them, but for information on how to run locally, see CONTRIBUTING.md.

  • I have added tests that prove that my feature works in various situations or tests the bugfix (if applicable).
  • I have checked that the tests pass and I maintained or improved test coverage (if applicable).
  • I have written docstrings and checked that they render correctly in the documentation build.
  • I have checked that mypy type checking passes.

@cmalinmayor cmalinmayor linked an issue Nov 27, 2024 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.75%. Comparing base (4986526) to head (3a8489b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #25   +/-   ##
=======================================
  Coverage   87.75%   87.75%           
=======================================
  Files          14       14           
  Lines         449      449           
=======================================
  Hits          394      394           
  Misses         55       55           

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

@cmalinmayor cmalinmayor merged commit 6c337e4 into main Nov 27, 2024
4 checks passed
@cmalinmayor cmalinmayor deleted the 13-unique-label-ids branch November 27, 2024 17:57
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.

Relabel all input segmentations to have unique IDs across time
2 participants