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

Allow OAV to Redis forwarder to use different OAV streams #808

Merged
merged 8 commits into from
Oct 14, 2024

Conversation

DominicOram
Copy link
Contributor

Needed for DiamondLightSource/mx-bluesky#511

Instructions to reviewer on how to test:

  1. Confirm tests still 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}

Copy link

codecov bot commented Sep 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.03%. Comparing base (9cb9596) to head (e169749).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #808   +/-   ##
=======================================
  Coverage   95.02%   95.03%           
=======================================
  Files         117      117           
  Lines        4765     4771    +6     
=======================================
+ Hits         4528     4534    +6     
  Misses        237      237           

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

Copy link
Collaborator

@olliesilvester olliesilvester left a comment

Choose a reason for hiding this comment

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

Looks okay, but can you confirm the streams are the right way round? The 'full screen' one looks smaller than 'roi' for me

Comment on lines 71 to 74
Source.FULL_SCREEN.value: epics_signal_r(
str, f"{prefix}MJPG:MJPG_URL_RBV"
),
Source.ROI.value: epics_signal_r(str, f"{prefix}XTAL:MJPG_URL_RBV"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looking at the stream links, the XTL is a larger image than the MPJG - are these definitely the right way round?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good spot! Thanks!

@@ -95,7 +110,8 @@ async def _get_frame_and_put_to_redis(self, response: ClientResponse):
async def _open_connection_and_do_function(
self, function_to_do: Callable[[ClientResponse, str | None], Awaitable]
):
stream_url = await self.stream_url.get_value()
source = await self.selected_source.get_value()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could: use asyncio.gather for consecutive reads

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think I can here because the read of stream_url needs the value from the read of source. asyncio.gather will try and read them in parallel

@DominicOram DominicOram merged commit 507f9ea into main Oct 14, 2024
18 checks passed
@DominicOram DominicOram deleted the mx_bluesky_511_murko_fixes branch October 14, 2024 13:25
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.

2 participants