mirror of https://github.com/m-labs/artiq.git
examples: use new features
This commit is contained in:
parent
5d40c2431e
commit
eeb2790243
|
@ -31,5 +31,4 @@ class PhotonHistogram(AutoContext):
|
|||
n = self.nbins-1
|
||||
hist[n] += 1
|
||||
|
||||
for i in range(self.nbins):
|
||||
print(i, hist[i])
|
||||
print(hist)
|
||||
|
|
|
@ -94,16 +94,13 @@ class Transport(AutoContext):
|
|||
|
||||
@kernel
|
||||
def repeat(self):
|
||||
hist = [0 for _ in range(self.nbins)]
|
||||
self.histogram = [0 for _ in range(self.nbins)]
|
||||
|
||||
for i in range(self.repeats):
|
||||
n = self.one()
|
||||
if n >= self.nbins:
|
||||
n = self.nbins-1
|
||||
hist[n] += 1
|
||||
|
||||
for i in range(self.nbins):
|
||||
self.histogram.append(hist[i])
|
||||
self.histogram[n] += 1
|
||||
|
||||
def scan(self, stops):
|
||||
for s in stops:
|
||||
|
|
Loading…
Reference in New Issue