diff --git a/piker/brokers/ib/api.py b/piker/brokers/ib/api.py index 1fdabd7d..b440dfe0 100644 --- a/piker/brokers/ib/api.py +++ b/piker/brokers/ib/api.py @@ -1695,7 +1695,7 @@ class MethodProxy: ev = self.event_table.get(pattern) - if not ev or ev.is_set(): + if ev is None or ev.is_set(): # print(f'inserting new data reset event item') ev = self.event_table[pattern] = trio.Event() @@ -1814,7 +1814,7 @@ async def relay_client_proxy_messages( reason = status_msg['reason'] event = proxy.event_table.pop(reason, None) if ( - event + event is not None and event.statistics().tasks_waiting ): diff --git a/piker/data/_web_bs.py b/piker/data/_web_bs.py index fde04e71..64982d3b 100644 --- a/piker/data/_web_bs.py +++ b/piker/data/_web_bs.py @@ -323,7 +323,7 @@ async def _reconnect_forever( # if wrapper cancelled us, we expect it to also # have re-assigned a new event assert ( - nobsws._connected + nobsws._connected is not None and not nobsws._connected.is_set() ) diff --git a/piker/ui/_display.py b/piker/ui/_display.py index 1b28312c..87fea901 100644 --- a/piker/ui/_display.py +++ b/piker/ui/_display.py @@ -527,7 +527,7 @@ async def graphics_update_loop( continue ic = fast_chart.view._in_interact - if ic: + if ic is not None: fast_chart.pause_all_feeds() log.debug( f'Pausing chart updaates during interaction\n' diff --git a/piker/ui/_interaction.py b/piker/ui/_interaction.py index 2e3107ac..e890a9e5 100644 --- a/piker/ui/_interaction.py +++ b/piker/ui/_interaction.py @@ -581,7 +581,7 @@ class ChartView(ViewBox): self.order_mode: bool = False self.setFocusPolicy(QtCore.Qt.StrongFocus) - self._in_interact: trio.Event | None = None + self._in_interact: trio.Event|None = None self._interact_stack: ExitStack = ExitStack() # TODO: probably just assign this whenever a new `PlotItem` is @@ -619,7 +619,7 @@ class ChartView(ViewBox): to any waiters. ''' - if self._in_interact: + if self._in_interact is not None: try: self._interact_stack.close() self.chart.resume_all_feeds() @@ -1154,7 +1154,7 @@ class ChartView(ViewBox): str, tuple[float, float], ] | None = None, - + ): profiler = Profiler( msg=f'ChartView.interact_graphics_cycle() for {self.name}',