From 97ec3de6f3043ed796db6d05607c324c604864e1 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 3 Jun 2016 23:10:00 -0400 Subject: [PATCH] doc/getting_started_mgmt: adapt to changes. Closes #462 --- doc/manual/getting_started_mgmt.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/manual/getting_started_mgmt.rst b/doc/manual/getting_started_mgmt.rst index dd2251b69..9f7b06d36 100644 --- a/doc/manual/getting_started_mgmt.rst +++ b/doc/manual/getting_started_mgmt.rst @@ -53,10 +53,10 @@ Experiments may have arguments whose values can be set in the GUI and used in th def build(self): - self.setattr_argument("count", NumberValue(ndecimals=0)) + self.setattr_argument("count", NumberValue(ndecimals=0, step=1)) def run(self): - for i in range(int(self.count)): + for i in range(self.count): print("Hello World", i) @@ -144,15 +144,15 @@ Datasets Modify the ``run()`` method of the experiment as follows: :: def run(self): - parabola = self.set_dataset("parabola", [], broadcast=True) - for i in range(int(self.count)): - parabola.append(i*i) + self.set_dataset("parabola", np.full(self.count, np.nan), broadcast=True) + for i in range(self.count): + self.mutate_dataset("parabola", i, i*i) time.sleep(0.5) -.. note:: You need to import the ``time`` module. +.. note:: You need to import the ``time`` module, and the ``numpy`` module as ``np``. -Commit, push and submit the experiment as before. While it is running, go to the "Datasets" dock of the GUI and create a new XY plot showing the new result. Observe how the points are added one by one to the plot. +Commit, push and submit the experiment as before. While it is running, go to the "Datasets" dock of the GUI and create a new XY plot showing the new result (you need to edit the applet command line so that it retrieves the ``parabola`` dataset). Observe how the points are added one by one to the plot. -After the experiment has finished executing, the results are written to a HDF5 file that resides in ``~/artiq-master/results//