Replies: 1 comment 1 reply
-
|
@camille-bouvy-frequenz @thomas-nicolai-frequenz FYI. Do you have any preferences opinions about where this |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In frequenz-floss/frequenz-api-electricity-trading#17 we detected the need for a
Quantity-like class that is backed by aDecimal.Since we still don't know how common this would be, the easiest approach would be to just add a new
DecimalEnergyclass that has the same interface asQuantitybut uses aDecimalas the underlying value, just for this use case, which seems to be pretty unique. In the future we'll re-asses if we need to merge it with Quantity or we need some other solution.Since this is only used by the electricity trading API so far, this
DecimalEnergymight just only be included in the electricity trading client instead of the SDK.If possible, this new class could inherit from
Quantitytoo.Alternative solutions are:
Decimalas a backing type for allQuantitys (too big of a change, too disruptive, we would need to asses what would be the impact in performance and other aspects for other parts of the system).Quantityto have different backing types for values, so we could haveEnergy[float]andEnergy[Decimal]. This feels like it will be a lot of problem and pollute 99% of the code that needs to use float for very little gain.Beta Was this translation helpful? Give feedback.
All reactions