fix(vision): traduce in inglese docstring e commenti di test_runner.py
R7: i commenti trascritti verbatim dal brief erano in italiano, contro il vincolo globale "comments in English". Solo prosa toccata - nomi dei test, assert, valori, struttura invariati. runner.py verificato: gia' in inglese, nessuna modifica.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""Il runner: grafo più immagine, numeri fuori. Niente HTTP, niente database."""
|
||||
"""The runner: graph plus image in, numbers out. No HTTP, no database."""
|
||||
import pytest
|
||||
|
||||
# The vision tree requires Python >=3.13 (vs-task/vs-measure/vs-pm2d declare it
|
||||
@@ -22,7 +22,7 @@ from src.vision.runner import RunOutcome, engine_version, run_graph
|
||||
|
||||
|
||||
def a_disc(radius: int = 60, size: int = 400) -> np.ndarray:
|
||||
"""Un disco chiaro su fondo scuro: un pezzo finto ma misurabile."""
|
||||
"""A light disc on a dark ground: a fake part, but a measurable one."""
|
||||
image = np.zeros((size, size), dtype=np.uint8)
|
||||
yy, xx = np.ogrid[:size, :size]
|
||||
centre = size // 2
|
||||
@@ -31,7 +31,7 @@ def a_disc(radius: int = 60, size: int = 400) -> np.ndarray:
|
||||
|
||||
|
||||
def a_circle_graph() -> dict:
|
||||
"""Un grafo di due strumenti, costruito con l'API di vs-task."""
|
||||
"""A two-tool graph, built with vs-task's own API."""
|
||||
from visionsuite.task import Task
|
||||
from visionsuite.task.tools import DetectCircleTool, DiameterTool
|
||||
|
||||
@@ -50,15 +50,15 @@ def test_the_graph_produces_named_outputs():
|
||||
|
||||
assert isinstance(outcome, RunOutcome)
|
||||
assert outcome.failures == []
|
||||
# Le chiavi sono «id dello strumento punto nome dell'uscita»: è la stessa
|
||||
# forma che la subtask salva in vision_output.
|
||||
# Keys are "tool id dot output name" - the same shape a subtask stores in
|
||||
# vision_output.
|
||||
assert any(key.endswith(".diameter") for key in outcome.outputs)
|
||||
diameter = next(v for k, v in outcome.outputs.items() if k.endswith(".diameter"))
|
||||
assert diameter == pytest.approx(120.0, abs=4.0)
|
||||
|
||||
|
||||
def test_a_broken_tool_does_not_sink_the_others():
|
||||
"""vs-task non ferma l'esecuzione su un errore: il runner lo riporta."""
|
||||
"""vs-task does not stop the run on an error: the runner reports it instead."""
|
||||
graph = a_circle_graph()
|
||||
graph["tools"].append(
|
||||
{"id": "ghost", "kind": "DetectCircle", "name": "assente",
|
||||
@@ -73,4 +73,4 @@ def test_a_broken_tool_does_not_sink_the_others():
|
||||
|
||||
def test_the_engine_says_which_version_it_is():
|
||||
version = engine_version()
|
||||
assert len(version) == 40 # un SHA di git, per intero
|
||||
assert len(version) == 40 # a full git SHA
|
||||
|
||||
Reference in New Issue
Block a user