From 73c636b46f35381ac0a82b99f9965612770ca6c1 Mon Sep 17 00:00:00 2001 From: appel_c Date: Wed, 3 Jul 2024 08:30:16 +0200 Subject: [PATCH] refactor: ensure temporary backward compatibility after API changes --- ophyd_devices/sim/sim_data.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/ophyd_devices/sim/sim_data.py b/ophyd_devices/sim/sim_data.py index 4314922..4ef5a0a 100644 --- a/ophyd_devices/sim/sim_data.py +++ b/ophyd_devices/sim/sim_data.py @@ -88,7 +88,16 @@ class SimulatedDataBase(ABC): - update_sim_state: update the simulated state of the device """ - USER_ACCESS = ["params", "select_model", "get_models", "show_all"] + # USER_ACCESS = ["params", "select_model", "get_models", "show_all"] + # TODO remove + USER_ACCESS = [ + "params", + "select_model", + "get_models", + "show_all", + "sim_select_model", + "sim_params", + ] def __init__(self, *args, parent=None, **kwargs) -> None: """ @@ -127,6 +136,18 @@ class SimulatedDataBase(ABC): """Select the active simulation model.""" self.select_model(model) + @property + def sim_params(self) -> None: + """Set the parameters for the active simulation model.""" + return self.params + + @sim_params.setter + def sim_params(self, params: dict): + """Set the parameters for the active simulation model.""" + self.params = params + + # TODO remove after refactoring code in main + def select_model(self, model: str) -> None: """ Method to select the active simulation model.