Add zero on increment support
parent
3ed0739bbe
commit
fc12e72906
|
@ -172,6 +172,7 @@ async def cascade(
|
||||||
|
|
||||||
symbol: str,
|
symbol: str,
|
||||||
func_name: str,
|
func_name: str,
|
||||||
|
zero_on_step: bool = False,
|
||||||
|
|
||||||
loglevel: Optional[str] = None,
|
loglevel: Optional[str] = None,
|
||||||
|
|
||||||
|
@ -233,6 +234,11 @@ async def cascade(
|
||||||
)
|
)
|
||||||
|
|
||||||
cs, index = await n.start(fsp_target)
|
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)
|
await ctx.started(index)
|
||||||
profiler(f'{func_name}: fsp up')
|
profiler(f'{func_name}: fsp up')
|
||||||
|
|
||||||
|
@ -264,6 +270,9 @@ async def cascade(
|
||||||
# TODO: some signals, like vlm should be reset to
|
# TODO: some signals, like vlm should be reset to
|
||||||
# zero every step.
|
# zero every step.
|
||||||
last = array[-1:].copy()
|
last = array[-1:].copy()
|
||||||
|
if zero_on_step:
|
||||||
|
last = zeroed
|
||||||
|
|
||||||
dst.push(last)
|
dst.push(last)
|
||||||
last_len = new_len
|
last_len = new_len
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue