Skip to content

Commit f9d0410

Browse files
Merge pull request #1 from gvpathisocial/reeng/uplift-studio-bg-20260220_101657
Reeng/uplift studio bg 20260220 101657
2 parents 21e2438 + 65600d4 commit f9d0410

113 files changed

Lines changed: 10925 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: quant-daily-dry-run
2+
3+
on:
4+
schedule:
5+
- cron: "30 5 * * *"
6+
workflow_dispatch:
7+
8+
jobs:
9+
dry-run:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v5
13+
14+
- uses: actions/setup-python@v6
15+
with:
16+
python-version: "3.11"
17+
18+
- name: install uv
19+
uses: astral-sh/setup-uv@v6
20+
21+
- name: install dependencies
22+
run: uv pip install .[dev,forecasting,quant]
23+
24+
- name: run daily dry-run via CLI
25+
run: |
26+
python -m sktime_quant.run \
27+
--config examples/quant/config_dry_run.yaml \
28+
--dry-run \
29+
--print-summary
30+
31+
- name: upload dry-run artifacts
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: quant-dry-run-artifacts
35+
path: |
36+
results/dry_run/reports/**
37+
results/dry_run/orders/**
38+
results/dry_run/governance/**
39+
results/dry_run/state/**
40+
if-no-files-found: warn

.github/workflows/test_quant.yml

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
name: test-quant
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
paths:
7+
- "sktime_quant/**"
8+
- "docs/source/quant/**"
9+
- "examples/quant/**"
10+
- ".github/workflows/test_quant.yml"
11+
- "pyproject.toml"
12+
push:
13+
branches: [main]
14+
paths:
15+
- "sktime_quant/**"
16+
- "docs/source/quant/**"
17+
- "examples/quant/**"
18+
- ".github/workflows/test_quant.yml"
19+
- "pyproject.toml"
20+
21+
jobs:
22+
quant-unit-tests:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v5
26+
27+
- uses: actions/setup-python@v6
28+
with:
29+
python-version: "3.11"
30+
31+
- name: install uv
32+
uses: astral-sh/setup-uv@v6
33+
34+
- name: install dependencies
35+
run: uv pip install .[dev,forecasting,quant]
36+
37+
- name: run sktime_quant tests (without timescale integration)
38+
run: python -m pytest sktime_quant/tests -o addopts="" -m "not integration"
39+
40+
- name: run quant core strategy/performance regression tests
41+
run: |
42+
python -m pytest \
43+
sktime_quant/tests/test_walkforward.py \
44+
sktime_quant/tests/test_risk_metrics.py \
45+
sktime_quant/tests/test_forecast_engine_update.py \
46+
-o addopts=""
47+
48+
quant-timescale-integration:
49+
runs-on: ubuntu-latest
50+
services:
51+
timescaledb:
52+
image: timescale/timescaledb:latest-pg16
53+
ports:
54+
- 5432:5432
55+
env:
56+
POSTGRES_DB: postgres
57+
POSTGRES_USER: postgres
58+
POSTGRES_PASSWORD: postgres
59+
options: >-
60+
--health-cmd "pg_isready -U postgres -d postgres"
61+
--health-interval 10s
62+
--health-timeout 5s
63+
--health-retries 10
64+
65+
steps:
66+
- uses: actions/checkout@v5
67+
68+
- uses: actions/setup-python@v6
69+
with:
70+
python-version: "3.11"
71+
72+
- name: install uv
73+
uses: astral-sh/setup-uv@v6
74+
75+
- name: install dependencies
76+
run: uv pip install .[dev,forecasting,quant]
77+
78+
- name: run timescale integration test
79+
env:
80+
RUN_TIMESCALE_TESTS: "1"
81+
TIMESCALE_TEST_URI: "postgresql+psycopg://postgres:postgres@localhost:5432/postgres"
82+
run: python -m pytest sktime_quant/tests/test_timescale_integration.py -o addopts=""
83+
84+
quant-cli-smoke:
85+
runs-on: ubuntu-latest
86+
steps:
87+
- uses: actions/checkout@v5
88+
89+
- uses: actions/setup-python@v6
90+
with:
91+
python-version: "3.11"
92+
93+
- name: install uv
94+
uses: astral-sh/setup-uv@v6
95+
96+
- name: install dependencies
97+
run: uv pip install .[dev,forecasting,quant]
98+
99+
- name: run CLI smoke test
100+
run: |
101+
python - <<'PY'
102+
import pandas as pd
103+
from pathlib import Path
104+
import yaml
105+
import subprocess
106+
import sys
107+
108+
base = Path("tmp_quant_cli")
109+
base.mkdir(exist_ok=True)
110+
market = pd.DataFrame({
111+
"timestamp": list(pd.date_range("2023-01-01", periods=160, freq="D")) * 2,
112+
"asset": ["A"] * 160 + ["B"] * 160,
113+
"close": [100 + i * 0.1 for i in range(160)] + [200 + i * 0.05 for i in range(160)],
114+
})
115+
csv_path = base / "market.csv"
116+
market.to_csv(csv_path, index=False)
117+
118+
cfg = {
119+
"run_id": "ci_cli",
120+
"data": {"source_type": "csv", "csv_path": str(csv_path)},
121+
"backtest": {"window_length": 60, "step_length": 10, "horizon": 1},
122+
"execution": {"output_dir": str(base / "results")},
123+
}
124+
cfg_path = base / "config.yaml"
125+
cfg_path.write_text(yaml.safe_dump(cfg), encoding="utf-8")
126+
127+
proc = subprocess.run(
128+
[sys.executable, "-m", "sktime_quant.run", "--config", str(cfg_path)],
129+
check=False,
130+
capture_output=True,
131+
text=True,
132+
)
133+
print(proc.stdout)
134+
print(proc.stderr)
135+
raise SystemExit(proc.returncode)
136+
PY
137+
138+
quant-example-smoke:
139+
runs-on: ubuntu-latest
140+
steps:
141+
- uses: actions/checkout@v5
142+
143+
- uses: actions/setup-python@v6
144+
with:
145+
python-version: "3.11"
146+
147+
- name: install uv
148+
uses: astral-sh/setup-uv@v6
149+
150+
- name: install dependencies
151+
run: uv pip install .[dev,forecasting,quant]
152+
153+
- name: run example smoke
154+
run: python examples/quant/01_quickstart_csv.py
155+
156+
quant-docs-smoke:
157+
runs-on: ubuntu-latest
158+
steps:
159+
- uses: actions/checkout@v5
160+
161+
- uses: actions/setup-python@v6
162+
with:
163+
python-version: "3.11"
164+
165+
- name: install uv
166+
uses: astral-sh/setup-uv@v6
167+
168+
- name: install dependencies
169+
run: uv pip install .[docs,forecasting,quant]
170+
171+
- name: build docs
172+
run: |
173+
make -C docs/source html SPHINXOPTS="-W --keep-going"
174+
175+
quant-docs-linkcheck:
176+
runs-on: ubuntu-latest
177+
steps:
178+
- uses: actions/checkout@v5
179+
180+
- uses: actions/setup-python@v6
181+
with:
182+
python-version: "3.11"
183+
184+
- name: install uv
185+
uses: astral-sh/setup-uv@v6
186+
187+
- name: install dependencies
188+
run: uv pip install .[docs,forecasting,quant]
189+
190+
- name: run linkcheck for quant docs
191+
run: |
192+
sphinx-build -b linkcheck \
193+
-D master_doc=quant/index \
194+
-D linkcheck_timeout=15 \
195+
-D linkcheck_retries=2 \
196+
-D linkcheck_workers=5 \
197+
docs/source docs/build/linkcheck

Makefile

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ DOC_DIR=./docs
88
BUILD_TOOLS=./build_tools
99
TEST_DIR=testdir
1010

11-
.PHONY: help release install test lint clean dist doc docs
11+
.PHONY: help release install test lint clean dist doc docs test_quant test_quant_core test_quant_strategy test_quant_timescale_container
1212

1313
.DEFAULT_GOAL := help
1414

@@ -76,6 +76,24 @@ test_mlflow: ## Run mlflow integration tests
7676

7777
tests: test
7878

79+
test_quant: ## Run sktime_quant tests excluding integration markers
80+
python -m pytest sktime_quant/tests -o addopts="" -m "not integration"
81+
82+
test_quant_core: ## Run core quant strategy/performance tests (walkforward + risk metrics + forecast update)
83+
python -m pytest \
84+
sktime_quant/tests/test_walkforward.py \
85+
sktime_quant/tests/test_risk_metrics.py \
86+
sktime_quant/tests/test_forecast_engine_update.py \
87+
-o addopts=""
88+
89+
test_quant_strategy: ## Run blended strategy engine tests (rule DSL + classifier + blending)
90+
python -m pytest \
91+
sktime_quant/tests/test_strategy_engine.py \
92+
-o addopts=""
93+
94+
test_quant_timescale_container: ## Run TimescaleDB container integration test (requires Docker)
95+
RUN_TIMESCALE_CONTAINER_TESTS=1 python -m pytest sktime_quant/tests/test_timescale_container_integration.py -o addopts=""
96+
7997
clean: ## Clean build dist and egg directories left after install
8098
rm -rf ./dist
8199
rm -rf ./build

0 commit comments

Comments
 (0)