ggebbie / UnitfulLinearAlgebra.jl

Low-cost linear algebra functions for matrices with units
MIT License
6 stars 3 forks source link

CAUTION: dangerous fallbacks #84

Open ggebbie opened 1 year ago

ggebbie commented 1 year ago

PSA:

UnitfulLinearAlgebra.jl is designed by combining features of Unitful.jl and DimensionalData.jl. This design choice has consequences, such as using an AbstractArray type that makes many fallbacks work. The downside is that fallbacks can work even when they shouldn't, no error is produced, and the code continues by silently dropping the units. Discussion and guidance on these design issues is appreciated.

One example is indexing a UnitfulMatrix; the usual convention of A[1,1] will return a unitless value. Use getindexqty(A,1,1) to return a Quantity with units. Currently, this behavior is kept in order to optimize performance.