This commit is contained in:
2026-04-06 23:50:24 +03:30
parent a67236d45c
commit ff464cb4a5
140 changed files with 2061 additions and 2702 deletions
@@ -41,16 +41,6 @@ def _normalize_to_ideal_score(value: float | None, minimum: float, ideal: float,
def _resolve_profile(context: dict[str, Any]) -> tuple[dict[str, dict[str, float]], str]:
location = context.get("location")
if location is not None:
location_profile = getattr(location, "ideal_sensor_profile", None) or {}
if location_profile:
merged = {
metric: {**DEFAULT_IDEAL_SENSOR_PROFILE.get(metric, {}), **location_profile.get(metric, {})}
for metric in set(DEFAULT_IDEAL_SENSOR_PROFILE) | set(location_profile)
}
return merged, "location"
plants = context.get("plants", [])
for plant in plants:
plant_profile = getattr(plant, "health_profile", None) or {}