From 6ba0692851ed793e475e5b456bbec5131a8ba0de Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 17 Jun 2020 22:58:54 -0400 Subject: [PATCH] Revert weird bad .time access --- piker/ui/_source.py | 6 ++---- piker/ui/quantdom/base.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/piker/ui/_source.py b/piker/ui/_source.py index f0380b72..70c586d4 100644 --- a/piker/ui/_source.py +++ b/piker/ui/_source.py @@ -60,8 +60,8 @@ def from_df( df: pd.DataFrame, source=None, default_tf=None -): - """Cast OHLC ``pandas.DataFrame`` to ``numpy.structarray``. +) -> np.recarray: + """Convert OHLC formatted ``pandas.DataFrame`` to ``numpy.recarray``. """ df.reset_index(inplace=True) df['Date'] = [d.timestamp() for d in df.Date] @@ -79,10 +79,8 @@ def from_df( if name not in columns: del df[name] df = df.rename(columns=columns) - # df.insert(0, 'id', df.index) array = df.to_records() _nan_to_closest_num(array) - # self._set_time_frame(default_tf) return array diff --git a/piker/ui/quantdom/base.py b/piker/ui/quantdom/base.py index fed59508..3c853f00 100644 --- a/piker/ui/quantdom/base.py +++ b/piker/ui/quantdom/base.py @@ -90,7 +90,7 @@ class BaseQuotes(np.recarray): def convert_dates(self, dates): breakpoint() - return np.array([d.timestamp().time for d in dates]) + return np.array([d.timestamp() for d in dates]) class SymbolType(Enum):