Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions scripts/train_crypto_lora_sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ def consistency_score(self) -> float:
return self.mae_percent_mean + 0.5 * self.mae_percent_std + 0.3 * (self.mae_percent_max - self.mae_percent_mean)


def resolve_data_path(symbol: str, data_root: Path) -> Path:
"""Resolve the CSV data path for *symbol* within *data_root*.

Checks ``data_root/stocks/symbol.csv`` first (common mixed-hourly layout),
then falls back to ``data_root/symbol.csv``.
"""
stocks_candidate = data_root / "stocks" / f"{symbol}.csv"
if stocks_candidate.exists():
return stocks_candidate
return data_root / f"{symbol}.csv"


def load_hourly_frame(csv_path: Path) -> pd.DataFrame:
df = pd.read_csv(csv_path)
df["timestamp"] = pd.to_datetime(df["timestamp"], utc=True, errors="coerce")
Expand Down
3 changes: 3 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ def pytest_ignore_collect(collection_path, config):
"tests/test_chronos2_real_data.py",
"tests/test_critical_math.py",
"tests/test_forecast_cache_metrics.py",
"tests/test_jax_losses.py",
"tests/test_jax_policy.py",
"tests/test_jax_trainer_wandboard.py",
"tests/test_maxdiff_price_cache.py",
"tests/test_pctdiff_price_cache.py",
"tests/test_rl_trainingbinance.py",
Expand Down
Loading