Skip to content

Allow passthrough of other kwargs in DDS gate DigitalOut specification. #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions labscript/labscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -2799,7 +2799,7 @@ def __init__(self, name, parent_device, connection, digital_gate={}, freq_limits
digital_gate (dict, optional): Configures a digital output to use as an enable/disable
gate for the output. Should contain keys `'device'` and `'connection'`
with arguments for the `parent_device` and `connection` for instantiating
the :obj:`DigitalOut`.
the :obj:`DigitalOut`. All other (optional) keys are passed as kwargs.
freq_limits (tuple, optional): `(lower, upper)` limits for the
frequency of the output
freq_conv_class (:obj:`labscript_utils:labscript_utils.unitconversions`, optional):
Expand Down Expand Up @@ -2851,8 +2851,10 @@ def __init__(self, name, parent_device, connection, digital_gate={}, freq_limits
self.phase = AnalogQuantity(self.name + '_phase', self, 'phase', phase_limits, phase_conv_class, phase_conv_params)

self.gate = None
if 'device' in digital_gate and 'connection' in digital_gate:
self.gate = DigitalOut(name + '_gate', digital_gate['device'], digital_gate['connection'])
if 'device' in digital_gate and 'connection' in digital_gate:
dev = digital_gate.pop('device')
conn = digital_gate.pop('connection')
self.gate = DigitalOut(name + '_gate', dev, conn, **digital_gate)
# Did they only put one key in the dictionary, or use the wrong keywords?
elif len(digital_gate) > 0:
raise LabscriptError('You must specify the "device" and "connection" for the digital gate of %s.' % (self.name))
Expand Down Expand Up @@ -2980,7 +2982,7 @@ def __init__(self,name,parent_device,connection,digital_gate = {},freq_limits =
digital_gate (dict, optional): Configures a digital output to use as an enable/disable
gate for the output. Should contain keys `'device'` and `'connection'`
with arguments for the `parent_device` and `connection` for instantiating
the :obj:`DigitalOut`.
the :obj:`DigitalOut`. All other (optional) keys are passed as kwargs.
freq_limits (tuple, optional): `(lower, upper)` limits for the
frequency of the output
freq_conv_class (:obj:`labscript_utils:labscript_utils.unitconversions`, optional):
Expand Down Expand Up @@ -3030,8 +3032,10 @@ def __init__(self,name,parent_device,connection,digital_gate = {},freq_limits =
self.amplitude = StaticAnalogQuantity(self.name+'_amp',self,'amp',amp_limits,amp_conv_class,amp_conv_params)
self.phase = StaticAnalogQuantity(self.name+'_phase',self,'phase',phase_limits,phase_conv_class,phase_conv_params)

if 'device' in digital_gate and 'connection' in digital_gate:
self.gate = DigitalOut(self.name+'_gate',digital_gate['device'],digital_gate['connection'])
if 'device' in digital_gate and 'connection' in digital_gate:
dev = digital_gate.pop('device')
conn = digital_gate.pop('connection')
self.gate = DigitalOut(name + '_gate', dev, conn, **digital_gate)
# Did they only put one key in the dictionary, or use the wrong keywords?
elif len(digital_gate) > 0:
raise LabscriptError('You must specify the "device" and "connection" for the digital gate of %s.'%(self.name))
Expand Down