Accessing the forecast for a particular time stamp using the client involves getting the creation time and determining the timedelta between the creation time and the time stamp of interest. This functionality should be provided by the client, as the current usage is specific to the structure of ECMWF forecasts, but users do not need to know about this.
what is the farest ahead forecast we are expecting and should client check if the farest forecast requested is availaible or does the service handle this? @cwasicki @TalweSingh
What's needed?
Accessing the forecast for a particular time stamp using the client involves getting the creation time and determining the
timedelta
between the creation time and the time stamp of interest. This functionality should be provided by the client, as the current usage is specific to the structure of ECMWF forecasts, but users do not need to know about this.Proposed solution
Change
validity_times
argument fromtimedelta
to avalid_at
argument of type, which is the time where the forecast is valid: https://github.com/frequenz-floss/frequenz-api-weather/blob/05b72a85f4499054848479f18bd45f72ef95154a/py/frequenz/client/weather/_types.py#L150Related (separate issue), there should be a method to get the creation time of the forecast.
Use cases
Users typically ask for forecasts at a particular time, not for a forecast step w.r.t. a creation time.
Alternatives and workarounds
No response
Additional context
In fact, the client implementation diverges from the protobuf definitions, where the forecast message contains the timestamp.