Open dnwillia-work opened 3 days ago
A pragmatic change would be to update the conversion factors to 0.5555555555555555
so that there is a bit more precision. If I do that locally I get:
(venv) D:\ANSYSDev\pyansys\pyansys-units>python
Python 3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:50:30) [MSC v.1933 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from ansys.units import Quantity, UnitRegistry
>>> ureg = UnitRegistry()
>>> five_c = Quantity(value=5.0, units=ureg.C)
>>> five_c.to(ureg.F)
Quantity (41.0, "F")
>>>
π Before submitting the issue
π Description of the bug
Here's what happens when converting 5 Celsius to Fahrenheit:
with pint:
In principle this should be exact as the conversion is:
Perhaps it's a bit pedantic, but pint seems to get it right. Pint does seem to store exact conversion factors:
https://github.com/hgrecco/pint/blob/7035daf5f1f9516b578a6cd9588a181a7ea349ba/pint/default_en.txt#L210
whereas the pyansys-units library is storing approximate ones:
https://github.com/ansys/pyansys-units/blob/9ecd864bf2d5570c7226bc952d3119fb1a4e9b5d/src/ansys/units/cfg.yaml#L171
π Steps to reproduce
See above.
π» Which operating system are you using?
Windows
π Which ANSYS version are you using?
N/A
π Which Python version are you using?
3.9
π¦ Installed packages