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

Fix getting expected images from a gridscan #1035

Merged
merged 4 commits into from
Feb 4, 2025

Conversation

DominicOram
Copy link
Contributor

Fixes DiamondLightSource/mx-bluesky#777

Instructions to reviewer on how to test:

  1. Confirm modified test fails on main but passes here

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 requested a review from a team as a code owner February 4, 2025 09:40
Copy link

codecov bot commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.63%. Comparing base (b628f8c) to head (faf779b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1035      +/-   ##
==========================================
- Coverage   97.63%   97.63%   -0.01%     
==========================================
  Files         159      159              
  Lines        6564     6560       -4     
==========================================
- Hits         6409     6405       -4     
  Misses        155      155              

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

Copy link
Contributor

@callumforrester callumforrester left a comment

Choose a reason for hiding this comment

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

Looks good to me, I was just looking for something like create_hardware_backed_soft_signal

Comment on lines 233 to 235
x = await self.x_steps.get_value()
y = await self.y_steps.get_value()
z = await self.z_steps.get_value()
Copy link
Contributor

Choose a reason for hiding this comment

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

Could: Can this be parallelized? If not then may be worth putting a comment explaining why to avoid tripping someone up in future.

Suggested change
x = await self.x_steps.get_value()
y = await self.y_steps.get_value()
z = await self.z_steps.get_value()
x, y, z = await asyncio.gather(self.x_steps.get_value(), self.y_steps.get_value(), self.z_steps.get_value()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it can be parallelised. I have tended not to bother with parallel reads because they're normally very short anyway but I will add it in.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough, my concern is mainly that someone in the future might wonder why it wasn't done and go down an archaeological rabbit hole.

@DominicOram
Copy link
Contributor Author

Looks good to me, I was just looking for something like create_hardware_backed_soft_signal

There's some documentation about it here. I think I might add the words derived signal to that though as it's not that searchable. Worth noting some of the caveats with it from bluesky/ophyd-async#525. Namely it doesn't work in the case of subscribe. It would be good to get a cleaner solution into ophyd-async

@DominicOram DominicOram merged commit 80d3586 into main Feb 4, 2025
19 checks passed
@DominicOram DominicOram deleted the mx_bluesky_77_exped_images_wrong branch February 4, 2025 12:02
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.

Occasional odd message from check_topup
2 participants