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

feat: add RelativePosition instead of GridPosition #169

Merged
merged 20 commits into from
Jul 6, 2024

Conversation

tlambert03
Copy link
Member

when looking at #166, I realized that GridPosition is pretty much only there to represent the concept of some "offset" relative to an absolute position. This PR renames GridPosition to RelativePosition, and uses it more braodly

@tlambert03 tlambert03 requested a review from fdrgsp July 1, 2024 23:26
Copy link

codecov bot commented Jul 1, 2024

Codecov Report

Attention: Patch coverage is 96.15385% with 2 lines in your changes missing coverage. Please review.

Project coverage is 95.60%. Comparing base (c024a68) to head (886a57a).

Files Patch % Lines
src/useq/_position.py 92.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #169      +/-   ##
==========================================
- Coverage   95.65%   95.60%   -0.05%     
==========================================
  Files          15       15              
  Lines        1058     1069      +11     
==========================================
+ Hits         1012     1022      +10     
- Misses         46       47       +1     

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

@tlambert03
Copy link
Member Author

note @fdrgsp, this PR removes row/col from GridPosition, not for any particular reason, but that i realized it's not actually being used here anywhere... do you have thoughts on where if anywhere those were used?

@tlambert03
Copy link
Member Author

found it :)

________________________________________________________________________________
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pymmcore_widgets/_mda/_grid_widget.py", line 554, in _move_to_row_col
    if pos.row == row and pos.col == col:
       ^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pydantic/main.py", line 827, in __getattr__
    raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}')
AttributeError: 'RelativePosition' object has no attribute 'row'

@tlambert03
Copy link
Member Author

i added back row/col ... they're not actually used anywhere, so I'm tempted to remove them, but we can leave that for another discussion. I like how this unifies the concept of positions used across useq, so would like to get this in before release. have a look when you can @fdrgsp

@tlambert03 tlambert03 merged commit 69813f6 into pymmcore-plus:main Jul 6, 2024
22 checks passed
@tlambert03 tlambert03 deleted the relative-position branch July 6, 2024 11:49
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.

1 participant