This commit is contained in:
2026-04-30 02:10:15 +03:30
parent 46ba01e4cc
commit e2c70ec8b6
5 changed files with 141 additions and 94 deletions
+9 -4
View File
@@ -2,7 +2,12 @@ from __future__ import annotations
from typing import Any
from .growth_simulation import CurrentFarmChartSimulator, GrowthSimulationError
from .growth_simulation import (
CurrentFarmChartSimulator,
GrowthSimulationError,
_fa_engine_name,
_fa_model_name,
)
def build_yield_prediction_payload(*, farm_uuid: str, plant_name: str | None = None) -> dict[str, Any]:
@@ -16,9 +21,9 @@ def build_yield_prediction_payload(*, farm_uuid: str, plant_name: str | None = N
"predictedYieldTons": predicted_yield_tons,
"predictedYieldRaw": round(yield_estimate, 2),
"unit": "تن",
"sourceUnit": "kg/ha",
"simulationEngine": result.get("engine"),
"simulationModel": result.get("model_name"),
"sourceUnit": "کیلوگرم در هکتار",
"simulationEngine": _fa_engine_name(result.get("engine")),
"simulationModel": _fa_model_name(result.get("model_name")),
"scenarioId": result.get("scenario_id"),
"simulationWarning": result.get("simulation_warning"),
"supportingMetrics": result.get("metrics") or {},