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

Create util for caching positions before a plan and returning to them afterwards #653

Merged
merged 11 commits into from
Jul 24, 2024

Conversation

DominicOram
Copy link
Contributor

@DominicOram DominicOram commented Jun 28, 2024

Fixes DiamondLightSource/hyperion#1439

Instructions to reviewer on how to test:

  1. Confirm unit tests pass

Checks for reviewer

  • Would the PR title make sense to a scientist on a set of release notes
  • If a new device has been added does it follow the standards
  • If changing the API for a pre-existing device, ensure that any beamlines using this device have updated their Bluesky plans accordingly
  • Have the connection tests for the relevant beamline(s) been run via dodal connect ${BEAMLINE}

@DominicOram DominicOram changed the title Hyperion 1439 cache lower gonio Create util for caching positions before a plan and returning to them afterwards Jun 28, 2024
@DominicOram DominicOram marked this pull request as ready for review July 18, 2024 13:52
Copy link
Collaborator

@dperl-dls dperl-dls left a comment

Choose a reason for hiding this comment

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

This looks very useful but I'm not 100% convinced about the API, I think with a minor tweak which in some ways is simpler it could be more useful still

def home_and_reset_wrapper(
plan: MsgGenerator,
device: Device,
home_position: float,
Copy link
Collaborator

Choose a reason for hiding this comment

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

are we likely to ever have this not be 0, and if it is ever not 0 isn't it then likely to be different for every motor?

how would you feel about this instead taking a list of motors, and a list of homes or default to 0 for everything?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link

codecov bot commented Jul 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.24%. Comparing base (061e59b) to head (06fd6d1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #653      +/-   ##
==========================================
+ Coverage   94.16%   94.24%   +0.07%     
==========================================
  Files         108      110       +2     
  Lines        4305     4360      +55     
==========================================
+ Hits         4054     4109      +55     
  Misses        251      251              

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

Copy link
Collaborator

@dperl-dls dperl-dls left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@DominicOram DominicOram merged commit f0ee17a into main Jul 24, 2024
18 checks passed
@DominicOram DominicOram deleted the hyperion_1439_cache_lower_gonio branch July 24, 2024 10:41
stan-dot pushed a commit that referenced this pull request Jul 24, 2024
… afterwards (#653)

* Added wrapper to home and reset to cache, also moved patch_motor to more easily accessible place

* Made the API for the caching and moving wrapper more generic
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.

Save and restore lower gonio poisitions before/after robot load
2 participants