Drop profile calls on OHLC bars for now

to_qpainterpath_and_beyond
Tyler Goodlet 2020-12-16 16:08:54 -05:00
parent df686755da
commit b72d7d3085
1 changed files with 5 additions and 3 deletions

View File

@ -417,7 +417,6 @@ def lines_from_ohlc(row: np.ndarray, w: float) -> Tuple[QLineF]:
return [hl, o, c] return [hl, o, c]
@timeit
@jit( @jit(
# TODO: for now need to construct this manually for readonly arrays, see # TODO: for now need to construct this manually for readonly arrays, see
# https://github.com/numba/numba/issues/4511 # https://github.com/numba/numba/issues/4511
@ -489,7 +488,7 @@ def path_arrays_from_ohlc(
return x, y, c return x, y, c
@timeit # @timeit
def gen_qpath( def gen_qpath(
data, data,
start, # XXX: do we need this? start, # XXX: do we need this?
@ -497,6 +496,8 @@ def gen_qpath(
) -> QtGui.QPainterPath: ) -> QtGui.QPainterPath:
x, y, c = path_arrays_from_ohlc(data, start, bar_gap=w) x, y, c = path_arrays_from_ohlc(data, start, bar_gap=w)
# TODO: numba the internals of this!
return pg.functions.arrayToQPath(x, y, connect=c) return pg.functions.arrayToQPath(x, y, connect=c)
@ -542,7 +543,7 @@ class BarItems(pg.GraphicsObject):
self.start_index: int = 0 self.start_index: int = 0
self.stop_index: int = 0 self.stop_index: int = 0
@timeit # @timeit
def draw_from_data( def draw_from_data(
self, self,
data: np.ndarray, data: np.ndarray,
@ -717,6 +718,7 @@ class BarItems(pg.GraphicsObject):
# lead to any perf gains other then when zoomed in to less bars # lead to any perf gains other then when zoomed in to less bars
# in view. # in view.
p.drawPicture(0, 0, self.last_bar) p.drawPicture(0, 0, self.last_bar)
p.setPen(self.bars_pen) p.setPen(self.bars_pen)
p.drawPath(self.path) p.drawPath(self.path)