FlexUnits.jl 0.3.0, Support for Unitful-like inference

Just an update to anyone who ran into this thread (as it generated a lot of discussion and hits), a newer version of this package was released. It’s a breaking release because I ultimately decided to subtype Quantity as Number in order to align better with existing conventions and achieve compatibility with linear algebra and DifferentialEquations.jl.

A new type called FlexQuant functions like the old Quantity in that it can contain any object as a value and does not subtype to Number. Users generally don’t have to worry about this, because multiplication and the quantity function will select the desired output type automatically. If you wish to support both types (for example, with dispatch), you can use QuantUnion.

2 Likes