From 9ba6a963ac6ac53be713971a2e632ab89b8cec55 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 9 Dec 2022 14:38:10 -0500 Subject: [PATCH 1/3] MNT: account for flake8 6 --- setup.cfg | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 85b8a5eae..2bd69c1f2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -82,9 +82,12 @@ max-line-length = 115 extend-ignore = W504, W503, - E203, # See https://github.com/PyCQA/pycodestyle/issues/373 - F811, # support typing.overload decorator - F722, # allow Annotated[typ, some_func("some string")] + # See https://github.com/PyCQA/pycodestyle/issues/373 + E203, + # support typing.overload decorator + F811, + # allow Annotated[typ, some_func("some string")] + F722, exclude = ui_* .tox From 5789fa0c32c9f159960680d56d98609007ca7304 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 9 Dec 2022 14:38:51 -0500 Subject: [PATCH 2/3] ENH: give SynAxis a nice repr --- ophyd/sim.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ophyd/sim.py b/ophyd/sim.py index 632fbecc4..a990cc3f6 100644 --- a/ophyd/sim.py +++ b/ophyd/sim.py @@ -88,6 +88,7 @@ def get(self, *, as_string=True, **kwargs): def describe(self): desc = super().describe() desc[self.name]["enum_strs"] = self._enum_strs + return desc @@ -424,6 +425,9 @@ class SynAxis(Device): SUB_READBACK = "readback" _default_sub = SUB_READBACK + def __repr__(self): + return f"{self.__class__.__name__}(name={self.name!r})" + def __init__( self, *, From 52b199d289bd246d559f52a8153c4915d1e6a94b Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 9 Dec 2022 14:39:58 -0500 Subject: [PATCH 3/3] FIX: force EnumSignal to claim to be a string closes #1083 --- ophyd/sim.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ophyd/sim.py b/ophyd/sim.py index a990cc3f6..28244621e 100644 --- a/ophyd/sim.py +++ b/ophyd/sim.py @@ -88,7 +88,7 @@ def get(self, *, as_string=True, **kwargs): def describe(self): desc = super().describe() desc[self.name]["enum_strs"] = self._enum_strs - + desc[self.name]['dtype'] = 'string' return desc