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