forked from M-Labs/artiq
1
0
Fork 0

experiment: simplify definition of kernel_attr

This commit is contained in:
Sebastien Bourdeauducq 2014-06-10 15:22:27 +02:00
parent 8cc9c9eed6
commit 3cd462f4d5
2 changed files with 4 additions and 6 deletions

View File

@ -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):

View File

@ -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):