From d601bc2c927f4666ff8ceba349379b9a5c7e8b02 Mon Sep 17 00:00:00 2001 From: "Tobias Hangleiter (Valhalla)" Date: Thu, 19 Oct 2023 16:26:14 +0200 Subject: [PATCH] Validate numbers instead of ints For reasons unclear to me, validation is performed before set_parsing, making the latter obsolete if validation for the set_parser type --- qcodes_contrib_drivers/drivers/Horiba/Horiba_FHR.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qcodes_contrib_drivers/drivers/Horiba/Horiba_FHR.py b/qcodes_contrib_drivers/drivers/Horiba/Horiba_FHR.py index 1afbb8041..7b8d6a52f 100644 --- a/qcodes_contrib_drivers/drivers/Horiba/Horiba_FHR.py +++ b/qcodes_contrib_drivers/drivers/Horiba/Horiba_FHR.py @@ -165,7 +165,7 @@ def __init__(self, parent: InstrumentBase, name: str, cli, handle, get_cmd=self._get_position, set_cmd=self._set_position, set_parser=int, - vals=validators.Ints(min_value, max_value), + vals=validators.Numbers(min_value, max_value), unit=self.unit) @property @@ -242,6 +242,7 @@ def __init__(self, parent: InstrumentBase, name: str, cli, handle, self.add_parameter('position', label=f'{label} position', get_cmd=False, + set_parser=int, set_cmd=self._set_position, val_mapping=val_mapping) @@ -264,7 +265,7 @@ def __init__(self, parent: InstrumentBase, name: str, cli, handle, set_cmd=self._set_width, set_parser=int, unit=self.unit, - vals=validators.Ints(min_value, max_value), + vals=validators.Numbers(min_value, max_value), docstring="Actual slit opening width") @property