cleanup tests, cross fingers that mac will pass

This commit is contained in:
robcaulk 2023-05-17 07:21:48 +00:00
parent 7d15c379cb
commit adeab13bdf
4 changed files with 4 additions and 12 deletions

View File

@ -2,7 +2,7 @@ import logging
from pathlib import Path
from typing import Any
import xgboost as xgb
from xgboost.callback import TrainingCallback
logger = logging.getLogger(__name__)
@ -20,14 +20,14 @@ class BaseTensorboardLogger:
return
class BaseTensorBoardCallback(xgb.callback.TrainingCallback):
class BaseTensorBoardCallback(TrainingCallback):
def __init__(self, logdir: Path, activate: bool = True):
logger.warning("Tensorboard is not installed, no logs will be written."
"Ensure torch is installed, or use the torch/RL docker images")
def after_iteration(
self, model, epoch: int, evals_log: xgb.callback.TrainingCallback.EvalsLog
self, model, epoch: int, evals_log: TrainingCallback.EvalsLog
) -> bool:
return False

View File

@ -42,6 +42,7 @@ def freqai_conf(default_conf, tmpdir):
"identifier": "uniqe-id100",
"live_trained_timestamp": 0,
"data_kitchen_thread_count": 2,
"activate_tensorboard": False,
"feature_parameters": {
"include_timeframes": ["5m"],
"include_corr_pairlist": ["ADA/BTC"],

View File

@ -183,7 +183,6 @@ def test_get_full_model_path(mocker, freqai_conf, model):
strategy.freqai_info = freqai_conf.get("freqai", {})
freqai = strategy.freqai
freqai.live = True
freqai.activate_tensorboard = False
freqai.dk = FreqaiDataKitchen(freqai_conf)
freqai.dk.live = True
timerange = TimeRange.parse_timerange("20180110-20180130")

View File

@ -36,9 +36,6 @@ def can_run_model(model: str) -> None:
if is_pytorch_model and is_mac() and not is_arm():
pytest.skip("Reinforcement learning / PyTorch module not available on intel based Mac OS.")
if "XGBoost" in model and is_mac():
pytest.skip("Mac github CI does not have enough memory/threads to run this test.")
@pytest.mark.parametrize('model, pca, dbscan, float32, can_short, shuffle, buffer', [
('LightGBMRegressor', True, False, True, True, False, 0),
@ -147,7 +144,6 @@ def test_extract_data_and_train_model_MultiTargets(mocker, freqai_conf, model, s
strategy.freqai_info = freqai_conf.get("freqai", {})
freqai = strategy.freqai
freqai.live = True
freqai.activate_tensorboard = False
freqai.dk = FreqaiDataKitchen(freqai_conf)
freqai.dk.live = True
timerange = TimeRange.parse_timerange("20180110-20180130")
@ -192,7 +188,6 @@ def test_extract_data_and_train_model_Classifiers(mocker, freqai_conf, model):
strategy.freqai_info = freqai_conf.get("freqai", {})
freqai = strategy.freqai
freqai.live = True
freqai.activate_tensorboard = False
freqai.dk = FreqaiDataKitchen(freqai_conf)
freqai.dk.live = True
timerange = TimeRange.parse_timerange("20180110-20180130")
@ -322,7 +317,6 @@ def test_start_backtesting_subdaily_backtest_period(mocker, freqai_conf):
strategy.freqai_info = freqai_conf.get("freqai", {})
freqai = strategy.freqai
freqai.live = False
freqai.activate_tensorboard = False
freqai.dk = FreqaiDataKitchen(freqai_conf)
timerange = TimeRange.parse_timerange("20180110-20180130")
freqai.dd.load_all_pair_histories(timerange, freqai.dk)
@ -442,7 +436,6 @@ def test_principal_component_analysis(mocker, freqai_conf):
strategy.freqai_info = freqai_conf.get("freqai", {})
freqai = strategy.freqai
freqai.live = True
freqai.activate_tensorboard = False
freqai.dk = FreqaiDataKitchen(freqai_conf)
freqai.dk.live = True
timerange = TimeRange.parse_timerange("20180110-20180130")
@ -476,7 +469,6 @@ def test_plot_feature_importance(mocker, freqai_conf):
strategy.freqai_info = freqai_conf.get("freqai", {})
freqai = strategy.freqai
freqai.live = True
freqai.activate_tensorboard = False
freqai.dk = FreqaiDataKitchen(freqai_conf)
freqai.dk.live = True
timerange = TimeRange.parse_timerange("20180110-20180130")