frequenz-floss / frequenz-client-dispatch-python

Dispatch API client for Python
https://frequenz-floss.github.io/frequenz-client-dispatch-python/
MIT License
0 stars 3 forks source link

Add a `DatetimeRange` dataclass to pass pairs from/to #15

Open Marenz opened 7 months ago

Marenz commented 7 months ago

What's needed?

add a DatetimeRange dataclass to pass pairs from/to.

Proposed solution

No response

Use cases

No response

Alternatives and workarounds

No response

Additional context

No response

llucax commented 7 months ago

I wonder if this could be useful for other teams, so if we should put it in api-common (if we make it directly a type of proto message) or base-client instead if we keep it as a python-only thing.

@frequenz-floss/api-team does anyone envision having to use datetime ranges in other APIs? I guess for reporting if you are requesting data for a range you'll also have to specify a range, right?

noah-kreutzer-frequenz commented 7 months ago

@frequenz-floss/api-team does anyone envision having to use datetime ranges in other APIs? I guess for reporting if you are requesting data for a range you'll also have to specify a range, right?

the weatehr client is using a list of datetime objects to specify the time of the forcasts to be filtered out. But for now a list with explicit timestamps is implemented. I'm not sure if ranges in combinations of ranges and timedeltas could be of interest for further development. What do you think @cwasicki?

cwasicki commented 7 months ago

In my opinion for weather it can make sense to simplify the query to datetime ranges. Also, ranges are used in other APIs like reporting and I think trading.