Description:
would be better than having to implement this in every toolkit in a different way...
eg.
class PowerUnit(Enum)
W = ("Watt", 1)
kW = ("Kilowatt", 1e3)
MW = ("Megawatt", 1e6)
BTU_hr = ("British Thermal Unit / hour", 3.412141633)
kBTU_hr = ("Kilo British Thermal Unit / hour", 3.412141633e3)
MBTU_hr = ("Mega British Thermal Unit / hour", 3.412141633e6)
def convert(self, value: float, to_unit: PowerUnit):
return (value * self.value[1]) / to_unit.value[1]
#usage
some_value_in_kW = 40
new_value_in_BTU_hr = PowerUnit.kW.convert(some_value_in_kW, PowerUnit.BTU)
for now I think we can do the common ones that are used elsewhere:
Description:
would be better than having to implement this in every toolkit in a different way...
eg.
for now I think we can do the common ones that are used elsewhere: