From 9ec142e4f6cbce5e40676109825a3c8814587851 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 31 May 2016 20:24:46 -0500 Subject: [PATCH] examples/histograms: convert to mutate_dataset API. Closes #459 --- artiq/examples/master/repository/histograms.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/artiq/examples/master/repository/histograms.py b/artiq/examples/master/repository/histograms.py index 66c5144de..c7a0d1a3c 100644 --- a/artiq/examples/master/repository/histograms.py +++ b/artiq/examples/master/repository/histograms.py @@ -17,16 +17,15 @@ class Histograms(EnvExperiment): xs = np.empty(npoints) xs.fill(np.nan) - xs = self.set_dataset("hd_xs", xs, - broadcast=True, save=False) + self.set_dataset("hd_xs", xs, + broadcast=True, save=False) - counts = np.empty((npoints, nbins)) - counts = self.set_dataset("hd_counts", counts, - broadcast=True, save=False) + self.set_dataset("hd_counts", np.empty((npoints, nbins)), + broadcast=True, save=False) for i in range(npoints): histogram, _ = np.histogram(np.random.normal(i, size=1000), bin_boundaries) - counts[i] = histogram - xs[i] = i % 8 + self.mutate_dataset("hd_counts", i, histogram) + self.mutate_dataset("hd_xs", i, i % 8) sleep(0.3)