Skip to content

laboneq.dsl.device

laboneq.dsl.device.device_setup

DeviceSetup dataclass

Data object describing the device setup of a QCCS system.

dumps()

from_descriptor(yaml_text, server_host=None, server_port=None, setup_name=None) staticmethod

Construct the device setup from a YAML descriptor.

Parameters:

Name Type Description Default
yaml_text str

YAML file containing the device description.

required
server_host str

Server host of the setup that should be created.

None
server_port str

Port of the server that should be created.

None
setup_name str

Name of the setup that should be created.

None

from_dict(data, server_host=None, server_port=None, setup_name=None) classmethod

Construct the device setup from a Python dictionary.

Parameters:

Name Type Description Default
data Dict[str, Any]

Device setup data.

required
server_host Optional[str]

Server host of the setup that should be created.

None
server_port Optional[Union[str, int]]

Port of the server that should be created.

None
setup_name Optional[str]

Name of the setup that should be created.

None

.. versionadded:: 2.5.0

from_dicts(*, instrument_list=None, instruments=None, connections=None, dataservers=None, server_host=None, server_port=None, setup_name=None) staticmethod

Construct the device setup from Python dicts, same structure as yaml

Parameters:

Name Type Description Default
instrument_list dict

List of instruments in the setup (deprecated; for backwards compatibility)

None
instruments dict

List of instruments in the setup

None
connections dict

Connections between devices

None
server_host str

Server host of the setup that should be created.

None
server_port str

Port of the server that should be created.

None
setup_name str

Name of the setup that should be created.

None

from_yaml(filepath, server_host=None, server_port=None, setup_name=None) staticmethod

Construct the device setup from a YAML file.

Parameters:

Name Type Description Default
filepath str

Path to the YAML file containing the device description.

required
server_host str

Server host of the setup that should be created.

None
server_port str

Port of the server that should be created.

None
setup_name str

Name of the setup that should be created.

None

get_calibration(path=None)

Retrieve the calibration of a specific path.

Parameters:

Name Type Description Default
path str

Path of the calibration information.

None

Returns:

Name Type Description
calibration Calibration

Calibration object of the device setup.

instrument_by_uid(uid)

list_calibratables()

load(filename) staticmethod

Serialize the device setup into a specified filename.

Parameters:

Name Type Description Default
filename str

Filename.

required

logical_signal_by_uid(uid)

Get logical signal by uid.

Parameters:

Name Type Description Default
uid str

UID of the signal.

required

Returns:

Type Description
LogicalSignal

Logical signal with the UID.

Raises:

Type Description
KeyError

Logical signal UID was not found.

.. versionadded:: 2.5.0

reset_calibration(calibration=None)

Reset the calibration of all logical signals and instruments.

save(filename)

Load the device setup from a specified filename.

Parameters:

Name Type Description Default
filename str

Filename.

required

set_calibration(calibration)

Set the calibration of the device setup.

Parameters:

Name Type Description Default
calibration Calibration

Calibration object containing the keys of the individual settings.

required

laboneq.dsl.device.device_setup_helper

DeviceSetupHelper

delete_wiring(api_url) staticmethod

Delete wiring information to the LabOne Q monitoring server.

Parameters:

Name Type Description Default
api_url str

URL of the monitoring server. http://localhost:9005/slugname/wiring

required

Returns:

Name Type Description
status_code int

200 if succeeded.

download_wiring(api_url) staticmethod

Download wiring information from the LabOne Q monitoring server.

Parameters:

Name Type Description Default
api_url str

URL of the monitoring server. http://localhost:9005/slugname/wiring

required

Returns:

Name Type Description
wiring str

the GET content if succeeded.

upload_wiring(api_url, wiring_text) staticmethod

Upload wiring information to the LabOne Q monitoring server.

Parameters:

Name Type Description Default
api_url str

URL of the monitoring server. http://localhost:9005/slugname/wiring

required
wiring_text str

Json-like string contains wiring information.

required

Returns:

Name Type Description
status_code int

200 if succeeded.

upload_wiring_from_descriptor(api_url, descriptor) staticmethod

Upload wiring information to the LabOne Q monitoring server using yaml descriptor.

Parameters:

Name Type Description Default
api_url str

URL of the monitoring server. http://localhost:9005/slugname/wiring

required
descriptor str

yaml-like text contains wiring information.

required

Returns:

Name Type Description
status_code int

200 if succeeded.

laboneq.dsl.device.io_units

laboneq.dsl.device.io_units.logical_signal

LogicalSignal(uid, direction=None, name=None, calibration=None, path=None, physical_channel=None) dataclass

Bases: Calibratable

amplifier_pump: AmplifierPump | None property writable
amplitude property writable
calibration: SignalCalibration | None property writable
correction_matrix property writable
delay_signal property writable
direction = direction instance-attribute
local_oscillator property writable
mixer_calibration property writable
name = name instance-attribute
oscillator property writable
path = path instance-attribute
physical_channel property
port_delay property writable
port_mode property writable
precompensation property writable
range property writable
threshold property writable
uid = uid instance-attribute
voltage_offset property writable
voltage_offsets property writable
is_calibrated()
reset_calibration()