frequenz-floss / frequenz-api-weather

gRPC+protobuf specification and Python bindings for the Frequenz Weather API
MIT License
0 stars 8 forks source link

Change validity_time filter in client to datetime #77

Closed cwasicki closed 7 months ago

cwasicki commented 8 months ago

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 from timedelta to a valid_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#L150

Related (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.

noah-kreutzer-frequenz commented 8 months ago

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

shsms commented 7 months ago

Done in #80