From 6df85478e42a94e9f2c5303e6e5be47ac7b9a04d Mon Sep 17 00:00:00 2001 From: Florian Agbuya Date: Wed, 13 Sep 2023 12:16:13 +0800 Subject: [PATCH] scan: fix deprecated shuffle parameter in python 3.11 --- artiq/language/scan.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/artiq/language/scan.py b/artiq/language/scan.py index 0f05d3756..ee06b2413 100644 --- a/artiq/language/scan.py +++ b/artiq/language/scan.py @@ -83,8 +83,7 @@ class RangeScan(ScanObject): self.sequence = [i*dx + start for i in range(npoints)] if randomize: - rng = random.Random(seed) - random.shuffle(self.sequence, rng.random) + random.Random(seed).shuffle(self.sequence) def __iter__(self): return iter(self.sequence) @@ -120,8 +119,7 @@ class CenterScan(ScanObject): for i in range(n) for sign in [-1, 1]][1:] if randomize: - rng = random.Random(seed) - random.shuffle(self.sequence, rng.random) + random.Random(seed).shuffle(self.sequence) def __iter__(self): return iter(self.sequence)