Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,10 @@ def plan_qc(repo: Path, candidate: dict, pass_date: str, out_dir: Path) -> dict:
clash = sorted(set(candidate["params"]) & set(QC_RESERVED_PARAMS))
if clash:
raise ValueError(f"{candidate['id']}: params {clash} are reserved for the replay dates")
names = [n for n in _git(repo, "ls-tree", "-r", "--name-only", candidate["sha"], "--",
project_dir).splitlines() if n.endswith(".py")]
# --full-tree : le chemin du point d'entree est relatif a la racine du depot, meme quand
# `repo` est un sous-dossier (la commande se lance depuis ML-Training-Pipeline/).
names = [n for n in _git(repo, "ls-tree", "-r", "--full-tree", "--name-only", candidate["sha"],
"--", project_dir).splitlines() if n.endswith(".py")]
if not names:
raise ValueError(f"{candidate['id']}: no .py file under {project_dir} at {candidate['sha'][:10]}")
target = out_dir / candidate["id"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,13 @@ def test_plan_qc_extracts_frozen_files(qc_repo, tmp_path):
assert json.loads((target / "plan.json").read_text(encoding="utf-8")) == plan


def test_plan_qc_resolves_the_entrypoint_from_the_repo_root(qc_repo, tmp_path):
# Le README lance la commande depuis un sous-dossier, avec --repo a sa valeur par defaut.
candidate = _qc_candidate(sha=_git(qc_repo, "rev-parse", "HEAD"))
plan = plan_qc(qc_repo / "qcproj" / "lib", candidate, "2025-11-14", tmp_path / "plans")
assert sorted(f["name"] for f in plan["files"]) == ["lib/signals.py", "main.py"]
assert (tmp_path / "plans" / "qc-demo" / "files" / "main.py").read_text(encoding="utf-8") == QC_V1

def test_plan_qc_rejects_reserved_params_and_empty_project(qc_repo, tmp_path):
sha = _git(qc_repo, "rev-parse", "HEAD")
reserved = _frozen(id="qc-demo", kind="qc", sha=sha, frozen_on="2025-10-01",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"candidates": [
{
"id": "mhm676",
"kind": "qc",
"sha": "bb7d7b61c5a48158d314693253c33b94a300cd35",
"frozen_on": "2026-10-05",
"entrypoint": "MyIA.AI.Notebooks/QuantConnect/projects/MultiHorizonMomentum676:37379584",
"params": {},
"fee_model": "modèle de frais par défaut de Lean pour ce courtier",
"fingerprint": "a8f44f3e52fc28d2"
}
]
}
Loading