frequenz-floss / frequenz-client-reporting-python

A python client for the Frequenz Reporting API
MIT License
0 stars 5 forks source link

Support multiple components and microgrids #19

Closed cwasicki closed 3 months ago

cwasicki commented 4 months ago

What's needed?

In the initial version only a combination of one metric, component and microgrid ID each can be requested. The API supports arbitrary lists of microgrid-component IDs and metric IDs. This functionality should be exposed.

In a first step, multiple metrics for a single component is implemented in https://github.com/frequenz-floss/frequenz-client-reporting-python/pull/26. Multiple components will be addressed separately.

Proposed solution

The case of multiple metrics, components has been considered in the current design already and only needs to be exposed. First steps in this direction are addressed for multiple metrics in https://github.com/frequenz-floss/frequenz-client-reporting-python/pull/26.

Use cases

No response

Alternatives and workarounds

No response

Additional context

The API requests the cross-combination of the elements in the list of microgrid_components and the elements in the list of metrics, which might not provide sufficient control over the combinations (e.g. too many or non-existing). For instance

metrics = [SOC, power]
microgrid_components = [ {MID, CID_meter}, {MID, CID_battery} ]

leads to 4 combinations.

EDIT: For now we focus on exposing the signature as close to the underlying API as possible and keep the following as potential future enhancements:

Alternatively we could require the user to provide request data in the format

[[mid1, cid1, metric1], [mid2, cid2, metric2], ...]

and potentially have multiple requests whose output needs to be merged.

cwasicki commented 4 months ago

Updated scope of this PR since multiple metrics are now addressed here: https://github.com/frequenz-floss/frequenz-client-reporting-python/pull/26.

cwasicki commented 3 months ago

Updated issue description narrowing down the scope.

flora-hofmann-frequenz commented 3 months ago

Closing issue after merging PR #39.