feat: unified architecture and webcam archive optimization

- Refactor backend into a single process (FastAPI + APScheduler + Telegram Bot)
- Implement 'current_forecasts' and 'past_forecasts' architecture in storage
- Optimize historical webcam collector with date range discovery for Pajares, San Isidro, and Fuentes
- Clean up legacy scripts and tables (prediction_runs, prediction_stations)
- Update tests and operations documentation
This commit is contained in:
dasemu committed 2026-03-13 11:56:59 +01:00
1 parent a70eff3e45
commit f6a65f41d9
14 files changed
+563 -660

No files matched your search

-23
View File
@@ -175,29 +175,6 @@ class RulesEngine:
snow_depth,
min_snow,
)
# ---- Rule 3: Warm rain reduces skiable terrain -------------------
max_temperature = weather_data.get("temperature_2m_max")
precipitation = weather_data.get("precipitation_sum")
if (
max_temperature is not None
and max_temperature > _WARM_RAIN_TEMP_THRESHOLD_C
and precipitation is not None
and precipitation >= _WARM_RAIN_PRECIP_THRESHOLD_MM
and not force_closed
):
km_factor = min(km_factor, _WARM_RAIN_KM_FACTOR)
reasons.append(
f"Lluvia ({precipitation:.1f} mm) con temperatura alta "
f"({max_temperature:.1f} C); se reduce el km esquiable estimado."
)
logger.info(
"[%s] Rule 6 fired: warm rain %.1f C / %.1f mm -> km_factor %.2f",
station_name,
max_temperature,
precipitation,
km_factor,
)
# ---- Derive confidence -------------------------------------------
# Confidence is 1.0 only if a deterministic closure rule fired.
# Otherwise, confidence is 0.0, delegating all responsibility to ML.