Skip to content

Commit c2ca63c

Browse files
Thomas Lemonjenshnielsen
authored andcommitted
Use bool to control blocking_t functionality in temperature_setpoint
1 parent 21a9b43 commit c2ca63c

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

docs/examples/driver_examples/Qcodes example with DynaCool PPMS.ipynb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@
200200
"cell_type": "markdown",
201201
"metadata": {},
202202
"source": [
203-
"Alternatively, you can use the `blocking_t` parameter to prevent users from taking any action until the setpoint is reached. This may be useful for measurements where you are sweeping temperature and want to ensure the temperature is stable before taking a measurement.\n",
203+
"Alternatively, you can use the `block_while_ramping_temperature` parameter to prevent users from taking any action until the setpoint is reached. This may be useful for measurements where you are sweeping temperature and want to ensure the temperature is stable before taking a measurement.\n",
204204
"\n",
205-
"The interval at which `blocking_t` checks for temperature stability can be modified through the parameter `blocking_t_state_check_interval`."
205+
"The interval at which `temperature_setpoint` checks for temperature stability when `block_while_ramping_temperature` is True can be modified through the parameter `blocking_t_state_check_interval`."
206206
]
207207
},
208208
{
@@ -212,7 +212,8 @@
212212
"outputs": [],
213213
"source": [
214214
"dynacool.blocking_t_state_check_interval(0.5)\n",
215-
"dynacool.blocking_t(dynacool.temperature() + 1.3)"
215+
"dynacool.block_while_ramping_temperature(True)\n",
216+
"dynacool.temperature_setpoint(dynacool.temperature() + 1.3)"
216217
]
217218
},
218219
{

src/qcodes/instrument_drivers/QuantumDesign/DynaCoolPPMS/DynaCool.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,16 @@ def __init__(
8383
)
8484
"""Parameter temperature_setpoint"""
8585

86-
self.blocking_t: Parameter = self.add_parameter(
87-
"blocking_t",
86+
self.block_while_ramping_temperature: Parameter = self.add_parameter(
87+
"block_while_ramping_temperature",
8888
label="Block instrument while ramping temperature",
89-
unit="K",
90-
vals=vals.Numbers(1.6, 400),
89+
initial_value=False,
90+
vals=vals.Bool(),
9191
get_cmd=False,
92-
set_cmd=partial(
93-
self._temp_setter, "temperature_setpoint", block_while_ramping=True
94-
),
92+
set_cmd=False,
9593
)
96-
"""Parameter blocking_t will block instrument interaction while temperature is ramping to setpoint."""
94+
"""Parameter block_while_ramping_temperature, when set to True,
95+
will block further interaction while temperature is ramping to setpoint."""
9796

9897
self.blocking_t_state_check_interval: Parameter = self.add_parameter(
9998
name="blocking_t_state_check_interval",
@@ -104,7 +103,8 @@ def __init__(
104103
set_cmd=None,
105104
get_cmd=None,
106105
)
107-
"""Parameter blocking_t_state_check_interval sets how often blocking_t checks for temperature stability."""
106+
"""Parameter blocking_t_state_check_interval sets how often
107+
temperature_setpoint checks for temperature stability when block_while_ramping_temperature is True."""
108108

109109
self.temperature_rate: Parameter = self.add_parameter(
110110
"temperature_rate",
@@ -423,7 +423,6 @@ def _temp_setter(
423423
"temperature_setpoint", "temperature_rate", "temperature_settling"
424424
],
425425
value: float,
426-
block_while_ramping: bool = False,
427426
) -> None:
428427
"""
429428
The setter function for the temperature parameters. All three are set
@@ -435,12 +434,11 @@ def _temp_setter(
435434

436435
self.write(f"TEMP {values[0]}, {values[1]}, {values[2]}")
437436

438-
if block_while_ramping:
437+
if self.block_while_ramping_temperature():
439438
while self.temperature_state() != "stable":
440439
sleep(self.blocking_t_state_check_interval())
441440

442441
self.setpoint.cache._set_from_raw_value(values[0])
443-
self.blocking_t.cache._set_from_raw_value(values[0])
444442

445443
def write(self, cmd: str) -> None:
446444
"""

0 commit comments

Comments
 (0)