forked from M-Labs/artiq
transforms: PEP8
This commit is contained in:
parent
65567e1201
commit
35d4f75b65
|
@ -1,4 +1,5 @@
|
||||||
"""This transform implements time management functions (delay/now/at)
|
"""
|
||||||
|
This transform implements time management functions (delay/now/at)
|
||||||
using an accumulator 'now' and simple replacement rules:
|
using an accumulator 'now' and simple replacement rules:
|
||||||
|
|
||||||
delay(t) -> now += t
|
delay(t) -> now += t
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
"""This transform turns calls to delay/now/at that use non-integer time
|
"""
|
||||||
|
This transform turns calls to delay/now/at that use non-integer time
|
||||||
expressed in seconds into calls that use int64 time expressed in multiples of
|
expressed in seconds into calls that use int64 time expressed in multiples of
|
||||||
ref_period.
|
ref_period.
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ from collections import defaultdict
|
||||||
|
|
||||||
from artiq.transforms.tools import is_ref_transparent, count_all_nodes
|
from artiq.transforms.tools import is_ref_transparent, count_all_nodes
|
||||||
|
|
||||||
|
|
||||||
class _TargetLister(ast.NodeVisitor):
|
class _TargetLister(ast.NodeVisitor):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.targets = set()
|
self.targets = set()
|
||||||
|
|
|
@ -104,7 +104,8 @@ def _is_ref_transparent(dependencies, expr):
|
||||||
return all(_is_ref_transparent(dependencies, v) for v in expr.values)
|
return all(_is_ref_transparent(dependencies, v) for v in expr.values)
|
||||||
elif isinstance(expr, ast.Call):
|
elif isinstance(expr, ast.Call):
|
||||||
return (expr.func.id in _replaceable_funcs and
|
return (expr.func.id in _replaceable_funcs and
|
||||||
all(_is_ref_transparent(dependencies, arg) for arg in expr.args))
|
all(_is_ref_transparent(dependencies, arg)
|
||||||
|
for arg in expr.args))
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -385,7 +385,8 @@ class _Unparser:
|
||||||
self.dispatch(k)
|
self.dispatch(k)
|
||||||
self.write(": ")
|
self.write(": ")
|
||||||
self.dispatch(v)
|
self.dispatch(v)
|
||||||
_interleave(lambda: self.write(", "), write_pair, zip(t.keys, t.values))
|
_interleave(lambda: self.write(", "), write_pair,
|
||||||
|
zip(t.keys, t.values))
|
||||||
self.write("}")
|
self.write("}")
|
||||||
|
|
||||||
def _Tuple(self, t):
|
def _Tuple(self, t):
|
||||||
|
|
Loading…
Reference in New Issue