From 9ffc370416f71ffa1838c8c0b522c8c598bbb362 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 19 Feb 2015 09:40:15 -0700 Subject: [PATCH] master,run: automatically call analyze function --- artiq/frontend/artiq_run.py | 2 ++ artiq/master/worker_impl.py | 2 ++ examples/flopping_f_simulation.py | 1 - 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/artiq/frontend/artiq_run.py b/artiq/frontend/artiq_run.py index db927257c..4b382be53 100755 --- a/artiq/frontend/artiq_run.py +++ b/artiq/frontend/artiq_run.py @@ -113,6 +113,8 @@ def main(): unit_inst = unit(dbh, **arguments) unit_inst.run() + if hasattr(unit_inst, "analyze"): + unit_inst.analyze() if args.hdf5 is not None: f = h5py.File(args.hdf5, "w") diff --git a/artiq/master/worker_impl.py b/artiq/master/worker_impl.py index 8fda84c07..1d7ac5889 100644 --- a/artiq/master/worker_impl.py +++ b/artiq/master/worker_impl.py @@ -94,6 +94,8 @@ def run(obj): try: unit_inst = unit(dbh, **obj["arguments"]) unit_inst.run() + if hasattr(unit_inst, "analyze"): + unit_inst.analyze() except Exception: put_object({"action": "report_completed", "status": "failed", diff --git a/examples/flopping_f_simulation.py b/examples/flopping_f_simulation.py index 0248bd6dd..0b4e1a669 100644 --- a/examples/flopping_f_simulation.py +++ b/examples/flopping_f_simulation.py @@ -52,7 +52,6 @@ class FloppingF(AutoDB): self.frequency.append(frequency) self.brightness.append(brightness) time.sleep(0.1) - self.analyze() def analyze(self): popt, pcov = curve_fit(model_numpy,