forked from M-Labs/artiq
scannable: fix RangeScan randomize seeding
This commit is contained in:
parent
07c71bf020
commit
bdf1ca25c6
@ -361,6 +361,7 @@ class ScanEntry(LayoutWidget):
|
||||
state[ty]["stop"] = default["stop"]
|
||||
state[ty]["npoints"] = default["npoints"]
|
||||
state[ty]["randomize"] = default["randomize"]
|
||||
state[ty]["seed"] = default["seed"]
|
||||
elif ty == "ExplicitScan":
|
||||
state[ty]["sequence"] = default["sequence"]
|
||||
else:
|
||||
|
@ -78,9 +78,8 @@ class RangeScan(ScanObject):
|
||||
self.sequence = [i*dx + start for i in range(npoints)]
|
||||
|
||||
if randomize:
|
||||
if seed is not None:
|
||||
random.seed(seed)
|
||||
random.shuffle(self.sequence)
|
||||
rng = random.Random(seed)
|
||||
random.shuffle(self.sequence, rng.random)
|
||||
|
||||
@portable
|
||||
def __iter__(self):
|
||||
|
Loading…
Reference in New Issue
Block a user