From 3cd462f4d59ba91c7e6edaf50d7333ce4a900641 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 10 Jun 2014 15:22:27 +0200 Subject: [PATCH] experiment: simplify definition of kernel_attr --- artiq/devices/core_dds.py | 4 ++-- artiq/language/experiment.py | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/artiq/devices/core_dds.py b/artiq/devices/core_dds.py index 27a7fd5cf..cb95ad910 100644 --- a/artiq/devices/core_dds.py +++ b/artiq/devices/core_dds.py @@ -11,8 +11,8 @@ class DDS: self._previous_frequency = 0*MHz - kernel_attr_ro = {"reg_channel", "rtio_channel", "latency", "phase_mode"} - kernel_attr = {"_previous_frequency"} + kernel_attr_ro = "reg_channel rtio_channel latency phase_mode" + kernel_attr = "_previous_frequency" @kernel def pulse(self, frequency, duration): diff --git a/artiq/language/experiment.py b/artiq/language/experiment.py index 9e0333019..5b7f0395a 100644 --- a/artiq/language/experiment.py +++ b/artiq/language/experiment.py @@ -5,9 +5,7 @@ class Experiment: parameters = "" def __init__(self, *args, **kwargs): - channels = self.channels.split() - parameters = self.parameters.split() - argnames = channels + parameters + argnames = self.channels.split() + self.parameters.split() undef_args = list(argnames) if len(argnames) < len(args): @@ -23,7 +21,7 @@ class Experiment: raise TypeError("__init__() missing {} argument(s): ".format(len(undef_args), ", ".join(["'"+s+"'" for s in undef_args]))) - self.kernel_attr_ro = set(parameters) + self.kernel_attr_ro = self.parameters def kernel(arg): if isinstance(arg, str):