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 units not handled correctly #6

Closed
thomvet opened this issue Mar 11, 2021 · 4 comments
Closed

Temperature units not handled correctly #6

thomvet opened this issue Mar 11, 2021 · 4 comments

Comments

@thomvet
Copy link

thomvet commented Mar 11, 2021

I noticed an issue with temperature units in this package. If I perform:
latexify(unit(1u"°C"))
The returned result is:
L"$\mathrm{K}$"
which of course can't be intentional within the context of this package :-)

@gustaphe
Copy link
Owner

That's a feature, keeps you from using affine units :p

This comes from the fact that typeof(u"°C") == Unitful.FreeUnits{(K,), 𝚯, Unitful.Affine{-5463//20}}, and also applies to °F and Ra. Going to need to do something clever about that.

@gustaphe
Copy link
Owner

Turns out Unitful.jl doesn't actually track the affine units, so I had to do something less clever and more ugly about it. But I think it should work with 68e3142.

@thomvet
Copy link
Author

thomvet commented Mar 15, 2021

Just wanted to say thanks for fixing this so promptly. I tested the new version and it is working as intended! (and I agree that affine units have their challenges in general!)

@gustaphe
Copy link
Owner

Fixing bug reports is the only thing better than programming things nobody needs. Let me know if you encounter anything else :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants