Skip to content

Commit c5acb68

Browse files
committedOct 19, 2014
examples/transport: pep8
1 parent caab819 commit c5acb68

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed
 

‎examples/transport.py

+14-13
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Transport(AutoContext):
99
"bd pmt repeats nbins "
1010
"electrodes transport_data wait_at_stop speed"
1111
)
12-
12+
1313
def prepare(self, stop):
1414
t = self.transport_data["t"][:stop]*self.speed
1515
u = self.transport_data["u"][:stop]
@@ -22,18 +22,20 @@ def prepare(self, stop):
2222
# both (duration and segment triggering flag) to be retrieved during
2323
# kernel compilation, see transport()
2424
self.tf.append("to_stop",
25-
t, u, trigger=True)
25+
t, u, trigger=True)
2626
# append the reverse transport (from stop to 0)
2727
# both durations are the same in this case
2828
self.tf.append("from_stop",
29-
t[-1] - t[::-1], u[::-1], trigger=True)
29+
t[-1] - t[::-1], u[::-1], trigger=True)
3030
# closes the frame with a wait line before jumping back into
3131
# the jump table so that frame signal can be set before the jump
3232
# also mark the frame as closed and prevent further append()ing
3333
self.tf.close()
3434
# user must pass all frames that are going to be used next
35-
# selects possible frame id based on rtio_frame assignments from coredev
36-
# distributes frames to the sub-devices in CompoundPDQ2 and uploads them
35+
# selects possible frame id based on rtio_frame assignments
36+
# from core device
37+
# distributes frames to the sub-devices in CompoundPDQ2
38+
# and uploads them
3739
# uploading is ARM_DIS, writing, ARM_EN
3840
self.electrodes.prepare(self.tf)
3941

@@ -49,9 +51,7 @@ def transport(self):
4951
# ensures no frame is currently being actively played
5052
# set rtio frame select signal to frame id
5153
# rtio trigger jump into transport frame
52-
# (it would be nice if this could be made zero-duration/not advancing the
53-
# timeline by smart scheduling of this frame-select + trigger + minimum wait
54-
# sequence)
54+
# (does not advance the timeline)
5555
self.tf.begin()
5656
# triggers pdqs to start transport frame segment
5757
# plays the transport waveform from 0 to stop
@@ -109,9 +109,9 @@ def scan(self, stops):
109109
if __name__ == "__main__":
110110
# data is usually precomputed offline
111111
data = dict(
112-
t=np.linspace(0, 10, 101), # waveform time
113-
u=np.random.randn(101, 4*3*3), # waveform data,
114-
# 4 devices, 3 board each, 3 dacs each
112+
t=np.linspace(0, 10, 101), # waveform time
113+
u=np.random.randn(101, 4*3*3), # waveform data,
114+
# 4 devices, 3 board each, 3 dacs each
115115
)
116116

117117
with corecom_serial.CoreCom() as com:
@@ -125,10 +125,11 @@ def scan(self, stops):
125125
pmt=rtio_core.RTIOIn(core=coredev, channel=0),
126126
# a compound pdq device that wraps multiple usb devices (looked up
127127
# by usb "serial number"/id) into one
128-
electrodes=pdq2.CompoundPDQ2(core=coredev,
128+
electrodes=pdq2.CompoundPDQ2(
129+
core=coredev,
129130
ids=["qc_q1_{}".format(i) for i in range(4)],
130131
rtio_trigger=3, rtio_frame=(4, 5, 6)),
131-
transport_data=data, # or: json.load
132+
transport_data=data, # or: json.load
132133
wait_at_stop=100*us,
133134
speed=1.5,
134135
repeats=100,

0 commit comments

Comments
 (0)
Please sign in to comment.