Skip to content

97 task write trails velocity feature functions detect hesitations correct#117

Merged
cgmaiorano merged 27 commits into
mainfrom
97-task-write-trails-velocity-feature-functions-detect_hesitations_correct
Feb 16, 2026
Merged

97 task write trails velocity feature functions detect hesitations correct#117
cgmaiorano merged 27 commits into
mainfrom
97-task-write-trails-velocity-feature-functions-detect_hesitations_correct

Conversation

@cgmaiorano
Copy link
Copy Markdown
Collaborator

This pr completes #97 and #98

detect_hesitations is a classmethod that defines a hesitation as any period where the velocity falls below a certain threshold, which is determined by the specified percentile of the velocity distribution. It counts the number of distinct hesitation periods and adds 1 if the line starts with a hesitation. It also calculates the total duration of hesitations based on the number of points that fall below the threshold and the time interval between points.

@cgmaiorano cgmaiorano linked an issue Feb 10, 2026 that may be closed by this pull request
2 tasks
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.61%. Comparing base (bb3af88) to head (793d2bf).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #117      +/-   ##
==========================================
+ Coverage   98.59%   98.61%   +0.01%     
==========================================
  Files          19       19              
  Lines        1067     1080      +13     
==========================================
+ Hits         1052     1065      +13     
  Misses         15       15              

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

@cgmaiorano cgmaiorano marked this pull request as ready for review February 10, 2026 20:13
Copy link
Copy Markdown
Collaborator

@Asanto32 Asanto32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just some documentation fixes, and resolving issues in models and test that came from the merge (old version)

Comment thread src/graphomotor/core/models.py
Comment thread src/graphomotor/core/models.py Outdated
Comment thread src/graphomotor/core/models.py
Comment thread src/graphomotor/core/models.py Outdated
Comment thread src/graphomotor/core/models.py Outdated
hesitations = self.velocities < threshold

hesitation_changes = np.diff(hesitations.astype(int))
hesitation_starts = np.where(hesitation_changes == 1)[0] + 1
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the +1 for? I would assume the +1 for the start is covered by the if statement below?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 handles when the linesegment starts with a hesitation

Comment thread src/graphomotor/core/models.py Outdated
Comment thread src/graphomotor/core/models.py
Comment thread tests/unit/test_models.py Outdated
Comment thread tests/unit/test_models.py Outdated
@cgmaiorano cgmaiorano requested a review from Asanto32 February 16, 2026 14:54
Copy link
Copy Markdown
Collaborator

@Asanto32 Asanto32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just see the change to hesitation_count computation I suggested

Comment thread src/graphomotor/core/models.py Outdated
cgmaiorano and others added 2 commits February 16, 2026 14:40
Co-authored-by: Adam Santorelli <148909356+Asanto32@users.noreply.github.com>
@cgmaiorano cgmaiorano merged commit f8a3e1d into main Feb 16, 2026
24 checks passed
@cgmaiorano cgmaiorano deleted the 97-task-write-trails-velocity-feature-functions-detect_hesitations_correct branch February 16, 2026 19:46
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.

Task: write trails velocity feature functions: detect_hesitations

2 participants