Skip to content
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

Merged
merged 5 commits into from
Jan 15, 2024
Merged

add spatial error and unit test cases #255

merged 5 commits into from
Jan 15, 2024

Conversation

ZoeJacky
Copy link
Collaborator

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

Copy link

codecov bot commented Nov 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (96270c0) 90.01% compared to head (0269177) 90.09%.

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.
📢 Have feedback on the report? Share it here.

Copy link
Member

@lkeegan lkeegan left a 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

: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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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.

end_point = mouse_position[-1]
else:
return 0
if xydist(end_point, target) >= target_radius:
Copy link
Member

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)

Copy link

sonarcloud bot commented Dec 18, 2023

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@ZoeJacky ZoeJacky merged commit 223d2cc into main Jan 15, 2024
15 checks passed
@ZoeJacky ZoeJacky deleted the spatial_error branch January 15, 2024 15:26
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