Scoring a TEA domain also relates the association
The Calcular riesgos button runs the domain score job, which only scored the curves: the association scores that become the RiskAssessments were written by the tea_eeg job alone, so a platform driven from the buttons had champions and no risk analyses. The domain routine now ends with the association, score relates it, and the gold build after a score is the TEA selection that includes the association tables.
This commit is contained in:
@@ -111,7 +111,7 @@ def score_models(context: dg.OpExecutionContext, config: Scoring) -> dict:
|
||||
found = {name: jobs.score(name) for name in config.models or jobs.JOBS.routine()}
|
||||
for name, version in found.items():
|
||||
context.log.info(f"{name}: " + (f"version {version}" if version else "no champion"))
|
||||
silver.build([getattr(jobs, "GOLD", f"{config.domain}_risk") + "+"])
|
||||
silver.build(getattr(jobs, "GOLD_SELECT", [f"{config.domain}_risk+"]))
|
||||
return found
|
||||
|
||||
|
||||
|
||||
+3
-2
@@ -20,7 +20,6 @@ from persistance import cluster, eeg, registry, silver
|
||||
|
||||
ASSOCIATION = "ados2_association"
|
||||
MODELS = curves.SCENARIOS
|
||||
GOLD = "tea_eeg_metrics"
|
||||
GOLD_SELECT = [
|
||||
"tea_eeg_analyses+",
|
||||
"tea_eeg_metrics+",
|
||||
@@ -93,7 +92,7 @@ def _cohort(source: cluster.TrainingSource, as_of: date) -> tuple[str, list[dict
|
||||
@dataclass(frozen=True)
|
||||
class Jobs:
|
||||
def routine(self) -> list[str]:
|
||||
return list(MODELS)
|
||||
return [*MODELS, ASSOCIATION]
|
||||
|
||||
|
||||
JOBS = Jobs()
|
||||
@@ -265,6 +264,8 @@ def relate() -> int | None:
|
||||
|
||||
|
||||
def score(name: str) -> int | None:
|
||||
if name == ASSOCIATION:
|
||||
return relate()
|
||||
found = registry.champion(registered(name))
|
||||
if found is None:
|
||||
return None
|
||||
|
||||
@@ -5,6 +5,7 @@ import pytest
|
||||
from pydantic import ValidationError
|
||||
|
||||
from models.definitions import ScopeConfig, after_ingest
|
||||
from models.tea.jobs import ASSOCIATION, JOBS, MODELS
|
||||
from persistance import eeg
|
||||
|
||||
|
||||
@@ -36,6 +37,10 @@ def test_scope_validation():
|
||||
ScopeConfig(mode="first_n").model()
|
||||
|
||||
|
||||
def test_the_domain_routine_scores_the_curves_then_relates_the_association():
|
||||
assert JOBS.routine() == [*MODELS, ASSOCIATION]
|
||||
|
||||
|
||||
def test_after_ingest_requests_a_run_only_with_pending_eegs():
|
||||
skip = after_ingest("r1", lambda: False)
|
||||
assert isinstance(skip, dg.SkipReason)
|
||||
|
||||
Reference in New Issue
Block a user