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

Feature/pix2deg-offset #906

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

OmerShubi
Copy link
Collaborator

Description

Fixes #534 - Adding center_offset to center_origin function and propagating it to pix2deg.

Implemented changes

The offset is implemented in the center_origin() function in pymovements.gaze.transforms.

The offset should be given in centimeters and is expected to be a tuple of floats with a zero default (center_offset: tuple[float, float] = (0, 0)). A positive value moves the origin to the left and down respectively.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change is or requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.
Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration

  • test offset in tests/unit/gaze/transforms/center_origin_test.py
  • test offset in tests/unit/gaze/transforms/pix2deg_test.py
  • test offset in tests/unit/gaze/gaze_transform_test.py

In all cases two additional tests where created, one where the origin is top left and the other center. An offset of (10,10) is applied.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (0a71116) to head (672127e).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #906   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           74        74           
  Lines         3419      3419           
  Branches       613       613           
=========================================
  Hits          3419      3419           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Add center offset argument to pix2deg()
1 participant