Skip to content

Generic features! 🎉 #102

Merged
cmalinmayor merged 124 commits intomainfrom
2-feature-infrastructure
Oct 31, 2025
Merged

Generic features! 🎉 #102
cmalinmayor merged 124 commits intomainfrom
2-feature-infrastructure

Conversation

@cmalinmayor
Copy link
Copy Markdown
Contributor

@cmalinmayor cmalinmayor commented Oct 29, 2025

Attempted to deprecate rather than ruin backward compatibility, but definitely needs to be checked against the tracker.

cmalinmayor and others added 30 commits July 11, 2025 17:40
This matches our previous Tracks functionality by allowing either a single position attribute or a list of position attributes on the graph. Updated the json schema to specifically store the time and position rather than inferring them from location.
Constructs the feature set from the provided pos_attr, time_attr, and segmentation. Also deprecates using Tracks.time_attr and Tracks.pos_attr in favor of the tracks.features.time and tracks.features.position. However, only actually updates the references inside the Tracks class.
The references to pos_attr remain in the rest of the code base. Running the funtracks tests issues 98 warnings.
This enables removing references to tracks.time_attr and tracks.pos_attr from the SolutionTracks.
…r for Tracks

Also retains the ability to load tracks generated before the addition of the FeatureSet by passing the time_attr and pos_attr features into the constructor of Tracks.
…attr

This was done with the minimal disruption to the existing code. Therefore, I used feature.key to get the same strings that were used as keys in the actions before. A larger refactor will be needed to actually use the features as keys instead of strings, if we want to do that in the future.
I kept the implementation very minimal, but when we see what code is duplicated between implementations we can add it to the base class (e.g. setting the feature values, checking if features are present).
I changed the signature of the base annotator to take the Tracks at initialization (since we need to know if it's 2d or 3d to determine valid features). I also changed the signature of compute and update to not take the Tracks, and to compute for all features. We still need to find a way to let the user pick which regionprops features to compute, test them more thoroughly, and see if the API makes sense for other Annotators.
This does not necessarily include all features (intensity, num_pixels are missing), but it solidifies an API that covers all our use cases. The API may be streamlined when other annotators are implemented and when we incorporate it into the workflow.
Includes rewriting some of the geff export code to handle features better
Also creates the annotator module to avoid circular dependencies
@cmalinmayor cmalinmayor linked an issue Oct 29, 2025 that may be closed by this pull request
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 29, 2025

Codecov Report

❌ Patch coverage is 91.06529% with 78 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.92%. Comparing base (b6747e3) to head (99bb7b1).
⚠️ Report is 125 commits behind head on main.

Files with missing lines Patch % Lines
src/funtracks/data_model/tracks.py 84.25% 20 Missing ⚠️
src/funtracks/annotators/_regionprops_annotator.py 86.04% 12 Missing ⚠️
src/funtracks/data_model/graph_attributes.py 52.63% 9 Missing ⚠️
src/funtracks/data_model/solution_tracks.py 83.33% 6 Missing ⚠️
src/funtracks/actions/add_delete_node.py 88.57% 4 Missing ⚠️
src/funtracks/annotators/_annotator_registry.py 89.47% 4 Missing ⚠️
src/funtracks/annotators/_edge_annotator.py 94.52% 4 Missing ⚠️
src/funtracks/annotators/_track_annotator.py 96.94% 4 Missing ⚠️
src/funtracks/import_export/import_from_geff.py 85.71% 4 Missing ⚠️
src/funtracks/import_export/export_to_geff.py 86.36% 3 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #102      +/-   ##
==========================================
- Coverage   89.32%   88.92%   -0.41%     
==========================================
  Files          25       39      +14     
  Lines        1134     1742     +608     
==========================================
+ Hits         1013     1549     +536     
- Misses        121      193      +72     

☔ 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.

@cmalinmayor cmalinmayor marked this pull request as ready for review October 31, 2025 14:54
@cmalinmayor cmalinmayor merged commit 1529351 into main Oct 31, 2025
15 checks passed
@cmalinmayor cmalinmayor deleted the 2-feature-infrastructure branch October 31, 2025 14:55
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.

Create dynamic, generic Features

2 participants