Add zero on increment support

fsp_drunken_alignment
Tyler Goodlet 2021-09-30 11:19:50 -04:00
parent 5b1be8a8da
commit 6f83e358fe
1 changed files with 9 additions and 0 deletions

View File

@ -171,6 +171,7 @@ async def cascade(
symbol: str,
func_name: str,
zero_on_step: bool = False,
loglevel: Optional[str] = None,
@ -232,6 +233,11 @@ async def cascade(
)
cs, index = await n.start(fsp_target)
if zero_on_step:
last = dst.array[-1:]
zeroed = np.zeros(last.shape, dtype=last.dtype)
await ctx.started(index)
profiler(f'{func_name}: fsp up')
@ -263,6 +269,9 @@ async def cascade(
# TODO: some signals, like vlm should be reset to
# zero every step.
last = array[-1:].copy()
if zero_on_step:
last = zeroed
dst.push(last)
last_len = new_len