From 6e2e2fc03f472988455df7d391157cd5f616d321 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 15 May 2022 13:39:30 -0400 Subject: [PATCH] Use `pendulum` for timestamp parsing --- piker/data/marketstore.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/piker/data/marketstore.py b/piker/data/marketstore.py index 39fe1b70..e1fb38d5 100644 --- a/piker/data/marketstore.py +++ b/piker/data/marketstore.py @@ -40,7 +40,6 @@ from bidict import bidict import msgpack import pyqtgraph as pg import numpy as np -import pandas as pd import tractor from trio_websocket import open_websocket_url from anyio_marketstore import ( @@ -268,7 +267,7 @@ def quote_to_marketstore_structarray( ''' if last_fill: # new fill bby - now = timestamp(last_fill) + now = int(pendulum.parse(last_fill).timestamp) else: # this should get inserted upstream by the broker-client to # subtract from IPC latency @@ -298,15 +297,6 @@ def quote_to_marketstore_structarray( return np.array([tuple(array_input)], dtype=_quote_dt) -def timestamp(date, **kwargs) -> int: - ''' - Return marketstore compatible 'Epoch' integer in nanoseconds - from a date formatted str. - - ''' - return int(pd.Timestamp(date, **kwargs).value) - - @acm async def get_client( host: str = 'localhost',