-
Notifications
You must be signed in to change notification settings - Fork 0
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
add spatial error and unit test cases #255
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #255 +/- ##
==========================================
+ Coverage 90.01% 90.09% +0.08%
==========================================
Files 19 19
Lines 1602 1615 +13
==========================================
+ Hits 1442 1455 +13
Misses 160 160 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice, thanks! just some minor comments
docs/reference/statistics.rst
Outdated
:alt: Spatial Error is the distance from movement end point and the center of the target minus target' radius | ||
|
||
The cursor location at a timestamp is given by a pair of :math:`(x, y)` coordinates, | ||
where :math:`(0, 0)` corresponds to the center of the screen, and 1 in these units is equal to the screen height per second squared. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where :math:`(0, 0)` corresponds to the center of the screen, and 1 in these units is equal to the screen height per second squared. | |
where :math:`(0, 0)` corresponds to the center of the screen, and 1 in these units is equal to the screen height. |
src/vstt/stats.py
Outdated
end_point = mouse_position[-1] | ||
else: | ||
return 0 | ||
if xydist(end_point, target) >= target_radius: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To simplfy the logic & avoid duplication maybe something like this would be cleaner?:
if mouse_position.size < 1:
return 0
spatial_error = xydist(mouse_position[-1], target) - target_radius
return max(spatial_error, 0)
Quality Gate passedThe SonarCloud Quality Gate passed, but some issues were introduced. 1 New issue |
spatial error: the gap between the last point of the cursor movement path to the center of the target minus target radius.
PS: when the gap <= target radius, spatial error = 0