-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could you add watthour unit in the Energy class? #68
Comments
Hi @GPanthou, Thank you for reaching out. The new version (currently in alpha) does include Watthours or seconds. However, watt hour is not an energy unit but a power (energy per time). I hope this helps. Best |
Sorry, I'm not sure I understand your answer. Geremy |
Hi @GPanthou, Pardon me, you are absolutely right. I don't know where my head is today. I am currently not using this package and therefore have only limited time I can dedicate to this project. I would be more than happy to review a PR, should you want to contribute this feature yourself. Best |
Hi @codingjoe, It would be a pleasure. I've been using python for a long time, but I'm new to github, and I don't really know the procedures. Could you quickly tell me what I need to do to make a proposal?
Sorry if I'm still not clever. Geremy |
Hi @GPanthou, First, welcome to GitHub :) Now to your questions. No, the latest version is the Best |
Hi @codingjoe Here is a first attempt. I stay tuned Geremy |
Hi @codingjoe, Did you have time to look at the code I submitted? Maybe that was not the right way to do it? Best Geremy |
Some propositions to the issue coddingtonbear#68
Hello,
I am wondering if you can add the watthour unit within the official pypi packages (https://pypi.org/project/measurement/).
I have added this unit locally (fedora 34, python 3.9, measurement 3.2.0), and it works fine for me :-).
Maybe some other people could be interested.
class Energy(MeasureBase):
STANDARD_UNIT = 'J'
UNITS = {
'c': 4.18400,
'C': 4184.0,
'J': 1.0,
'eV': 1.602177e-19,
'tonne_tnt': 4184000000,
'wh': 3600,
}
ALIAS = {
'joule': 'J',
'calorie': 'c',
'Calorie': 'C',
'watthour': 'wh',
}
SI_UNITS = ['J', 'c', 'eV', 'tonne_tnt', "wh"]
The text was updated successfully, but these errors were encountered: