-
Notifications
You must be signed in to change notification settings - Fork 12
Converting MX Beamlines to device manager #1788
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
base: main
Are you sure you want to change the base?
Conversation
5c175c7 to
4a05f61
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1788 +/- ##
==========================================
- Coverage 99.12% 99.09% -0.03%
==========================================
Files 283 283
Lines 10736 10745 +9
==========================================
+ Hits 10642 10648 +6
- Misses 94 97 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f65166e to
662aa54
Compare
f98b994 to
9bfbbc4
Compare
…amondLightSource/dodal into 1765-Convert_MX_to_new_device_manager
| """ | ||
| return OAVToRedisForwarder( | ||
| f"{PREFIX.beamline_prefix}-DI-OAV-01:", | ||
| oav_roi=oav(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be updated to pass oav in to avoid multiple instances
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree, and we should do the same for the full screen one. e.g.:
@devices.factory()
def oav_to_redis_forwarder(oav: OAVBeamCentrePV, oav_full_screen:OAVBeamCentrePV) -> OAVToRedisForwarder:
return OAVToRedisForwarder(
f"{PREFIX.beamline_prefix}-DI-OAV-01:",
oav_roi=oav,
oav_fs=oav_full_screen,
redis_host=RedisConstants.REDIS_HOST,
redis_password=RedisConstants.REDIS_PASSWORD,
redis_db=RedisConstants.MURKO_REDIS_DB,
)…amondLightSource/dodal into 1765-Convert_MX_to_new_device_manager
DominicOram
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you. A couple more comments
| """Get the i02-2 synchrotron device, instantiate it if it hasn't already been. | ||
| If this is called when already instantiated in i02-2, it will return the existing object. | ||
| """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should: We can remove this comment, and the one below, as we have done elsewhere
| ) | ||
| @devices.v1_init(EigerDetector, prefix="BL03I-EA-EIGER-01:", wait=False) | ||
| def eiger(eiger: EigerDetector) -> EigerDetector: | ||
| return eiger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must: You need to set the detector_id here, like we did for i03 (
dodal/src/dodal/beamlines/i03.py
Line 162 in 8b911e5
| eiger.detector_id = 78 |
beamline in the same way, though it's not as important
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be BL04I instead of BL03I?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good spot. In both here and in i03.py they should be:
@devices.v1_init(
EigerDetector, prefix=f"{PREFIX.beamline_prefix}-EA-EIGER-01:", wait=False
)| """ | ||
| return OAVToRedisForwarder( | ||
| f"{PREFIX.beamline_prefix}-DI-OAV-01:", | ||
| oav_roi=oav(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree, and we should do the same for the full screen one. e.g.:
@devices.factory()
def oav_to_redis_forwarder(oav: OAVBeamCentrePV, oav_full_screen:OAVBeamCentrePV) -> OAVToRedisForwarder:
return OAVToRedisForwarder(
f"{PREFIX.beamline_prefix}-DI-OAV-01:",
oav_roi=oav,
oav_fs=oav_full_screen,
redis_host=RedisConstants.REDIS_HOST,
redis_password=RedisConstants.REDIS_PASSWORD,
redis_db=RedisConstants.MURKO_REDIS_DB,
)|
|
||
|
|
||
| @device_factory( | ||
| skip=BL == "s04", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should: Now we're removing s04 from here can we also remove it from the dictionary in dodal/tests/conftest.py
| @device_factory() | ||
| @devices.factory() | ||
| def attenuator() -> EnumFilterAttenuator: | ||
| """Get a read-only attenuator device for i24, instantiate it if it hasn't already |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should: These comments, and others in this file, should be removed as they have been elsewhere
| """ | ||
| return Aperture( | ||
| f"{PREFIX.beamline_prefix}-AL-APTR-01:", | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could: Whilst we're here the formatting of a lot of these device instantiations is a bit odd. If we remove the trailing comma the save on format will make this one line. Same with many other devices in this file.
| # wait=wait_for_connection, | ||
| # fake=fake_with_ophyd_sim, | ||
| # post_create=set_params, | ||
| # ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should: This commented out code is now entirely wrong. I think we should delete it all.
Fixes #1765
Instructions to reviewer on how to test:
Checks for reviewer
dodal connect ${BEAMLINE}