forked from M-Labs/artiq
1
0
Fork 0

scannable: fix RangeScan randomize seeding

This commit is contained in:
Chris Ballance 2017-03-31 09:41:53 +01:00 committed by Sébastien Bourdeauducq
parent 07c71bf020
commit bdf1ca25c6
2 changed files with 3 additions and 3 deletions

View File

@ -361,6 +361,7 @@ class ScanEntry(LayoutWidget):
state[ty]["stop"] = default["stop"] state[ty]["stop"] = default["stop"]
state[ty]["npoints"] = default["npoints"] state[ty]["npoints"] = default["npoints"]
state[ty]["randomize"] = default["randomize"] state[ty]["randomize"] = default["randomize"]
state[ty]["seed"] = default["seed"]
elif ty == "ExplicitScan": elif ty == "ExplicitScan":
state[ty]["sequence"] = default["sequence"] state[ty]["sequence"] = default["sequence"]
else: else:

View File

@ -78,9 +78,8 @@ class RangeScan(ScanObject):
self.sequence = [i*dx + start for i in range(npoints)] self.sequence = [i*dx + start for i in range(npoints)]
if randomize: if randomize:
if seed is not None: rng = random.Random(seed)
random.seed(seed) random.shuffle(self.sequence, rng.random)
random.shuffle(self.sequence)
@portable @portable
def __iter__(self): def __iter__(self):