Fetch weather data and compute rolling-window features.
Downloads weather observations/forecasts for the requested period, aligns them to a regular freq grid, and applies WindowFeatures to produce rolling-mean, -max, and -min features over configurable windows.
Optional path to cache directory. When provided, fetched weather data is cached in <cache_home>/weather_cache.parquet. When None (default), no caching is performed.
Optional sequence of (latitude, longitude) pairs for a population-weighted multi-city weather index. When None (default) the single latitude/longitude point is used, preserving prior behaviour exactly. When given, each location is fetched and the raw frames are combined via population_weighted_average using location_weights. See spotforecast2_safe.weather.locations.
Optional subset of {"hdh", "cdh", "apparent_temperature", "dew_point"}. When given, those columns are derived from the (weighted) weather and rolled up alongside the raw fields. None (default) adds nothing. See add_derived_weather_features.
Optional Open-Meteo hourly variables to request. None (default) keeps WeatherClient.HOURLY_PARAMS; a subset drops variables from the request (and from the returned frames). derived_features need their source columns in the subset.
- weather_aligned – Raw weather DataFrame reindexed to the same [start, cov_end] hourly grid (forward-filled). Also carries any columns requested via derived_features (e.g. hdh, cdh, apparent_temperature, dew_point), so they are selectable downstream via raw-weather membership in weather_aligned.columns.