Skip to content

Commit

Permalink
Fix mypy in scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Mar 23, 2019
1 parent 184b13f commit 83a2427
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
name: hyperopt
- script: flake8 freqtrade scripts
name: flake8
- script: mypy freqtrade
- script: mypy freqtrade scripts
name: mypy

- stage: docker
Expand Down
2 changes: 1 addition & 1 deletion docs/plotting.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
2 changes: 1 addition & 1 deletion scripts/plot_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions scripts/plot_profit.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# 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 []
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 83a2427

Please sign in to comment.