Markup OHLC->path gen with `numba` issue #

multichartz
Tyler Goodlet 2022-12-02 11:20:17 -05:00
parent b0e31990d3
commit d739cf15b8
1 changed files with 8 additions and 5 deletions

View File

@ -89,6 +89,8 @@ def path_arrays_from_ohlc(
data: np.ndarray, data: np.ndarray,
start: int64, start: int64,
bar_gap: float64 = 0.43, bar_gap: float64 = 0.43,
# XXX: ``numba`` issue: https://github.com/numba/numba/issues/8622
# index_field: str, # index_field: str,
) -> tuple[ ) -> tuple[
@ -115,17 +117,18 @@ def path_arrays_from_ohlc(
# /home/goodboy/repos/piker/env/lib/python3.8/site-packages/numba/core/typing/builtins.py:991 # /home/goodboy/repos/piker/env/lib/python3.8/site-packages/numba/core/typing/builtins.py:991
for i, q in enumerate(data[start:], start): for i, q in enumerate(data[start:], start):
# TODO: ask numba why this doesn't work..
# open, high, low, close, index = q[
# ['open', 'high', 'low', 'close', 'index']]
open = q['open'] open = q['open']
high = q['high'] high = q['high']
low = q['low'] low = q['low']
close = q['close'] close = q['close']
# index = float64(q[index_field])
index = float64(q['index']) index = float64(q['index'])
# XXX: ``numba`` issue: https://github.com/numba/numba/issues/8622
# index = float64(q[index_field])
# AND this (probably)
# open, high, low, close, index = q[
# ['open', 'high', 'low', 'close', 'index']]
istart = i * 6 istart = i * 6
istop = istart + 6 istop = istart + 6