English names: orchestration (cycle, context, runner, repositories), its steps, fields and CLI, recomputation, follow_up and reports
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
"""Lo que el ciclo necesita saber de las definiciones de un proyecto: sus periodos (dbt) y sus cohortes (el kit)."""
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
from indicadores_kit.oro.cohortes.definicion import RAIZ
|
||||
|
||||
|
||||
def period_types(proyecto: str, manifest: Path) -> list[str]:
|
||||
"""The period types the project's measures publish, from their `meta.tipos_periodo` in dbt's manifest."""
|
||||
metrics = json.loads(manifest.read_text(encoding="utf-8"))["metrics"].values()
|
||||
return sorted({t for m in metrics for t in m["config"].get("meta", {}).get("tipos_periodo", [])
|
||||
if m["config"]["meta"].get("measure_url", "").startswith(f"{proyecto}/")})
|
||||
|
||||
|
||||
def cohort_definitions(proyecto: str) -> list[Path]:
|
||||
"""Los TOML de cohortes que el ciclo arma (`<proyecto>/cohortes/*.toml`): hoy solo CaCu (vigilancia). Las de `cohortes/propuestas/` no (T-21h)."""
|
||||
return sorted((RAIZ / proyecto / "cohortes").glob("*.toml"))
|
||||
Reference in New Issue
Block a user