Update app.py
Browse files3 unmodified lines456789104 unmodified lines151617181920216 unmodified lines28293031323334356 unmodified lines42434445464748495051525354555657585960616263646566676869707172735 unmodified lines798081828384853 unmodified lines8990919293949596979813 unmodified lines1121131141151161171181191201211221231243 unmodified lines1281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142153 unmodified lines2192202212222232242252262272282292302312322332342352362372382392402412422432442452462472483 unmodified lines2522532542552562572582592602612622 unmodified lines2652662672682692702712722732742752762772782792802812822832842853 unmodified linesfrom typing import Dict, Tuple, List# ==============================================================================# 1. ESPECIFICACIONES: HUSQVARNA HC3 (2023)# ==============================================================================@dataclass(frozen=True)4 unmodified lines# BATERÍA (Simplo Core S1+)CAPACIDAD_NOMINAL_AH: float = 17.5VOLTAJE_NOMINAL: float = 36.0BUFFER_SEGURIDAD_BMS: float = 0.05 # 5% Reserva intocable# FÍSICA USUARIOPESO_BICI_KG: float = 24.56 unmodified linesOCV_CURVE_X: Tuple[float, ...] = (0.0, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 1.0)OCV_CURVE_Y: Tuple[float, ...] = (31.0, 32.5, 34.0, 35.1, 35.8, 36.3, 36.7, 37.2, 38.0, 39.2, 40.8, 41.5, 42.0)# PERFILES (EP6 TUNED)# [Nm, Wh/km, %Asist, Eficiencia]PERFILES_TORQUE: Dict[str, List[float]] = field(default_factory=lambda: {'ECO (Nvl 1)': [27, 5.0, 0.40, 0.96],'Nivel 2': [34, 6.8, 0.50, 0.95],6 unmodified linesSPECS = BatterySpecs()# ==============================================================================# 2. MOTOR FÍSICO (SIMULACIÓN DE CARGA EN TRASTERO)# ==============================================================================def get_voltage(soc: float) -> float:return float(np.interp(soc, SPECS.OCV_CURVE_X, SPECS.OCV_CURVE_Y))def calcular_soh(km: float) -> float:ciclos = max(0.0, float(km) / 75.0)degradacion = (0.03 * (1 - np.exp(-0.05 * ciclos))) + (0.0002 * ciclos)return max(0.60, min(1.0, 1.0 - degradacion))def factor_temperatura_descarga(temp_exterior: float) -> float:"""Penalización de autonomía por frío EXTERIOR (Voltage Sag)"""if temp_exterior >= 20: return 1.0if temp_exterior >= 10: return 0.98if temp_exterior >= 5: return 0.95 # -5%if temp_exterior >= 0: return 0.90 # -10% (Típico invierno)if temp_exterior >= -5: return 0.82 # -18%return 0.70 # Congelación# --- SIMULADOR DE CARGA (Usa Temperatura del Trastero) ---def simulador_carga_v39(km, inicio, fin, temp_trastero):if inicio >= fin:return {"estado": "CARGADO", "soh": calcular_soh(km)}# El BMS protege la carga si el TRASTERO está helado, no la calle.if temp_trastero < -5 or temp_trastero > 50:return {"estado": "ERROR_TEMP"}5 unmodified linest_min = 0.0e_wh = 0.0# Arrhenius usando temp_trastero (Probablemente cálido)if temp_trastero < 15: f_temp = max(0.15, 0.4 + (0.04 * temp_trastero))elif temp_trastero > 35: f_temp = 0.92else: f_temp = 1.03 unmodified lineswhile ah_actual < ah_objetivo:soc_t0 = ah_actual / cap_totalv_t0 = get_voltage(soc_t0)i_target = SPECS.AMPERAJE_CARGADOR * f_temp# CC/CV Logicif v_t0 >= (42.0 - 0.2):diff = v_t0 - (42.0 - 0.6)i_real = i_target * np.exp(-3.5 * max(0, diff))13 unmodified lineselse:t_step = 1.0ah_next = ah_actual + delta_ahv_t1 = get_voltage(ah_next / cap_total)v_avg = (v_t0 + v_t1) / 2delta_wh = delta_ah * v_avgah_actual += delta_ahe_wh += delta_wht_min += t_stepif fin_ciclo: break3 unmodified lines"tiempo": t_min,"energia": e_wh,"cap_final_wh": ah_actual * SPECS.VOLTAJE_NOMINAL,"soc_final": (ah_actual / cap_total) * 100.0}# ==============================================================================# 3. RENDERIZADOR VISUAL (HTML5 NATIVO iOS)# ==============================================================================def generar_vista_final(km_val, temp_trastero, temp_ruta, elev_val, peso_piloto, inicio_val, fin_val):try:# 1. Simular Carga (EN TRASTERO)res = simulador_carga_v39(float(km_val), float(inicio_val), float(fin_val), float(temp_trastero))if res["estado"] == "ERROR_TEMP":return "<div style='background:#fee2e2; padding:20px; color:#991b1b; text-align:center;'>⛔ <b>ERROR:</b> Trastero demasiado frío/caliente para cargar.</div>"# 2. Datos de Energíaif res["estado"] == "CARGADO":soh = res["soh"]cap_bruta = (SPECS.CAPACIDAD_NOMINAL_AH * soh * SPECS.VOLTAJE_NOMINAL) * (float(inicio_val)/100.0)tiempo_txt = "LISTA"energia_txt = "0 Wh"else:cap_bruta = res['cap_final_wh']h, m = divmod(int(res["tiempo"]), 60)tiempo_txt = f"{h}h {m}m"energia_txt = f"+{res['energia']:.0f} Wh"# 3. CÁLCULO DE AUTONOMÍA (EN RUTA)cap_util_teorica = cap_bruta * (1.0 - SPECS.BUFFER_SEGURIDAD_BMS)# Factor Térmico de RUTA (Aquí afecta el frío de fuera)f_clima = factor_temperatura_descarga(float(temp_ruta))cap_util_real = cap_util_teorica * f_climaif cap_util_real < 0: cap_util_real = 0# Física de Peso y Gravedadmasa_total = SPECS.PESO_BICI_KG + float(peso_piloto) + SPECS.PESO_EQUIPO_KGg = 9.81julios_totales = masa_total * g * float(elev_val)wh_gravedad_bruto = julios_totales / 3600.0# --- HTML BUILDER ---html = f"""<div style="font-family: -apple-system, system-ui, sans-serif; max-width: 450px; margin: auto; color: #111827;"><div style="background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); color: white; padding: 24px; border-radius: 20px; text-align: center; box-shadow: 0 10px 20px -5px rgba(124, 58, 237, 0.4); margin-bottom: 16px;"><div style="font-size: 11px; font-weight: 700; opacity: 0.9; letter-spacing: 1px; text-transform: uppercase;">TIEMPO DE CARGA ({int(temp_trastero)}°C)</div><div style="font-size: 44px; font-weight: 800; letter-spacing: -1.5px; line-height: 1;">{tiempo_txt}</div><div style="margin-top:8px;"><span style="background: rgba(255,255,255,0.25); font-size: 13px; padding: 4px 12px; border-radius: 99px; font-weight: 600;">⚡ {energia_txt}</span></div></div><div style="display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px;"><div style="background: #f8fafc; padding: 14px; border-radius: 16px; border: 1px solid #e2e8f0; text-align:center;"><div style="font-size: 10px; color: #64748b; font-weight: 700; text-transform:uppercase;">Peso Total</div><div style="font-size: 18px; font-weight: 800; color: #334155;">{masa_total:.1f} <span style="font-size:12px">kg</span></div></div><div style="background: #f8fafc; padding: 14px; border-radius: 16px; border: 1px solid #e2e8f0; text-align:center;"><div style="font-size: 10px; color: #64748b; font-weight: 700; text-transform:uppercase;">Meta Desnivel</div><div style="font-size: 18px; font-weight: 800; color: #334155;">{int(float(elev_val))} <span style="font-size:12px">m</span></div></div></div>"""# AVISO DE CLIMA (Solo si hace frío FUERA)if f_clima < 1.0:perdida = int((1.0 - f_clima) * 100)html += f"""<div style="background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; padding: 12px 15px; border-radius: 12px; margin-bottom: 16px; font-size: 12px; display:flex; align-items:center;"><span style="font-size:18px; margin-right:10px;">❄️</span><div><b>Ruta Fría ({float(temp_ruta)}°C):</b><br>Autonomía reducida un <b>{perdida}%</b> por eficiencia química.</div></div>"""html += """<div style="background: white; border: 1px solid #e2e8f0; border-radius: 20px; overflow: hidden; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);"><div style="padding: 12px 20px; background: #f8fafc; border-bottom: 1px solid #f1f5f9; font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px;">Autonomía Real Estimada</div>"""3 unmodified linesfactor_asist = specs_modo[2]efic_termica = specs_modo[3]coste_gravedad = wh_gravedad_bruto * factor_asist * (1.0 / efic_termica)wh_rodadura = cap_util_real - coste_gravedadif wh_rodadura > 0:distancia = int(wh_rodadura / consumo_llano)color = "#16a34a" if distancia > 25 else "#d97706" if distancia > 10 else "#dc2626"html += f"""<div style="padding: 14px 20px; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center;"><div><div style="font-size: 14px; font-weight: 700; color: #1f2937;">{modo}</div><div style="font-size: 10px; color: #94a3b8; font-weight: 500;">-{int(coste_gravedad)} Wh subida</div></div><div style="font-size: 18px; font-weight: 800; color: {color};">{distancia} km</div></div>"""else:max_subida = int(float(elev_val) * (cap_util_real / coste_gravedad))html += f"""<div style="padding: 14px 20px; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; background: #fef2f2;"><div><div style="font-size: 14px; font-weight: 700; color: #991b1b;">{modo}</div><div style="font-size: 10px; color: #b91c1c;">⚠️ Límite subida: {max_subida}m</div></div><div style="font-size: 18px; font-weight: 800; color: #ef4444;">0 km</div></div>"""html += "</div></div>"3 unmodified linesreturn f"Error: {str(e)}"# ==============================================================================# 4. UI V39 (DOBLE TEMPERATURA)# ==============================================================================with gr.Blocks(title="Husqvarna V39", css="footer {display: none !important;}") as app:gr.Markdown("### ⚡ Husqvarna HC3 | Dual Climate V39")with gr.Row():with gr.Column():2 unmodified linesinp_elev = gr.Slider(0, 3000, value=1000, label="Desnivel Objetivo (m)", step=50)gr.Markdown("---")# --- NUEVO: DOBLE TEMPERATURA ---with gr.Row():inp_temp_carga = gr.Slider(-5, 40, value=20, label="Temp. Trastero (Carga)")inp_temp_ruta = gr.Slider(-10, 40, value=5, label="Temp. Exterior (Ruta)")inp_inicio = gr.Slider(0, 99, value=20, label="% Batería ACTUAL")inp_fin = gr.Slider(1, 100, value=100, label="% Batería OBJETIVO")btn = gr.Button("EJECUTAR SIMULACIÓN", variant="primary")with gr.Column():out = gr.HTML(label="Dashboard")btn.click(fn=generar_vista_final,inputs=[inp_km, inp_temp_carga, inp_temp_ruta, inp_elev, inp_peso, inp_inicio, inp_fin],outputs=out)3 unmodified lines456789104 unmodified lines151617181920216 unmodified lines282930313233346 unmodified lines4142434445464748495051525354555657585960616263646566676869705 unmodified lines767778798081823 unmodified lines86878889909192939413 unmodified lines1081091101111121131141151163 unmodified lines1201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142153 unmodified lines2192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582593 unmodified lines2632642652662672682692702712722732 unmodified lines2762772782792802812822832842852862872882892902912922932942953 unmodified linesfrom typing import Dict, Tuple, List# ==============================================================================# 1. ESPECIFICACIONES: HUSQVARNA HC3 (2023) - SHIMANO EP6 CUSTOM# ==============================================================================@dataclass(frozen=True)4 unmodified lines# BATERÍA (Simplo Core S1+)CAPACIDAD_NOMINAL_AH: float = 17.5VOLTAJE_NOMINAL: float = 36.0BUFFER_SEGURIDAD_BMS: float = 0.05 # 5% Intocable# FÍSICA USUARIOPESO_BICI_KG: float = 24.56 unmodified linesOCV_CURVE_X: Tuple[float, ...] = (0.0, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 1.0)OCV_CURVE_Y: Tuple[float, ...] = (31.0, 32.5, 34.0, 35.1, 35.8, 36.3, 36.7, 37.2, 38.0, 39.2, 40.8, 41.5, 42.0)# PERFILES [Nm, Wh/km Rodadura, %Asist Motor, Eficiencia Térmica]PERFILES_TORQUE: Dict[str, List[float]] = field(default_factory=lambda: {'ECO (Nvl 1)': [27, 5.0, 0.40, 0.96],'Nivel 2': [34, 6.8, 0.50, 0.95],6 unmodified linesSPECS = BatterySpecs()# ==============================================================================# 2. MOTOR DE SIMULACIÓN Y ASESORAMIENTO# ==============================================================================def get_voltage(soc: float) -> float:return float(np.interp(soc, SPECS.OCV_CURVE_X, SPECS.OCV_CURVE_Y))def calcular_soh(km: float) -> float:# Ajustado para piloto ligero (70kg)ciclos = max(0.0, float(km) / 75.0)degradacion = (0.03 * (1 - np.exp(-0.05 * ciclos))) + (0.0002 * ciclos)return max(0.60, min(1.0, 1.0 - degradacion))def factor_clima_ruta(temp: float) -> float:"""Penalización por frío en ruta (Voltage Sag)"""if temp >= 20: return 1.0if temp >= 10: return 0.98if temp >= 5: return 0.95if temp >= 0: return 0.90if temp >= -5: return 0.82return 0.70def simulador_carga_v40(km, inicio, fin, temp_trastero):if inicio >= fin:return {"estado": "CARGADO", "soh": calcular_soh(km)}if temp_trastero < -5 or temp_trastero > 50:return {"estado": "ERROR_TEMP"}5 unmodified linest_min = 0.0e_wh = 0.0# Arrhenius (Carga)if temp_trastero < 15: f_temp = max(0.15, 0.4 + (0.04 * temp_trastero))elif temp_trastero > 35: f_temp = 0.92else: f_temp = 1.03 unmodified lineswhile ah_actual < ah_objetivo:soc_t0 = ah_actual / cap_totalv_t0 = get_voltage(soc_t0)i_target = SPECS.AMPERAJE_CARGADOR * f_temp# CC/CVif v_t0 >= (42.0 - 0.2):diff = v_t0 - (42.0 - 0.6)i_real = i_target * np.exp(-3.5 * max(0, diff))13 unmodified lineselse:t_step = 1.0v_avg = (v_t0 + get_voltage((ah_actual + delta_ah) / cap_total)) / 2ah_actual += delta_ahe_wh += (delta_ah * v_avg)t_min += t_stepif fin_ciclo: break3 unmodified lines"tiempo": t_min,"energia": e_wh,"cap_final_wh": ah_actual * SPECS.VOLTAJE_NOMINAL,"pct_objetivo": fin}# ==============================================================================# 3. INTERFAZ INTELIGENTE (HTML5 + CSS GRID)# ==============================================================================def generar_vista_zenith(km_val, temp_trastero, temp_ruta, elev_val, peso_piloto, inicio_val, fin_val):try:# 1. Simulaciónres = simulador_carga_v40(float(km_val), float(inicio_val), float(fin_val), float(temp_trastero))if res["estado"] == "ERROR_TEMP":return "<div style='background:#fee2e2; padding:20px; color:#991b1b; text-align:center;'>⛔ <b>ERROR:</b> Trastero a temperatura insegura.</div>"# 2. Datos Energíaif res["estado"] == "CARGADO":soh = res["soh"]cap_bruta = (SPECS.CAPACIDAD_NOMINAL_AH * soh * SPECS.VOLTAJE_NOMINAL) * (float(inicio_val)/100.0)tiempo_txt = "LISTA"energia_txt = "0 Wh"pct_final = float(inicio_val)else:cap_bruta = res['cap_final_wh']h, m = divmod(int(res["tiempo"]), 60)tiempo_txt = f"{h}h {m}m"energia_txt = f"+{res['energia']:.0f} Wh"pct_final = float(fin_val)# 3. Física Rutacap_util_teorica = cap_bruta * (1.0 - SPECS.BUFFER_SEGURIDAD_BMS)f_clima = factor_clima_ruta(float(temp_ruta))cap_util_real = cap_util_teorica * f_climaif cap_util_real < 0: cap_util_real = 0masa_total = SPECS.PESO_BICI_KG + float(peso_piloto) + SPECS.PESO_EQUIPO_KGg = 9.81julios_totales = masa_total * g * float(elev_val)wh_gravedad = julios_totales / 3600.0# --- ASESOR INTELIGENTE (SMART ADVISOR) ---# Analizamos si la carga solicitada es excesiva para la rutamensaje_asesor = ""bg_asesor = "white"# Consumo estimado para la ruta en modo TRAIL (Nivel 3 - Promedio)# Asumimos 30km de distancia para la elevación dada (ratio MTB típico)distancia_ref = max(20, float(elev_val) / 35.0)consumo_ref_km = SPECS.PERFILES_TORQUE['TRAIL (Nvl 3)'][1] * (masa_total/105.0)wh_necesarios = (wh_gravedad * 0.6 / 0.94) + (distancia_ref * consumo_ref_km)pct_necesario = (wh_necesarios / (SPECS.CAPACIDAD_NOMINAL_AH * res['soh'] * SPECS.VOLTAJE_NOMINAL)) * 100buffer_seguridad = 15 # Queremos llegar con 15% de margenpct_recomendado = min(100, pct_necesario + buffer_seguridad)if pct_final > 90 and pct_recomendado < 80:mensaje_asesor = f"💡 <b>Consejo Pro:</b> Para esta ruta de {int(float(elev_val))}m, cargar al <b>{int(pct_recomendado)}%</b> es suficiente. Evitar el 100% alarga la vida de la batería."bg_asesor = "#f0fdf4; border: 1px solid #86efac; color: #166534"elif pct_final < pct_necesario:mensaje_asesor = f"⚠️ <b>Advertencia:</b> Vas muy justo. Necesitas mínimo <b>{int(pct_necesario)}%</b> para hacer esta ruta en modo Trail."bg_asesor = "#fef2f2; border: 1px solid #fca5a5; color: #991b1b"# --- HTML BUILDER ---html = f"""<div style="font-family: -apple-system, sans-serif; max-width: 450px; margin: auto; color: #1f2937;"><div style="background: linear-gradient(135deg, #0f172a 0%, #334155 100%); color: white; padding: 24px; border-radius: 20px; text-align: center; box-shadow: 0 10px 25px rgba(0,0,0,0.2); margin-bottom: 16px;"><div style="font-size: 11px; font-weight: 700; opacity: 0.8; letter-spacing: 1px;">TIEMPO DE CARGA ({int(temp_trastero)}°C)</div><div style="font-size: 48px; font-weight: 800; line-height: 1;">{tiempo_txt}</div><div style="margin-top:8px;"><span style="background: rgba(255,255,255,0.15); font-size: 13px; padding: 4px 12px; border-radius: 99px;">⚡ {energia_txt}</span></div></div>{f'<div style="background: {bg_asesor}; padding: 12px 16px; border-radius: 12px; font-size: 12px; margin-bottom: 16px; line-height: 1.4;">{mensaje_asesor}</div>' if mensaje_asesor else ''}<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px;"><div style="background: #f8fafc; padding: 12px; border-radius: 14px; border: 1px solid #e2e8f0; text-align:center;"><div style="font-size: 10px; color: #64748b; font-weight: 700;">PESO SISTEMA</div><div style="font-size: 16px; font-weight: 800;">{masa_total:.1f} kg</div></div><div style="background: #f8fafc; padding: 12px; border-radius: 14px; border: 1px solid #e2e8f0; text-align:center;"><div style="font-size: 10px; color: #64748b; font-weight: 700;">TEMP RUTA</div><div style="font-size: 16px; font-weight: 800;">{int(float(temp_ruta))}°C</div></div></div><div style="background: white; border: 1px solid #e2e8f0; border-radius: 20px; overflow: hidden;"><div style="padding: 12px 20px; background: #f1f5f9; border-bottom: 1px solid #e2e8f0; font-size: 11px; font-weight: 700; color: #64748b; letter-spacing: 0.5px;">PREDICCIÓN DE AUTONOMÍA</div>"""3 unmodified linesfactor_asist = specs_modo[2]efic_termica = specs_modo[3]# Coste Gravedadcoste_g = wh_gravedad * factor_asist * (1.0 / efic_termica)wh_rodadura = cap_util_real - coste_g# Barra visual de consumopct_g = min(100, (coste_g / cap_util_real * 100)) if cap_util_real > 0 else 100if wh_rodadura > 0:distancia = int(wh_rodadura / consumo_llano)color = "#15803d" if distancia > 25 else "#b45309" if distancia > 10 else "#b91c1c"html += f"""<div style="padding: 14px 20px; border-bottom: 1px solid #f1f5f9;"><div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:6px;"><div style="font-size: 14px; font-weight: 700; color: #1e293b;">{modo}</div><div style="font-size: 18px; font-weight: 800; color: {color};">{distancia} km</div></div><div style="height: 6px; background: #e2e8f0; border-radius: 3px; overflow:hidden; display:flex;"><div style="width: {pct_g}%; background: #94a3b8;" title="Gasto Subida"></div><div style="flex-grow: 1; background: {color};" title="Disponible para rodar"></div></div><div style="display:flex; justify-content:space-between; margin-top:4px;"><div style="font-size: 9px; color: #64748b;">Subida: -{int(coste_g)}Wh</div><div style="font-size: 9px; color: #64748b;">Rodaje</div></div></div>"""else:max_m = int(float(elev_val) * (cap_util_real / coste_g))html += f"""<div style="padding: 14px 20px; border-bottom: 1px solid #f1f5f9; background: #fef2f2;"><div style="display:flex; justify-content:space-between; align-items:center;"><div style="font-size: 14px; font-weight: 700; color: #991b1b;">{modo}</div><div style="font-size: 14px; font-weight: 800; color: #dc2626;">AGOTADA</div></div><div style="font-size: 10px; color: #b91c1c; margin-top:4px;">⚠️ Solo alcanza {max_m}m de desnivel</div></div>"""html += "</div></div>"3 unmodified linesreturn f"Error: {str(e)}"# ==============================================================================# 4. LANZAMIENTO# ==============================================================================with gr.Blocks(title="Husqvarna ZENITH", css="footer {display: none !important;}") as app:gr.Markdown("### ⚡ Husqvarna HC3 | ZENITH V40")with gr.Row():with gr.Column():2 unmodified linesinp_elev = gr.Slider(0, 3000, value=1000, label="Desnivel Objetivo (m)", step=50)gr.Markdown("---")with gr.Row():inp_t_trastero = gr.Slider(-5, 40, value=20, label="Temp. Trastero (Carga)")inp_t_ruta = gr.Slider(-10, 40, value=5, label="Temp. Exterior (Ruta)")inp_inicio = gr.Slider(0, 99, value=20, label="% Batería ACTUAL")inp_fin = gr.Slider(1, 100, value=100, label="% Batería OBJETIVO")btn = gr.Button("ANALIZAR RUTA", variant="primary")with gr.Column():out = gr.HTML(label="Análisis")btn.click(fn=generar_vista_zenith,inputs=[inp_km, inp_t_trastero, inp_t_ruta, inp_elev, inp_peso, inp_inicio, inp_fin],outputs=out)
app.py+103-93