Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1023 +/- ##
==========================================
+ Coverage 97.66% 97.67% +0.01%
==========================================
Files 159 160 +1
Lines 6560 6592 +32
==========================================
+ Hits 6407 6439 +32
Misses 153 153 ☔ View full report in Codecov by Sentry. |
DominicOram
left a comment
There was a problem hiding this comment.
Thanks! Some comments but no showstoppers
| # NOTE Warn but don't fail | ||
| LOGGER.warning( | ||
| f"{self.hutch_request} is not the hutch in use. Shutter will not be operated." | ||
| ) |
There was a problem hiding this comment.
So this is a warning not an error so that you can test plans on the beamline whilst the other shutter is in use? I think this is probably another use case for #754?
Could: Maybe we should have a flag called TEST_MODE where it will fail here loudly if not in that mode? Like the undulator does
There was a problem hiding this comment.
Yes, definitely a use case. Although I would add that the general HutchShutter device should also have a TEST_MODE flag to be able to still use code in order to be able to test on machine days - run into this problem testing last week on i24, and it would be applicable to I19 as well, independently of the hutch in use...
| def __init__(self, prefix: str, hutch: HutchState, name: str = "") -> None: | ||
| self.shutter = HutchShutter(prefix=prefix, name=name) | ||
| bl_prefix = prefix.split("-")[0] | ||
| self.hutch_state = epics_signal_r(str, f"{bl_prefix}-OP-STAT-01:EHStatus.VALA") |
There was a problem hiding this comment.
Should: This should be of type HutchState
There was a problem hiding this comment.
Tried that in the first instance, but unfortunately the actual PV is not an Enum and it wouldn't connect...
| @AsyncStatus.wrap | ||
| async def set(self, value: ShutterDemand): | ||
| hutch_in_use = await self.hutch_state.get_value() | ||
| LOGGER.info(f"Current hutch in use: {hutch_in_use}") |
There was a problem hiding this comment.
Could: Do we know what invalid means? Is there a way to get out of the invalid state? If we know what action needs to be taken sometimes it's useful to put it in e.g. "Contact X group"
There was a problem hiding this comment.
So far I have only seen "INVALID" when the beampipe between the two hutches is not correctly placed, although I am sure there may be more. I can add a message for that for now and add to it as I find the use cases
Co-authored-by: Dominic Oram <dominic.oram@diamond.ac.uk>
Fixes #1020
Instructions to reviewer on how to test:
Checks for reviewer
dodal connect ${BEAMLINE}