Skip to content

Commit

Permalink
cover curve header parameters with tests
Browse files Browse the repository at this point in the history
  • Loading branch information
astafan8 committed Oct 14, 2024
1 parent 8f5ecd4 commit 5a2e4d8
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
40 changes: 40 additions & 0 deletions src/qcodes/instrument/sims/lakeshore_model336.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ devices:
setter:
q: "range A,\"{}\""

sensor_curve_number_A:
default: 42
getter:
q: "INCRV? A"
r: "{}"

curve_data_query_for_curve_42:
getter:
q: "CRVHDR? 42"
r: "DT-042,01110042,2,342.0,1"


temperature_B:
default: 100.0
Expand Down Expand Up @@ -96,7 +107,16 @@ devices:
setter:
q: "range A,\"{}\""

sensor_curve_number_B:
default: 41
getter:
q: "INCRV? B"
r: "{}"

curve_data_query_for_curve_41:
getter:
q: "CRVHDR? 41"
r: "DT-041,01110041,2,341.0,1"

temperature_C:
default: 100.0
Expand Down Expand Up @@ -140,7 +160,16 @@ devices:
setter:
q: "range A,\"{}\""

sensor_curve_number_C:
default: 40
getter:
q: "INCRV? C"
r: "{}"

curve_data_query_for_curve_40:
getter:
q: "CRVHDR? 40"
r: "DT-040,01110040,2,340.0,1"

temperature_D:
default: 100.0
Expand Down Expand Up @@ -184,6 +213,17 @@ devices:
setter:
q: "range A,\"{}\""

sensor_curve_number_D:
default: 39
getter:
q: "INCRV? D"
r: "{}"

curve_data_query_for_curve_39:
getter:
q: "CRVHDR? 39"
r: "DT-039,01110039,2,339.0,1"


resources:
GPIB::2::INSTR:
Expand Down
17 changes: 15 additions & 2 deletions tests/drivers/test_lakeshore_336.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def __init__(self, *args, **kwargs) -> None:
auto_range_enabled=0, # 'off',
range=0,
compensation_enabled=0, # False,
units=1,
) # 'kelvin')
units=1, # 'kelvin'
)
for i in self.channel_name_command.keys()
}

Expand Down Expand Up @@ -259,6 +259,19 @@ def test_setpoint(lakeshore_336) -> None:
assert h.setpoint() == setpoint


def test_curve_parameters(lakeshore_336) -> None:
# The curve numbers are assigned in the simulation pyvisa sim
# YAML file for each sensor/channel, and properties of the
# curves also include curve number in them to help testing
for ch, curve_number in zip(lakeshore_336.channels, (42, 41, 40, 39)):
assert ch.curve_number() == curve_number
assert ch.curve_name().endswith(str(curve_number))
assert ch.curve_sn().endswith(str(curve_number))
assert ch.curve_format() == "V/K"
assert str(int(ch.curve_limit())).endswith(str(curve_number))
assert ch.curve_coefficient() == "negative"


def test_select_range_limits(lakeshore_336) -> None:
h = lakeshore_336.output_1
ranges = [1, 2, 3]
Expand Down

0 comments on commit 5a2e4d8

Please sign in to comment.