Skip to content

Commit d601bc2

Browse files
committed
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
1 parent 79576e3 commit d601bc2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

qcodes_contrib_drivers/drivers/Horiba/Horiba_FHR.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def __init__(self, parent: InstrumentBase, name: str, cli, handle,
165165
get_cmd=self._get_position,
166166
set_cmd=self._set_position,
167167
set_parser=int,
168-
vals=validators.Ints(min_value, max_value),
168+
vals=validators.Numbers(min_value, max_value),
169169
unit=self.unit)
170170

171171
@property
@@ -242,6 +242,7 @@ def __init__(self, parent: InstrumentBase, name: str, cli, handle,
242242
self.add_parameter('position',
243243
label=f'{label} position',
244244
get_cmd=False,
245+
set_parser=int,
245246
set_cmd=self._set_position,
246247
val_mapping=val_mapping)
247248

@@ -264,7 +265,7 @@ def __init__(self, parent: InstrumentBase, name: str, cli, handle,
264265
set_cmd=self._set_width,
265266
set_parser=int,
266267
unit=self.unit,
267-
vals=validators.Ints(min_value, max_value),
268+
vals=validators.Numbers(min_value, max_value),
268269
docstring="Actual slit opening width")
269270

270271
@property

0 commit comments

Comments
 (0)