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: formalizing point-visiting strategies #177

Merged
merged 11 commits into from
Jul 8, 2024

Conversation

tlambert03
Copy link
Member

@tlambert03 tlambert03 commented Jul 8, 2024

adds

  • useq.TraversalOrder - to dictate how random points are traversed
  • addes a nearest neighbor and 2-opt algorithm, (for slightly better path choosing)
  • allows you to specify the starting index
  • adds plotting to all points plans:
import useq

pp = useq.RandomPoints(
    num_points=100,
    max_height=6000,
    max_width=6000,
    order=useq.TraversalOrder.TWO_OPT,
    random_seed=1,
    shape="rectangle",
    start_at=10,
    fov_height=300,
    fov_width=300,
    allow_overlap=False,
)
pp.plot()

two-opt:

Screenshot 2024-07-08 at 4 01 09 PM

nearest neighbor:
Screenshot 2024-07-08 at 4 01 34 PM

Copy link

codecov bot commented Jul 8, 2024

Codecov Report

Attention: Patch coverage is 74.07407% with 49 lines in your changes missing coverage. Please review.

Project coverage is 94.05%. Comparing base (19cc774) to head (1caaf46).

Files Patch % Lines
src/useq/_plot.py 0.00% 43 Missing ⚠️
src/useq/_grid.py 95.00% 2 Missing ⚠️
src/useq/_plate.py 0.00% 2 Missing ⚠️
src/useq/_position.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #177      +/-   ##
==========================================
- Coverage   95.90%   94.05%   -1.86%     
==========================================
  Files          16       18       +2     
  Lines        1075     1177     +102     
==========================================
+ Hits         1031     1107      +76     
- Misses         44       70      +26     

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

@tlambert03
Copy link
Member Author

this is going to temporarily break one of the new point plan selectors in pymmcore-widgets, because requires a max_width > 0

@tlambert03 tlambert03 merged commit fb1773e into pymmcore-plus:main Jul 8, 2024
21 of 22 checks passed
@tlambert03 tlambert03 deleted the visiting branch July 8, 2024 20:35
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