From 566a54ffb6d48c49854318f383006a463fbf990e Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 22 Jun 2022 18:54:23 -0400 Subject: [PATCH] Reset the clears table on zero size conditions --- piker/pp.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/piker/pp.py b/piker/pp.py index fd8d5cda..4d1be0c4 100644 --- a/piker/pp.py +++ b/piker/pp.py @@ -310,13 +310,17 @@ def update_pps( cost=2*r.cost, ) - # track clearing data - pp.clears[r.tid] = { - 'cost': r.cost, - 'price': r.price, - 'size': r.size, - 'dt': str(r.dt), - } + if pp.size == 0: + pp.clears.clear() + + else: + # track clearing data + pp.clears[r.tid] = { + 'cost': r.cost, + 'price': r.price, + 'size': r.size, + 'dt': str(r.dt), + } assert len(set(pp.clears)) == len(pp.clears) return pps