forked from M-Labs/artiq
1
0
Fork 0

language/core: remove kernel_attr_ro

This commit is contained in:
Sebastien Bourdeauducq 2014-09-13 19:24:58 +08:00
parent 123ddb26a1
commit 71adcb74bf
1 changed files with 0 additions and 13 deletions

View File

@ -40,23 +40,14 @@ def array(element, count):
return [copy(element) for i in range(count)] return [copy(element) for i in range(count)]
def _make_kernel_ro(value):
return isinstance(
value, (bool, int, int64, float, Fraction, units.Quantity))
class AutoContext: class AutoContext:
parameters = "" parameters = ""
implicit_core = True implicit_core = True
def __init__(self, mvs=None, **kwargs): def __init__(self, mvs=None, **kwargs):
kernel_attr_ro = []
self.mvs = mvs self.mvs = mvs
for k, v in kwargs.items(): for k, v in kwargs.items():
setattr(self, k, v) setattr(self, k, v)
if _make_kernel_ro(v):
kernel_attr_ro.append(k)
parameters = self.parameters.split() parameters = self.parameters.split()
if self.implicit_core: if self.implicit_core:
@ -67,10 +58,6 @@ class AutoContext:
except AttributeError: except AttributeError:
value = self.mvs.get_missing_value(parameter) value = self.mvs.get_missing_value(parameter)
setattr(self, parameter, value) setattr(self, parameter, value)
if _make_kernel_ro(value):
kernel_attr_ro.append(parameter)
self.kernel_attr_ro = " ".join(kernel_attr_ro)
self.build() self.build()