update config recording to use all configs, fix tests

This commit is contained in:
Timothy Pogue
2022-10-21 19:48:26 -06:00
parent a85826bf24
commit 5ee3b8cbbb
2 changed files with 28 additions and 14 deletions

View File

@@ -19,7 +19,7 @@ from tests.freqai.conftest import get_patched_freqai_strategy
def is_arm() -> bool:
machine = platform.machine()
return "arm" in machine or "aarch64" in machine
return "arm" in machine or "aarch74" in machine
def is_mac() -> bool:
@@ -160,12 +160,12 @@ def test_extract_data_and_train_model_Classifiers(mocker, freqai_conf, model):
@pytest.mark.parametrize(
"model, num_files, strat",
[
("LightGBMRegressor", 6, "freqai_test_strat"),
("XGBoostRegressor", 6, "freqai_test_strat"),
("CatboostRegressor", 6, "freqai_test_strat"),
("XGBoostClassifier", 6, "freqai_test_classifier"),
("LightGBMClassifier", 6, "freqai_test_classifier"),
("CatboostClassifier", 6, "freqai_test_classifier")
("LightGBMRegressor", 7, "freqai_test_strat"),
("XGBoostRegressor", 7, "freqai_test_strat"),
("CatboostRegressor", 7, "freqai_test_strat"),
("XGBoostClassifier", 7, "freqai_test_classifier"),
("LightGBMClassifier", 7, "freqai_test_classifier"),
("CatboostClassifier", 7, "freqai_test_classifier")
],
)
def test_start_backtesting(mocker, freqai_conf, model, num_files, strat, caplog):
@@ -200,6 +200,7 @@ def test_start_backtesting(mocker, freqai_conf, model, num_files, strat, caplog)
freqai.start_backtesting(df, metadata, freqai.dk)
model_folders = [x for x in freqai.dd.full_path.iterdir() if x.is_dir()]
# Changed from 6 to 7 because of the /configs directory
assert len(model_folders) == num_files
assert log_has_re(
"Removed features ",
@@ -234,7 +235,9 @@ def test_start_backtesting_subdaily_backtest_period(mocker, freqai_conf):
metadata = {"pair": "LTC/BTC"}
freqai.start_backtesting(df, metadata, freqai.dk)
model_folders = [x for x in freqai.dd.full_path.iterdir() if x.is_dir()]
assert len(model_folders) == 9
# Changed from 9 to 10 because of the /configs dir
assert len(model_folders) == 10
shutil.rmtree(Path(freqai.dk.full_path))
@@ -260,7 +263,7 @@ def test_start_backtesting_from_existing_folder(mocker, freqai_conf, caplog):
freqai.start_backtesting(df, metadata, freqai.dk)
model_folders = [x for x in freqai.dd.full_path.iterdir() if x.is_dir()]
assert len(model_folders) == 6
assert len(model_folders) == 7
# without deleting the existing folder structure, re-run