From c531ad11cf78c03787f805bd4f9a2ab1963a0532 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Sat, 13 Jul 2024 23:04:59 -0400 Subject: better doc string --- qolab/hardware/power_supply/__init__.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'qolab/hardware') diff --git a/qolab/hardware/power_supply/__init__.py b/qolab/hardware/power_supply/__init__.py index 5ec4ab9..0ee4fce 100644 --- a/qolab/hardware/power_supply/__init__.py +++ b/qolab/hardware/power_supply/__init__.py @@ -2,7 +2,12 @@ from qolab.hardware.scpi import SCPIinstr from qolab.hardware.basic import BasicInstrument class PowerSupply(BasicInstrument): - # Minimal set of methods to be implemented by a Power Supply + """Base class for a Power Supply. + + Contains minimal set of methods to be implemented by a Power Supply. + + Intended to be used as a parent for hardware aware power supplies. + """ def __init__(self, *args, **kwds): BasicInstrument.__init__(self, *args, **kwds) self.config['Device type']='PowerSupply' @@ -11,12 +16,19 @@ class PowerSupply(BasicInstrument): self.deviceProperties.update({}) class PowerSupplySCPI(SCPIinstr, PowerSupply): - """ - Do not instantiate directly, use - rm = pyvisa.ResourceManager() - PowerSupplySCPI(rm.open_resource('TCPIP::192.168.0.2::INSTR')) + """SCPI aware power supply. + + Intended to be used as a parent for hardware aware power supplies. + + Example + ------- + + >>> rm = pyvisa.ResourceManager() + >>> PowerSupplySCPI(rm.open_resource('TCPIP::192.168.0.2::INSTR')) + or - PowerSupplySCPI(rm.open_resource('USB0::10893::4354::MY61001869::0::INSTR')) + + >>> PowerSupplySCPI(rm.open_resource('USB0::10893::4354::MY61001869::0::INSTR')) """ def __init__(self, resource, *args, **kwds): SCPIinstr.__init__(self, resource) -- cgit v1.2.3