transforms: PEP8

This commit is contained in:
Sebastien Bourdeauducq 2014-11-21 15:55:39 -08:00
parent 65567e1201
commit 35d4f75b65
7 changed files with 12 additions and 7 deletions

View File

@ -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:
delay(t) -> now += t

View File

@ -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
ref_period.

View File

@ -4,6 +4,7 @@ from collections import defaultdict
from artiq.transforms.tools import is_ref_transparent, count_all_nodes
class _TargetLister(ast.NodeVisitor):
def __init__(self):
self.targets = set()

View File

@ -104,7 +104,8 @@ def _is_ref_transparent(dependencies, expr):
return all(_is_ref_transparent(dependencies, v) for v in expr.values)
elif isinstance(expr, ast.Call):
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:
return False

View File

@ -385,7 +385,8 @@ class _Unparser:
self.dispatch(k)
self.write(": ")
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("}")
def _Tuple(self, t):