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

949 make ophyd devices for the diagonstics for i10 #960

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

Relm-Arrowny
Copy link
Contributor

@Relm-Arrowny Relm-Arrowny commented Dec 13, 2024

Fixes #949

Instructions to reviewer on how to test:

  1. Pass test.
  2. Check connection.

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}

@Relm-Arrowny Relm-Arrowny linked an issue Dec 13, 2024 that may be closed by this pull request
2 tasks
Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 97.81022% with 3 lines in your changes missing coverage. Please review.

Project coverage is 97.68%. Comparing base (5893821) to head (834ccc3).

Files with missing lines Patch % Lines
src/dodal/devices/i10/diagnostics.py 96.73% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #960      +/-   ##
==========================================
- Coverage   97.69%   97.68%   -0.01%     
==========================================
  Files         160      161       +1     
  Lines        6635     6747     +112     
==========================================
+ Hits         6482     6591     +109     
- Misses        153      156       +3     

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

@Relm-Arrowny Relm-Arrowny marked this pull request as ready for review December 17, 2024 10:55
@Relm-Arrowny Relm-Arrowny requested a review from a team as a code owner December 17, 2024 10:55
Comment on lines +123 to +125
"""This is the standard webcam that can be found in ophyd_async
with four extra centroid signal. There is also a change in data_type due to it being
an older/different model"""
Copy link
Contributor

Choose a reason for hiding this comment

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

I would like @coretl's opinion on this approach, whether we should make a configurable "super detector" in ophyd-async or accept variations like these

Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be rolled into ophyd-async AravisDetector. Since bluesky/ophyd-async#606 this should now be possible. We pass stats as a plugin to the init. I'm unsure why the datatype change was needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue for datatype is without changing it I with get the follow error as datatype is strict enum drv: NotConnected: data_type: TypeError: BL10I-DI-PHDGN-01:DCAM:CAM:DataType_RBV has choices ('UInt8', 'UInt16'), but <enum 'ADBaseDataType'> requested ['Int8', 'UInt8', 'Int16', 'UInt16', 'Int32', 'UInt32', 'Int64', 'UInt64', 'Float32', 'Float64'] to be strictly equal to them.

Copy link
Contributor

@DominicOram DominicOram 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! I've added a bunch of suggestions based on how I would do a similar device in MX but obviously I don't know your usecase so feel free to reject suggestions if they don't work for you. Do you have some example plans that use the devices? I was expecting to see some in https://github.com/DiamondLightSource/i10-bluesky but couldn't, maybe I'm just missing them.

@@ -20,7 +26,38 @@ def __init__(self, prefix: str, name: str = "") -> None:
)


class BladeDrainCurrents(Device):
""" "The drain current measurements on each blade."""
Copy link
Contributor

Choose a reason for hiding this comment

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

@DiamondLightSource/bluesky-reviewers could someone from core weigh in on this? If they agree I will add the statement to https://diamondlightsource.github.io/dodal/main/reference/device-standards.html

Could: Presumably there is a lookup table or equation that takes the drain current and converts it to flux? In MX we have tried to have the ophyd device interface be the things that are scientifically interesting, rather than hardware implementation details. So in this case I would put the conversion in the device itself and have soft signals that are flux. Even better, I would try and get this pushed into the EPICS layer, particularly if the look up table rarely changes.

The reason for having scientific terms in ophyd devices is that when I read() the device these values are what come out into documents and ultimately get put in the nexus file/LIMS. If we need to do the conversion to flux we now need to do this downstream in multiple places rather than here in one.

This is likely a big-ish job so for now (assuming a core person agrees) can you just make the issue to track it?

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.

Make Ophyd devices for the Diagonstics for i10
4 participants