frequenz-floss / frequenz-sdk-python

Frequenz Python Software Development Kit (SDK)
https://frequenz-floss.github.io/frequenz-sdk-python/
MIT License
13 stars 17 forks source link

Explicit semantic data types for ChargePower and DischargePower #499

Open christianparpart opened 1 year ago

christianparpart commented 1 year ago

What's needed?

Add two more boxed types

Both reflecting non-negative power with the semantic meaning encoded into the type system.

There shall be convenience methods like

Proposed solution

s.a.

Use cases

as discussed in the meeting, to encode meaning into the power values to catch value errors as early as possible, also aiding code review.

Alternatives and workarounds

No response

Additional context

in the FCR Prequalification Actor we've prototyped the use of such abstractions and had quite positive impressions about it.

llucax commented 1 year ago

I guess the battery pool charge/discharge command should return this new type, right? So this would be a breaking change?