tenseleyflow/sway / 79552fe

Browse files

sway: thread typed Section through RunContext + runner

Authored by espadonne
SHA
79552feb88edb4918768a3d3fb5057712ec6dd90
Parents
31ea572
Tree
2695e0d

2 changed files

StatusFile+-
M src/dlm_sway/probes/base.py 2 1
M src/dlm_sway/suite/runner.py 3 3
src/dlm_sway/probes/base.pymodified
@@ -24,6 +24,7 @@ from pydantic import BaseModel, ConfigDict, ValidationError
2424
 from dlm_sway.core.errors import SpecValidationError
2525
 from dlm_sway.core.result import ProbeResult
2626
 from dlm_sway.core.scoring import DifferentialBackend
27
+from dlm_sway.core.sections import Section
2728
 
2829
 
2930
 class ProbeSpec(BaseModel):
@@ -70,7 +71,7 @@ class RunContext:
7071
     backend: DifferentialBackend
7172
     seed: int = 0
7273
     top_k: int = 256
73
-    sections: tuple[Any, ...] | None = None
74
+    sections: tuple[Section, ...] | None = None
7475
     doc_text: str | None = None
7576
     null_stats: dict[str, dict[str, float]] = field(default_factory=dict)
7677
 
src/dlm_sway/suite/runner.pymodified
@@ -19,12 +19,12 @@ Runtime contract:
1919
 from __future__ import annotations
2020
 
2121
 import time
22
-from typing import Any
2322
 
2423
 from dlm_sway import __version__
2524
 from dlm_sway.core.errors import ProbeError
2625
 from dlm_sway.core.result import ProbeResult, SuiteResult, Verdict, utcnow
2726
 from dlm_sway.core.scoring import DifferentialBackend
27
+from dlm_sway.core.sections import Section
2828
 from dlm_sway.probes.base import RunContext, build_probe
2929
 from dlm_sway.probes.null_adapter import NullAdapterSpec, get_null_stats
3030
 from dlm_sway.suite.spec import SwaySpec
@@ -36,7 +36,7 @@ def run(
3636
     *,
3737
     spec_path: str = "<memory>",
3838
     doc_text: str | None = None,
39
-    sections: tuple[Any, ...] | None = None,
39
+    sections: tuple[Section, ...] | None = None,
4040
 ) -> SuiteResult:
4141
     """Execute every probe in ``spec`` against ``backend``."""
4242
     started = utcnow()
@@ -133,4 +133,4 @@ def _with_duration(result: ProbeResult, duration: float) -> ProbeResult:
133133
     )
134134
 
135135
 
136
-__all__ = ["run", "get_null_stats"]
136
+__all__ = ["get_null_stats", "run"]