From 1f7da38fa41f0e6cced21d8d55c0e4ed3fe5c8ec Mon Sep 17 00:00:00 2001 From: Mark Wolfman Date: Thu, 5 Dec 2024 18:43:05 -0600 Subject: [PATCH] Converted ophyd enum types to uppercase. --- src/haven/devices/srs570.py | 34 +++++++++++++++++----------------- src/haven/positioner.py | 4 ++-- src/haven/tests/test_srs570.py | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/haven/devices/srs570.py b/src/haven/devices/srs570.py index c189dd5f..f41e4a36 100644 --- a/src/haven/devices/srs570.py +++ b/src/haven/devices/srs570.py @@ -302,27 +302,27 @@ class GainMode(StrictEnum): LOW_DRIFT = "LOW DRIFT" class SensValue(StrictEnum): - _1 = "1" - _2 = "2" - _5 = "5" - _10 = "10" - _20 = "20" - _50 = "50" - _100 = "100" - _200 = "200" - _500 = "500" + ONE = "1" + TWO = "2" + FIVE = "5" + TEN = "10" + TWENTY = "20" + FIFTY = "50" + ONE_HUNDRED = "100" + TWO_HUNDRED = "200" + FIVE_HUNDRED = "500" class SensUnit(StrictEnum): - pA_V = "pA/V" - nA_V = "nA/V" - uA_V = "uA/V" - mA_V = "mA/V" + PICOAMP_PER_VOLT = "pA/V" + NANOAMP_PER_VOLT = "nA/V" + MICROAMP_PER_VOLT = "uA/V" + MILLIAMP_PER_VOLT = "mA/V" class OffsetUnit(StrictEnum): - pA = "pA" - nA = "nA" - uA = "uA" - mA = "mA" + PICOAMP = "pA" + NANOAMP = "nA" + MICROAMP = "uA" + MILLIAMP = "mA" def __init__(self, prefix: str, name: str = ""): """ diff --git a/src/haven/positioner.py b/src/haven/positioner.py index e5e9e5e2..6d357c67 100644 --- a/src/haven/positioner.py +++ b/src/haven/positioner.py @@ -54,10 +54,10 @@ def __init__( self.put_complete = put_complete super().__init__(name=name) - def set_name(self, name: str): + def set_name(self, name: str, *args, **kwargs): super().set_name(name) # Readback should be named the same as its parent in read() - self.readback.set_name(name) + self.readback.set_name(name, *args, **kwargs) def watch_done( self, value, done_event: asyncio.Event, started_event: asyncio.Event diff --git a/src/haven/tests/test_srs570.py b/src/haven/tests/test_srs570.py index 8feef2dd..0b34873d 100644 --- a/src/haven/tests/test_srs570.py +++ b/src/haven/tests/test_srs570.py @@ -112,7 +112,7 @@ async def preamp(): async def test_preamp_signals(preamp): # Check the enums - await preamp.sensitivity_value.set(SRS570PreAmplifier.SensValue._5) + await preamp.sensitivity_value.set(SRS570PreAmplifier.SensValue.FIVE) @pytest.mark.parametrize("gain_mode", gain_modes)