-
Notifications
You must be signed in to change notification settings - Fork 8
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 a common base for attenuator #912
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #912 +/- ##
=======================================
Coverage 96.04% 96.04%
=======================================
Files 136 136
Lines 5639 5645 +6
=======================================
+ Hits 5416 5422 +6
Misses 223 223 ☔ View full report in Codecov by Sentry. |
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.
Thanks, a couple of comments
src/dodal/beamlines/i24.py
Outdated
def attenuator( | ||
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False | ||
) -> AttenuatorBase: | ||
"""Get a basic (without filter wheels) attenuator device for i24, instantiate it |
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.
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, but for the moment there's no filter wheel device (Made a ticket to write one #927 , which will also be needed soon for i19) and I24 doesn't need it at this stage... Beyond making it clearer in the comment that it's only temporary and will be added in the future I'm not sure what could be added here?
src/dodal/devices/attenuator_base.py
Outdated
class AttenuatorBase(StandardReadable): | ||
"""An attenuator base class with a minimum set of common PVs to phase1 beamlines.""" |
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: I think it's worth making clear here that the read transmission will be fractional i.e. 0-1 not a percentage
src/dodal/devices/attenuator_base.py
Outdated
self._desired_transmission = epics_signal_rw(float, prefix + "T2A:SETVAL1") | ||
self._use_current_energy = epics_signal_x(prefix + "E2WL:USECURRENTENERGY.PROC") |
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: Either this attenuator is only used for reading and we remove these PVs or we want to add the setting too, in which case AttenuatorBase
should have a set
.
If we're going to do setting as well I actually think you might be able to get away with exactly the same set
between the two. In the i24 case:
_filters_in_position
contains onlyBL24I-OP-ATTN-01:MP1:INPOS
andBL24I-OP-ATTN-01:MP2:INPOS
_calculated_filter_states
are soft signals that are all high_change
is a soft signal that's a no-op
If we don't do this in this issue can you put this in a new issue please?
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.
Made an issue here #928
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 it would be clearer about what's going on if we just reframe it all as read-only vs settable Attenuators. I've done this in #931, let me know what you think. Sorry to jump on it and re-write it but it seemed easier than trying to articulate what I meant
Fixes #889
Creates an AttenuatorBase with a minimum set of common PVs that beamline-specific devices can inherit from.
Used in MX_bluesky#627
Instructions to reviewer on how to test:
Checks for reviewer
dodal connect ${BEAMLINE}