-
Notifications
You must be signed in to change notification settings - Fork 114
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
Compatibility with Measurements.jl #22
Comments
Thanks for the kind words! Rational exponents can be very useful indeed, typically voltage noise is measured in Fortunately, I think Unitful works with Measurements already, provided you organize the terms appropriately:
This works because |
Wow, it was so obvious, but I didn't think about wrapping I'll probably describe the combination Regarding the subtyping of |
I think the crux of the problem is that nowhere in the documentation or the source of Julia, to my knowledge, is a definition of how a type subtyping I initially tried making a whole slew of |
Suggested by Andrew Keller at PainterQubits/Unitful.jl#22.
I think the only useful subtype of However I understand that implementing yet another specific type within the package may lead to ugly code. PS: I documented the use of |
Let me first express my appreciation for the package, looks really nice! I like very much the possibility to have units with rational exponents, maybe not really physical but useful in calculations. In addition, it appears to be much faster than
SIUnits.jl
, yet it has more features (for what I can see).I'd like to ask you whether it is possible to make this package compatible with
Measurements.jl
, a library for uncertainty propagation. This package provides a new type,Measurement
, which is subtype ofAbstractFloat
and takesAbstractFloat
numbers with uncertainty, then instructs most mathematical operations to correctly propagate the uncertainty to the result. You can read here the discussion which led to the final choice: JuliaPhysics/Measurements.jl#1The main thing that
Unitful.jl
should do in order to became compatible withMeasurements.jl
is to makeDimensionedQuantity
subtype ofAbstractFloat
.I understand the change I'm proposing is breaking, but it would be really cool to see error propagation for numbers with their units!
The text was updated successfully, but these errors were encountered: