Drop legacy step mode data formatter

pre_flow
Tyler Goodlet 2022-05-15 14:12:09 -04:00
parent f93ac15440
commit e3dd933b34
1 changed files with 0 additions and 74 deletions

View File

@ -44,80 +44,6 @@ from ..log import get_logger
log = get_logger(__name__) log = get_logger(__name__)
# TODO: numba this instead..
# def step_path_arrays_from_1d(
# x: np.ndarray,
# y: np.ndarray,
# include_endpoints: bool = True,
# ) -> (np.ndarray, np.ndarray):
# '''
# Generate a "step mode" curve aligned with OHLC style bars
# such that each segment spans each bar (aka "centered" style).
# '''
# # y_out = y.copy()
# # x_out = x.copy()
# # x2 = np.empty(
# # # the data + 2 endpoints on either end for
# # # "termination of the path".
# # (len(x) + 1, 2),
# # # we want to align with OHLC or other sampling style
# # # bars likely so we need fractinal values
# # dtype=float,
# # )
# x2 = np.broadcast_to(
# x[:, None],
# (
# x.size + 1,
# # 4, # only ohlc
# 2,
# ),
# ) + np.array([-0.5, 0.5])
# # x2[0] = x[0] - 0.5
# # x2[1] = x[0] + 0.5
# # x2[0, 0] = x[0] - 0.5
# # x2[0, 1] = x[0] + 0.5
# # x2[1:] = x[:, np.newaxis] + 0.5
# # import pdbpp
# # pdbpp.set_trace()
# # flatten to 1-d
# # x_out = x2.reshape(x2.size)
# # x_out = x2
# # we create a 1d with 2 extra indexes to
# # hold the start and (current) end value for the steps
# # on either end
# y2 = np.empty(
# (len(y) + 1, 2),
# dtype=y.dtype,
# )
# y2[:] = y[:, np.newaxis]
# # y2[-1] = 0
# # y_out = y2
# # y_out = np.empty(
# # 2*len(y) + 2,
# # dtype=y.dtype
# # )
# # flatten and set 0 endpoints
# # y_out[1:-1] = y2.reshape(y2.size)
# # y_out[0] = 0
# # y_out[-1] = 0
# if not include_endpoints:
# return x2[:-1], y2[:-1]
# else:
# return x2, y2
_line_styles: dict[str, int] = { _line_styles: dict[str, int] = {
'solid': Qt.PenStyle.SolidLine, 'solid': Qt.PenStyle.SolidLine,
'dash': Qt.PenStyle.DashLine, 'dash': Qt.PenStyle.DashLine,