from typing import Dict, Any from ..models import LocalProblem class BatteryAdapter: """Tiny adapter converting LocalProblem into a Battery-shared representation.""" def to_shared(self, lp: LocalProblem) -> Dict[str, Any]: return { "type": "Battery", "neighborhood_id": getattr(lp, "neighborhood_id", None), "demand_kw": getattr(lp, "demand_kw", 0.0), "pv_kw": getattr(lp, "pv_kw", 0.0), "storage_kwh": getattr(lp, "storage_kwh", 0.0), "evs": getattr(lp, "evs", 0), }