energy_data_retrieval.sources.open_meteo.client#

Model-explicit hourly weather with audited end-label to interval-start alignment.

class energy_data_retrieval.sources.open_meteo.client.WeatherProduct(*values)[source]#

Bases: StrEnum

ERA5 = 'era5'#
IFS = 'ifs'#
class energy_data_retrieval.sources.open_meteo.client.Site(site_id: 'str', latitude: 'float', longitude: 'float')[source]#

Bases: object

Parameters:
  • site_id (str)

  • latitude (float)

  • longitude (float)

site_id: str#
latitude: float#
longitude: float#
class energy_data_retrieval.sources.open_meteo.client.WeatherChunk(site: 'Site', start: 'date', end: 'date', product: 'WeatherProduct', frame: 'pd.DataFrame', request: 'RequestRecord', cell_latitude: 'float', cell_longitude: 'float')[source]#

Bases: object

Parameters:
site: Site#
start: date#
end: date#
product: WeatherProduct#
frame: DataFrame#
request: RequestRecord#
cell_latitude: float#
cell_longitude: float#
class energy_data_retrieval.sources.open_meteo.client.OpenMeteoClient(http: 'HTTPClient', product: 'WeatherProduct' = <WeatherProduct.ERA5: 'era5'>, api_key: 'str | None' = None, chunk_days: 'int' = 31, include_degradation: 'bool' = False)[source]#

Bases: object

Parameters:
http: HTTPClient#
product: WeatherProduct#
api_key: str | None#
chunk_days: int#
include_degradation: bool#
weather(site, start, end)[source]#

Read a finite UTC date chunk with one extra day for end samples.

No implicit Best Match product is used. Both products are modelled data, not station measurements. Native nearest-cell selection disables elevation downscaling. Public and customer endpoints never share credential caches.

Parameters:
  • site (Site)

  • start (date)

  • end (date)

Return type:

WeatherChunk

iter_weather(sites, start, end, *, workers=2)[source]#

Yield bounded location/date partitions without collecting a fleet history.

Parameters:
  • sites (Iterable[Site])

  • start (date)

  • end (date)

  • workers (int)

Return type:

Iterator[WeatherChunk]

energy_data_retrieval.sources.open_meteo.client.normalize_hourly(payload, site_id, start, end, *, product, include_degradation=False)[source]#

Align GHI, temperature and wind to identical one-hour UTC intervals.

Radiation is the preceding-hour mean at interval end. Temperature and wind are means of the two instantaneous endpoints and remain null if either is missing. Forecast gust is the preceding-hour maximum; the archive defines ERA5 gust at the indicated hour, so its end sample is explicitly retained as instantaneous and must not be called a measured or hourly maximum.

Parameters:
  • payload (dict[str, JSONValue])

  • site_id (str)

  • start (date)

  • end (date)

  • product (WeatherProduct)

  • include_degradation (bool)

Return type:

DataFrame