Merge pull request #4284 from freqtrade/windows_ci_error
Version bump numpy 1.20.0
This commit is contained in:
commit
f288ed1f36
@ -2,7 +2,7 @@
|
|||||||
# Downloaded from https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib
|
# Downloaded from https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib
|
||||||
# Invoke-WebRequest -Uri "https://download.lfd.uci.edu/pythonlibs/xxxxxxx/TA_Lib-0.4.17-cp37-cp37m-win_amd64.whl" -OutFile "TA_Lib-0.4.17-cp37-cp37m-win_amd64.whl"
|
# Invoke-WebRequest -Uri "https://download.lfd.uci.edu/pythonlibs/xxxxxxx/TA_Lib-0.4.17-cp37-cp37m-win_amd64.whl" -OutFile "TA_Lib-0.4.17-cp37-cp37m-win_amd64.whl"
|
||||||
|
|
||||||
python -m pip install --upgrade pip==21.0.0
|
python -m pip install --upgrade pip
|
||||||
|
|
||||||
$pyv = python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')"
|
$pyv = python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')"
|
||||||
|
|
||||||
|
@ -312,7 +312,7 @@ def calculate_market_change(data: Dict[str, pd.DataFrame], column: str = "close"
|
|||||||
end = df[column].dropna().iloc[-1]
|
end = df[column].dropna().iloc[-1]
|
||||||
tmp_means.append((end - start) / start)
|
tmp_means.append((end - start) / start)
|
||||||
|
|
||||||
return np.mean(tmp_means)
|
return float(np.mean(tmp_means))
|
||||||
|
|
||||||
|
|
||||||
def combine_dataframes_with_mean(data: Dict[str, pd.DataFrame],
|
def combine_dataframes_with_mean(data: Dict[str, pd.DataFrame],
|
||||||
|
@ -9,7 +9,6 @@ from pathlib import Path
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
from typing.io import IO
|
from typing.io import IO
|
||||||
|
|
||||||
import numpy as np
|
|
||||||
import rapidjson
|
import rapidjson
|
||||||
|
|
||||||
|
|
||||||
@ -28,20 +27,6 @@ def shorten_date(_date: str) -> str:
|
|||||||
return new_date
|
return new_date
|
||||||
|
|
||||||
|
|
||||||
############################################
|
|
||||||
# Used by scripts #
|
|
||||||
# Matplotlib doesn't support ::datetime64, #
|
|
||||||
# so we need to convert it into ::datetime #
|
|
||||||
############################################
|
|
||||||
def datesarray_to_datetimearray(dates: np.ndarray) -> np.ndarray:
|
|
||||||
"""
|
|
||||||
Convert an pandas-array of timestamps into
|
|
||||||
An numpy-array of datetimes
|
|
||||||
:return: numpy-array of datetime
|
|
||||||
"""
|
|
||||||
return dates.dt.to_pydatetime()
|
|
||||||
|
|
||||||
|
|
||||||
def file_dump_json(filename: Path, data: Any, is_zip: bool = False, log: bool = True) -> None:
|
def file_dump_json(filename: Path, data: Any, is_zip: bool = False, log: bool = True) -> None:
|
||||||
"""
|
"""
|
||||||
Dump JSON data into a file
|
Dump JSON data into a file
|
||||||
|
@ -378,7 +378,7 @@ class RPC:
|
|||||||
|
|
||||||
# Prepare data to display
|
# Prepare data to display
|
||||||
profit_closed_coin_sum = round(sum(profit_closed_coin), 8)
|
profit_closed_coin_sum = round(sum(profit_closed_coin), 8)
|
||||||
profit_closed_ratio_mean = mean(profit_closed_ratio) if profit_closed_ratio else 0.0
|
profit_closed_ratio_mean = float(mean(profit_closed_ratio) if profit_closed_ratio else 0.0)
|
||||||
profit_closed_ratio_sum = sum(profit_closed_ratio) if profit_closed_ratio else 0.0
|
profit_closed_ratio_sum = sum(profit_closed_ratio) if profit_closed_ratio else 0.0
|
||||||
|
|
||||||
profit_closed_fiat = self._fiat_converter.convert_amount(
|
profit_closed_fiat = self._fiat_converter.convert_amount(
|
||||||
@ -388,7 +388,7 @@ class RPC:
|
|||||||
) if self._fiat_converter else 0
|
) if self._fiat_converter else 0
|
||||||
|
|
||||||
profit_all_coin_sum = round(sum(profit_all_coin), 8)
|
profit_all_coin_sum = round(sum(profit_all_coin), 8)
|
||||||
profit_all_ratio_mean = mean(profit_all_ratio) if profit_all_ratio else 0.0
|
profit_all_ratio_mean = float(mean(profit_all_ratio) if profit_all_ratio else 0.0)
|
||||||
profit_all_ratio_sum = sum(profit_all_ratio) if profit_all_ratio else 0.0
|
profit_all_ratio_sum = sum(profit_all_ratio) if profit_all_ratio else 0.0
|
||||||
profit_all_fiat = self._fiat_converter.convert_amount(
|
profit_all_fiat = self._fiat_converter.convert_amount(
|
||||||
profit_all_coin_sum,
|
profit_all_coin_sum,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
numpy==1.19.5
|
numpy==1.20.0
|
||||||
pandas==1.2.1
|
pandas==1.2.1
|
||||||
|
|
||||||
ccxt==1.40.99
|
ccxt==1.40.99
|
||||||
|
@ -6,11 +6,9 @@ from unittest.mock import MagicMock
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from freqtrade.data.converter import ohlcv_to_dataframe
|
from freqtrade.misc import (file_dump_json, file_load_json, format_ms_time, pair_to_filename,
|
||||||
from freqtrade.misc import (datesarray_to_datetimearray, file_dump_json, file_load_json,
|
plural, render_template, render_template_with_fallback,
|
||||||
format_ms_time, pair_to_filename, plural, render_template,
|
safe_value_fallback, safe_value_fallback2, shorten_date)
|
||||||
render_template_with_fallback, safe_value_fallback,
|
|
||||||
safe_value_fallback2, shorten_date)
|
|
||||||
|
|
||||||
|
|
||||||
def test_shorten_date() -> None:
|
def test_shorten_date() -> None:
|
||||||
@ -19,22 +17,6 @@ def test_shorten_date() -> None:
|
|||||||
assert shorten_date(str_data) == str_shorten_data
|
assert shorten_date(str_data) == str_shorten_data
|
||||||
|
|
||||||
|
|
||||||
def test_datesarray_to_datetimearray(ohlcv_history_list):
|
|
||||||
dataframes = ohlcv_to_dataframe(ohlcv_history_list, "5m", pair="UNITTEST/BTC",
|
|
||||||
fill_missing=True)
|
|
||||||
dates = datesarray_to_datetimearray(dataframes['date'])
|
|
||||||
|
|
||||||
assert isinstance(dates[0], datetime.datetime)
|
|
||||||
assert dates[0].year == 2017
|
|
||||||
assert dates[0].month == 11
|
|
||||||
assert dates[0].day == 26
|
|
||||||
assert dates[0].hour == 8
|
|
||||||
assert dates[0].minute == 50
|
|
||||||
|
|
||||||
date_len = len(dates)
|
|
||||||
assert date_len == 2
|
|
||||||
|
|
||||||
|
|
||||||
def test_file_dump_json(mocker) -> None:
|
def test_file_dump_json(mocker) -> None:
|
||||||
file_open = mocker.patch('freqtrade.misc.open', MagicMock())
|
file_open = mocker.patch('freqtrade.misc.open', MagicMock())
|
||||||
json_dump = mocker.patch('rapidjson.dump', MagicMock())
|
json_dump = mocker.patch('rapidjson.dump', MagicMock())
|
||||||
|
Loading…
Reference in New Issue
Block a user