Skip to content

fix: respect multi-axis pos_attr when segmentation is present#188

Merged
TeunHuijben merged 3 commits intov2-devfrom
fix-postion-key
Apr 3, 2026
Merged

fix: respect multi-axis pos_attr when segmentation is present#188
TeunHuijben merged 3 commits intov2-devfrom
fix-postion-key

Conversation

@TeunHuijben
Copy link
Copy Markdown
Collaborator

When pos_attr was passed as a list (e.g. ['z', 'y', 'x']) to Tracks/SolutionTracks alongside segmentation data, the user-specified position key was silently ignored. Two bugs caused this:

  • _get_feature_set() only handled pos_attr inside an if self.segmentation is None block, so multi-axis positions were never registered when segmentation was present.
  • _setup_core_computed_features() unconditionally overwrote features.position_key with the RegionpropsAnnotator default ("pos"), discarding any value set earlier.

Fix: move multi-axis pos_attr handling outside the segmentation guard (since those columns are always static/pre-existing on nodes), and guard the annotator assignment with if self.features.position_key is None

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.96%. Comparing base (055f446) to head (ea3747e).
⚠️ Report is 7 commits behind head on v2-dev.

Additional details and impacted files
@@           Coverage Diff           @@
##           v2-dev     #188   +/-   ##
=======================================
  Coverage   92.96%   92.96%           
=======================================
  Files          59       59           
  Lines        3268     3269    +1     
=======================================
+ Hits         3038     3039    +1     
  Misses        230      230           

☔ 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
Copy link
Copy Markdown
Contributor

Is this a problem on main too?

@TeunHuijben
Copy link
Copy Markdown
Collaborator Author

I think it is, but only surfaces when I was loading external graphs that had x/y/z/pos columns and I didn't want to use the pos column

@TeunHuijben TeunHuijben marked this pull request as ready for review April 2, 2026 22:43
@TeunHuijben TeunHuijben merged commit ef2d9df into v2-dev Apr 3, 2026
30 checks passed
@TeunHuijben TeunHuijben deleted the fix-postion-key branch April 3, 2026 17:22
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.

2 participants