DistributedCharge / Dashboard

2 stars 0 forks source link

Change units for rate from sat/(W*h) to sat/(kW*h) #6

Closed AndySchroder closed 1 year ago

AndySchroder commented 1 year ago

Can't settle anything less than 1 sat on chain, so it doesn't make sense to have non-integer values of sat. Also the energy industry prices everything in kWhour, so using that will make rate be around 500 sat/(kWhour) to 4,000 sat/(kW*hour) at current prices and integers can be used in tables and axis labels without loosing any needed precision.

Keep values of power and energy in terms of W and Whours for now. Those make physical sense as floating point numbers and also current demos will be under 1,600 W so kW won't be as simple to read. Will likely want to change to kW and kWhours in the future in either a manual or automatic way, but don't want to decide how to do that now.

asherp commented 1 year ago

The current fix is that I check each variable for [sat/Wh] units, and if they exist I convert the array to [sat/kWh] See:

https://github.com/DistributedCharge/Dashboard/blob/4cf218c437068859b62b2d26fe4c1a0975d08977/dcharge/utils.py#L49