From 83a2427a61b7025d58e74c49100dc3b65d4c1088 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 23 Mar 2019 19:28:06 +0100 Subject: [PATCH] Fix mypy in scripts --- .travis.yml | 2 +- docs/plotting.md | 2 +- scripts/plot_dataframe.py | 2 +- scripts/plot_profit.py | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 014eb00ad..71432ea0a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,7 @@ jobs: name: hyperopt - script: flake8 freqtrade scripts name: flake8 - - script: mypy freqtrade + - script: mypy freqtrade scripts name: mypy - stage: docker diff --git a/docs/plotting.md b/docs/plotting.md index a9b191e75..60c642ab3 100644 --- a/docs/plotting.md +++ b/docs/plotting.md @@ -84,5 +84,5 @@ The `-p` pair argument, can be used to plot a single pair Example ``` -python3 scripts/plot_profit.py --datadir ../freqtrade/freqtrade/tests/testdata-20171221/ -p BTC_LTC +python3 scripts/plot_profit.py --datadir ../freqtrade/freqtrade/tests/testdata-20171221/ -p LTC/BTC ``` diff --git a/scripts/plot_dataframe.py b/scripts/plot_dataframe.py index 2eccaca18..14d57265e 100755 --- a/scripts/plot_dataframe.py +++ b/scripts/plot_dataframe.py @@ -146,7 +146,7 @@ def get_tickers_data(strategy, exchange, pairs: List[str], args): tickers[pair] = exchange.klines((pair, tick_interval)) else: tickers = history.load_data( - datadir=Path(_CONF.get("datadir")), + datadir=Path(str(_CONF.get("datadir"))), pairs=pairs, ticker_interval=tick_interval, refresh_pairs=_CONF.get('refresh_pairs', False), diff --git a/scripts/plot_profit.py b/scripts/plot_profit.py index 8361e8bf6..394f02116 100755 --- a/scripts/plot_profit.py +++ b/scripts/plot_profit.py @@ -37,7 +37,7 @@ logger = logging.getLogger(__name__) # data:: [ pair, profit-%, enter, exit, time, duration] # data:: ["ETH/BTC", 0.0023975, "1515598200", "1515602100", "2018-01-10 07:30:00+00:00", 65] def make_profit_array(data: List, px: int, min_date: int, - interval: int, + interval: str, filter_pairs: Optional[List] = None) -> np.ndarray: pg = np.zeros(px) filter_pairs = filter_pairs or [] @@ -120,7 +120,7 @@ def plot_profit(args: Namespace) -> None: logger.info('Filter, keep pairs %s' % pairs) tickers = history.load_data( - datadir=Path(config.get('datadir')), + datadir=Path(str(config.get('datadir'))), pairs=pairs, ticker_interval=tick_interval, refresh_pairs=False, @@ -178,7 +178,7 @@ def plot_profit(args: Namespace) -> None: fig.append_trace(profit, 2, 1) for pair in pairs: - pg = make_profit_array(data, num_iterations, min_date, tick_interval, pair) + pg = make_profit_array(data, num_iterations, min_date, tick_interval, [pair]) pair_profit = go.Scattergl( x=dates, y=pg,