Skip to content

stop auto-computing area#208

Open
TeunHuijben wants to merge 1 commit intomainfrom
stop-autocompute-area
Open

stop auto-computing area#208
TeunHuijben wants to merge 1 commit intomainfrom
stop-autocompute-area

Conversation

@TeunHuijben
Copy link
Copy Markdown
Collaborator

The problem: The original code auto-computed area from scratch on Tracks initialization (if it wasn't already on the graph nodes). Commenting out the core_computed_features.append("area") line entirely broke the case where area was already on the graph — it would no longer be registered in tracks.features or activated in the annotator.

The fix: Replace the single list with a list of (key, compute_if_missing) tuples. area gets compute_if_missing=False, meaning:

  • If area is already on the graph → activated and added to tracks.features (backward compat for files that have area)
  • If area is not on the graph → skipped; caller must use enable_features(["area"]) explicitly
# (key, compute_if_missing) pairs
core_features: list[tuple[str, bool]] = []
...
core_features.append((pos_key, True))
core_features.append(("area", False))   # activate if present, never compute from scratch
...
for key, compute_if_missing in core_features:
    if self._check_existing_feature(key):
        ...
        self.annotators.activate_features([key])
    elif compute_if_missing:
        self.enable_features([key])

Closes #193

@TeunHuijben
Copy link
Copy Markdown
Collaborator Author

TeunHuijben commented Apr 24, 2026

@cmalinmayor, does this answer your original comment:

This is our opportunity to stop auto-computing area as a special backward compatible feature - just worth considering before we release, not necessary to merge this PR

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.35%. Comparing base (6d9c5a8) to head (4747b9f).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #208   +/-   ##
=======================================
  Coverage   93.35%   93.35%           
=======================================
  Files          59       59           
  Lines        3249     3250    +1     
=======================================
+ Hits         3033     3034    +1     
  Misses        216      216           

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

@TeunHuijben TeunHuijben marked this pull request as ready for review April 24, 2026 21:39
@TeunHuijben TeunHuijben added the ready for initial review PR ready for first review label May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for initial review PR ready for first review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracks._setup_core_computed_features: stop auto-computing area as special backward compatibility feature

1 participant