Skip to content

Commit 6d6ffe2

Browse files
committed
Update some docstrings.
1 parent e468cbb commit 6d6ffe2

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

labscript_devices/Windfreak/labscript_devices.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
class FreqConversion(UnitConversion):
1919
"""
20-
A Generic frequency conversion class that covers standard SI prefixes from a base Hz.
20+
A Generic frequency conversion class that covers standard SI prefixes from a base of Hz.
2121
"""
2222

2323
base_unit = 'Hz' # must be defined here and match default hardware unit in BLACS tab
@@ -84,6 +84,20 @@ class WindfreakSynth(Device):
8484
]
8585
})
8686
def __init__(self, name, com_port="", trigger_mode='disabled', **kwargs):
87+
"""Creates a Windfreak HDPro Synthesizer
88+
89+
Args:
90+
name (str): python variable name to assign the device to.
91+
com_port (str): COM port connection string.
92+
Must take the form of 'COM d', where d is an integer.
93+
trigger_mode (str): Trigger mode for the device to use.
94+
Currently, labscript only directly programs 'rf enable',
95+
via setting DDS gates.
96+
labscript could correctly program other modes with some effort.
97+
Other modes can be correctly programmed externally,
98+
with the settings saved to EEPROM.
99+
**kwargs: Keyword arguments passed to :obj:`labscript:labscript.Device.__init__`.
100+
"""
87101

88102
Device.__init__(self, name, None, com_port, **kwargs)
89103
self.BLACS_connection = com_port
@@ -103,6 +117,17 @@ def get_default_unit_conversion_classes(self, device):
103117
return FreqConversion, None, None
104118

105119
def validate_data(self, data, limits, device):
120+
"""Tests that requested data is within limits.
121+
122+
Args:
123+
data (iterable or numeric): Data to be checked.
124+
Input is cast to a numpy array of type float64.
125+
limits (tuple): 2-element tuple of (min, max) range
126+
device (:obj:`labscript:labscript.Device`): labscript device we are performing check on.
127+
128+
Returns:
129+
numpy.ndarray: Input data, cast to a numpy array.
130+
"""
106131
if not isinstance(data, np.ndarray):
107132
data = np.array(data,dtype=np.float64)
108133
if np.any(data < limits[0]) or np.any(data > limits[1]):

0 commit comments

Comments
 (0)