Clarify forecast model labels in dashboard
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
|
||||
from crypto_spot_bot.dashboard import _apply_fast_trading
|
||||
from crypto_spot_bot.dashboard import _safe_config
|
||||
from crypto_spot_bot.storage import Storage
|
||||
|
||||
|
||||
@@ -15,3 +18,32 @@ def test_apply_fast_trading_updates_runtime_and_env(make_settings, tmp_path) ->
|
||||
assert settings.fast_trading_enabled is True
|
||||
assert storage.get_runtime("fast_trading_enabled") is True
|
||||
assert "FAST_TRADING_ENABLED=true" in settings.env_file_path.read_text(encoding="utf-8")
|
||||
|
||||
|
||||
def test_safe_config_summarizes_torch_forecast_artifact(make_settings, tmp_path) -> None:
|
||||
artifact_path = tmp_path / "lstm_forecaster.json"
|
||||
artifact_path.write_text(
|
||||
json.dumps(
|
||||
{
|
||||
"type": "pytorch_recurrent_forecaster",
|
||||
"created_at": "2026-06-20T18:15:05+00:00",
|
||||
"symbols": {
|
||||
"BTCUSDT": {"model": "torch_lstm"},
|
||||
"ETHUSDT": {"model": "torch_gru"},
|
||||
},
|
||||
}
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
settings = make_settings(tmp_path, time_series_lstm_model_path=artifact_path)
|
||||
|
||||
config = _safe_config(settings)
|
||||
|
||||
assert config["time_series_model_artifact"] == {
|
||||
"available": True,
|
||||
"type": "pytorch_recurrent_forecaster",
|
||||
"label": "PyTorch LSTM/GRU",
|
||||
"created_at": "2026-06-20T18:15:05+00:00",
|
||||
"symbol_count": 2,
|
||||
"models": ["PyTorch GRU", "PyTorch LSTM"],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user