diff --git a/piker/data/__init__.py b/piker/data/__init__.py index b9c09e1c..49b0acb9 100644 --- a/piker/data/__init__.py +++ b/piker/data/__init__.py @@ -91,7 +91,7 @@ async def maybe_spawn_brokerd( # XXX: you should pretty much never want debug mode # for data daemons when running in production. - debug_mode: bool = False, + debug_mode: bool = True, ) -> tractor._portal.Portal: """If no ``brokerd.{brokername}`` daemon-actor can be found, spawn one in a local subactor and return a portal to it. @@ -115,7 +115,7 @@ async def maybe_spawn_brokerd( tractor_kwargs = getattr(brokermod, '_spawn_kwargs', {}) async with tractor.open_nursery( - debug_mode=False, + #debug_mode=debug_mode, ) as nursery: try: # spawn new daemon @@ -244,7 +244,7 @@ async def open_feed( loglevel=loglevel, # TODO: add a cli flag for this - debug_mode=False, + # debug_mode=False, ) as portal: diff --git a/piker/ui/_chart.py b/piker/ui/_chart.py index 950ed010..d62fef5b 100644 --- a/piker/ui/_chart.py +++ b/piker/ui/_chart.py @@ -408,7 +408,7 @@ class ChartPlotWidget(pg.PlotWidget): self.name = name self._lc = linked_charts - # view-local placeholder for book graphics + # scene-local placeholder for book graphics # sizing to avoid overlap with data contents self._max_l1_line_len: float = 0 @@ -448,7 +448,7 @@ class ChartPlotWidget(pg.PlotWidget): # for when the splitter(s) are resized self._vb.sigResized.connect(self._set_yrange) - def last_bar_in_view(self) -> bool: + def last_bar_in_view(self) -> int: self._ohlc[-1]['index'] def update_contents_labels( diff --git a/piker/ui/order_mode.py b/piker/ui/order_mode.py index c36474e7..84806156 100644 --- a/piker/ui/order_mode.py +++ b/piker/ui/order_mode.py @@ -181,10 +181,13 @@ class OrderMode: log.runtime(result) def on_cancel(self, uuid: str) -> None: + msg = self.book._sent_orders.pop(uuid, None) + if msg is not None: self.lines.remove_line(uuid=uuid) self.chart._cursor.show_xhair() + else: log.warning( f'Received cancel for unsubmitted order {pformat(msg)}'