Skip to content
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

Temperature conversions are incorrect #3

Closed
craigholm opened this issue Jan 3, 2013 · 2 comments
Closed

Temperature conversions are incorrect #3

craigholm opened this issue Jan 3, 2013 · 2 comments
Labels

Comments

@craigholm
Copy link

>>> from pint import UnitRegistry
>>> ureg = UnitRegistry()
>>> Q_ = ureg.Quantity
>>> Q_('0 * degK').to('degC')
<Quantity(0.0, 'degC')>
>>> Q_('0 * degC').to('degF')
<Quantity(0.0, 'degF')>
>>> Q_('100 * degC').to('degF')
<Quantity(55.55555555555556, 'degF')>
>>> Q_('212 * degF').to('degC')
<Quantity(381.6, 'degC')>

It seems like the "offset" parameter in the definition file is being ignored. The test_offset method in test_pint.py is decorated with unittest.expectedFailure.

@hgrecco
Copy link
Owner

hgrecco commented Jan 4, 2013

The temperature conversion (and the support for logarithmic units like dB) is work in progress. The plan is to support two types of temperature units: difference in temperature and temperature. The difference in temperature will operate like any other multiplicative unit. I am looking for a way to implement all this without making the code too complicated. In particular, I would like to raise meaning full errors and warnings when an operation is not supported.

@craigholm
Copy link
Author

If they don't work currently, it would be better to omit them from the definition file (at least on the release branch). Inaccurate results are worse than none.

hgrecco added a commit that referenced this issue Jan 4, 2013
Commented out Temperature units from definition until support is ready

closes issue #3
@hgrecco hgrecco closed this as completed Jan 4, 2013
znicholls referenced this issue in znicholls/pint Aug 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants