From 31e2aa0f38ab79d4371bdab9f9baa40dbb1eb8ee Mon Sep 17 00:00:00 2001 From: gcarq Date: Sat, 17 Mar 2018 22:12:42 +0100 Subject: [PATCH] misc: apply missing typehints --- freqtrade/misc.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/freqtrade/misc.py b/freqtrade/misc.py index 814e0fb6f..d70364999 100644 --- a/freqtrade/misc.py +++ b/freqtrade/misc.py @@ -6,12 +6,15 @@ import re import json import logging from datetime import datetime +from typing import Dict + import numpy as np +from pandas import DataFrame logger = logging.getLogger(__name__) -def shorten_date(_date): +def shorten_date(_date: str) -> str: """ Trim the date so it fits on small screens """ @@ -28,7 +31,7 @@ def shorten_date(_date): # Matplotlib doesn't support ::datetime64, # # so we need to convert it into ::datetime # ############################################ -def datesarray_to_datetimearray(dates): +def datesarray_to_datetimearray(dates: np.ndarray) -> np.ndarray: """ Convert an pandas-array of timestamps into An numpy-array of datetimes @@ -42,10 +45,10 @@ def datesarray_to_datetimearray(dates): return np.array(times) -def common_datearray(dfs): +def common_datearray(dfs: Dict[str, DataFrame]) -> np.ndarray: """ Return dates from Dataframe - :param dfs: Dataframe + :param dfs: Dict with format pair: pair_data :return: List of dates """ alldates = {}