Skip to content

Commit ccbc91e

Browse files
committed
ci: add ruff validation for research pipeline
1 parent eab39fd commit ccbc91e

File tree

6 files changed

+14
-5
lines changed

6 files changed

+14
-5
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ jobs:
2424
if [ ! -f "$REQ_FILE" ]; then REQ_FILE="requirements.txt"; fi
2525
python -m pip install --upgrade pip
2626
python -m pip install -r "$REQ_FILE"
27+
python -m pip install ruff
28+
29+
- name: Run ruff
30+
run: |
31+
set -euo pipefail
32+
ruff check .
2733
2834
- name: Run unit tests
2935
run: |

.ruff.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
target-version = "py311"
2+
3+
[lint.per-file-ignores]
4+
"scripts/*.py" = ["E402"]

scripts/sweep_external_data_profiles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def main() -> None:
251251

252252
scored_external = run_variant_scoring(profile_cfg)
253253
evaluation_start = max(scored_binance["first_scored_date"], scored_external["first_scored_date"])
254-
result = evaluate_variant(profile, profile_cfg, scored_external, evaluation_start)
254+
evaluate_variant(profile, profile_cfg, scored_external, evaluation_start)
255255
summary_rows.append(
256256
load_profile_row(
257257
profile,

src/backtest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
from dataclasses import dataclass
4-
from typing import Any, Optional
4+
from typing import Any
55

66
import numpy as np
77
import pandas as pd

src/pipeline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import pandas as pd
77

8-
from .backtest import build_walkforward_windows, run_backtest_suite, run_walkforward_scoring
8+
from .backtest import run_backtest_suite, run_walkforward_scoring
99
from .evaluation import evaluate_leader_selection, leader_metrics_to_frame
1010
from .external_data import load_optional_market_cap_metadata, merge_histories_with_external
1111
from .export import export_latest_ranking, export_latest_universe, export_live_pool
@@ -384,7 +384,7 @@ def build_live_pool_outputs(
384384

385385
output_dir = config["paths"].output_dir
386386
export_latest_universe(panel, output_dir, latest_date)
387-
ranking_snapshot = export_latest_ranking(panel, output_dir, latest_date)
387+
export_latest_ranking(panel, output_dir, latest_date)
388388
latest_snapshot = latest_ranking_snapshot(panel, latest_date)
389389
live_payload = export_live_pool(
390390
ranking_snapshot=latest_snapshot.loc[latest_snapshot["selected_flag"] | latest_snapshot["in_universe"]],

src/portfolio.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from typing import Iterable
44

5-
import numpy as np
65
import pandas as pd
76

87

0 commit comments

Comments
 (0)