From 17eb059ed39d994084a8aa898dd09b5b4e114dba Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Thu, 30 Dec 2021 22:24:42 -0500 Subject: BasicInstrument now has __repr__ --- qolab/hardware/basic.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'qolab/hardware/basic.py') diff --git a/qolab/hardware/basic.py b/qolab/hardware/basic.py index dab32ab..5e8d17d 100644 --- a/qolab/hardware/basic.py +++ b/qolab/hardware/basic.py @@ -21,7 +21,21 @@ class BasicInstrument: self.deviceProperties = []; def __repr__(self): - s = f'{self.config}' + s = '' + s += f'{self.__class__.__name__}(' + s += 'config={' + cstr=[] + for k, v in self.config.items(): + if v is not None: + cstr.append( + f"'{k}'" + ': ' + f"'{v}'") + s += ', '.join(cstr) + s += '}' + if self.tsdb_ingester is not None: + s += f', tsdb_ingester={self.tsdb_ingester}' + s += ')' return(s) def tsdb_append(f): -- cgit v1.2.3