From b064012d71666d9b8153748bbe529fe17bb527f2 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Tue, 2 Jul 2024 18:11:59 -0400 Subject: added help for basic instrument --- qolab/hardware/basic.py | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'qolab/hardware/basic.py') diff --git a/qolab/hardware/basic.py b/qolab/hardware/basic.py index 2161dca..2e99767 100644 --- a/qolab/hardware/basic.py +++ b/qolab/hardware/basic.py @@ -4,15 +4,31 @@ from qolab.file_utils import get_next_data_file from qolab.tsdb import tsdb_append_metric_for_class_setter_or_getter class BasicInstrument: - """ This is the most basic instrument class """ + """This is the most basic instrument class. + + Parameters + ---------- + device_nickname : None (default) or str + used to distinguish similar (in hardware, e.g. scopes) instruments, + also used as a tag in Time Series DB (TSDB) logging. + If not set we fallback to 'Device type' in config. + tsdb_ingester : None or tsdb ingester + used to log properties (with setter/getter) to TSDB. If 'None', the log entry is skipped + config : dictionary, default is empty dictionary + used to add or override default entries describing instrument + It is good idea to set the following keys in the dictionary: + 'Device type', 'Device model', 'DeviceId', 'DeviceNickname', 'FnamePrefix', 'SavePath'. + + Example + ------- + >>> config['Device type'] = 'Basic Instrument' + >>> config['Device model'] = 'Model is unset' + >>> config['DeviceId'] = None + >>> config['DeviceNickname'] = device_nickname; # to separate similar instruments + >>> config['FnamePrefix'] = 'basicInstrument' + >>> config['SavePath'] = './data' + """ def __init__(self, config={}, device_nickname=None, tsdb_ingester=None): - """ - device_nickname - used to separate similar instruments, - also used as a tag in Time Series DB (TSDB) logging, - if not set we fallbacl to 'Device type' - tsdb_ingester - used to log to TSDB if not set, the log entry is skipped - config - used to add or override default entries - """ self.config = {} self.config['Device type'] = 'Basic Instrument' self.config['Device model'] = 'Model is unset' -- cgit v1.2.3