|
19 | 19 | import threading
|
20 | 20 | from inspect import getcallargs
|
21 | 21 | from functools import wraps, lru_cache
|
| 22 | +import numpy as np |
22 | 23 |
|
23 | 24 | # Notes for v3
|
24 | 25 | #
|
@@ -1722,7 +1723,7 @@ def expand_timeseries(self,all_times,flat_all_times_len):
|
1722 | 1723 | # If this output is not ramping, then its timeseries should
|
1723 | 1724 | # not be expanded. It's already as expanded as it'll get.
|
1724 | 1725 | if not self.parent_clock_line.ramping_allowed:
|
1725 |
| - self.raw_output = np.array(self.timeseries, dtype=np.dtype) |
| 1726 | + self.raw_output = np.array(self.timeseries, dtype=np.dtype(self.dtype)) |
1726 | 1727 | return
|
1727 | 1728 | outputarray = np.empty((flat_all_times_len,), dtype=np.dtype(self.dtype))
|
1728 | 1729 | j=0
|
@@ -2860,7 +2861,7 @@ def __init__(self, name, parent_device, connection, digital_gate={}, freq_limits
|
2860 | 2861 | digital_gate (dict, optional): Configures a digital output to use as an enable/disable
|
2861 | 2862 | gate for the output. Should contain keys `'device'` and `'connection'`
|
2862 | 2863 | with arguments for the `parent_device` and `connection` for instantiating
|
2863 |
| - the :obj:`DigitalOut`. |
| 2864 | + the :obj:`DigitalOut`. All other (optional) keys are passed as kwargs. |
2864 | 2865 | freq_limits (tuple, optional): `(lower, upper)` limits for the
|
2865 | 2866 | frequency of the output
|
2866 | 2867 | freq_conv_class (:obj:`labscript_utils:labscript_utils.unitconversions`, optional):
|
@@ -2912,8 +2913,10 @@ def __init__(self, name, parent_device, connection, digital_gate={}, freq_limits
|
2912 | 2913 | self.phase = AnalogQuantity(self.name + '_phase', self, 'phase', phase_limits, phase_conv_class, phase_conv_params)
|
2913 | 2914 |
|
2914 | 2915 | self.gate = None
|
2915 |
| - if 'device' in digital_gate and 'connection' in digital_gate: |
2916 |
| - self.gate = DigitalOut(name + '_gate', digital_gate['device'], digital_gate['connection']) |
| 2916 | + if 'device' in digital_gate and 'connection' in digital_gate: |
| 2917 | + dev = digital_gate.pop('device') |
| 2918 | + conn = digital_gate.pop('connection') |
| 2919 | + self.gate = DigitalOut(name + '_gate', dev, conn, **digital_gate) |
2917 | 2920 | # Did they only put one key in the dictionary, or use the wrong keywords?
|
2918 | 2921 | elif len(digital_gate) > 0:
|
2919 | 2922 | raise LabscriptError('You must specify the "device" and "connection" for the digital gate of %s.' % (self.name))
|
@@ -3041,7 +3044,7 @@ def __init__(self,name,parent_device,connection,digital_gate = {},freq_limits =
|
3041 | 3044 | digital_gate (dict, optional): Configures a digital output to use as an enable/disable
|
3042 | 3045 | gate for the output. Should contain keys `'device'` and `'connection'`
|
3043 | 3046 | with arguments for the `parent_device` and `connection` for instantiating
|
3044 |
| - the :obj:`DigitalOut`. |
| 3047 | + the :obj:`DigitalOut`. All other (optional) keys are passed as kwargs. |
3045 | 3048 | freq_limits (tuple, optional): `(lower, upper)` limits for the
|
3046 | 3049 | frequency of the output
|
3047 | 3050 | freq_conv_class (:obj:`labscript_utils:labscript_utils.unitconversions`, optional):
|
@@ -3091,8 +3094,10 @@ def __init__(self,name,parent_device,connection,digital_gate = {},freq_limits =
|
3091 | 3094 | self.amplitude = StaticAnalogQuantity(self.name+'_amp',self,'amp',amp_limits,amp_conv_class,amp_conv_params)
|
3092 | 3095 | self.phase = StaticAnalogQuantity(self.name+'_phase',self,'phase',phase_limits,phase_conv_class,phase_conv_params)
|
3093 | 3096 |
|
3094 |
| - if 'device' in digital_gate and 'connection' in digital_gate: |
3095 |
| - self.gate = DigitalOut(self.name+'_gate',digital_gate['device'],digital_gate['connection']) |
| 3097 | + if 'device' in digital_gate and 'connection' in digital_gate: |
| 3098 | + dev = digital_gate.pop('device') |
| 3099 | + conn = digital_gate.pop('connection') |
| 3100 | + self.gate = DigitalOut(name + '_gate', dev, conn, **digital_gate) |
3096 | 3101 | # Did they only put one key in the dictionary, or use the wrong keywords?
|
3097 | 3102 | elif len(digital_gate) > 0:
|
3098 | 3103 | raise LabscriptError('You must specify the "device" and "connection" for the digital gate of %s.'%(self.name))
|
|
0 commit comments