SciML / LabelledArrays.jl

Arrays which also have a label for each element for easy scientific machine learning (SciML)
https://docs.sciml.ai/LabelledArrays/stable/
Other
120 stars 21 forks source link

Labelled Array Constructors do not promote to dual numbers #68

Open ChrisRackauckas opened 4 years ago

ChrisRackauckas commented 4 years ago
julia> using ForwardDiff, LabelledArrays

julia> SLVector(a=2.0,b=ForwardDiff.Dual(1,2))
2-element SLArray{Tuple{2},Real,1,2,(:a, :b)}:
                  2.0
 Dual{Nothing}(1,2)
ChrisRackauckas commented 4 years ago

These should be using promote_type instead of just convert(T:

https://github.com/JuliaDiffEq/LabelledArrays.jl/blob/master/src/slarray.jl#L1-L19

andreasnoack commented 4 years ago

So this is actually an issue in StaticArrays, see https://github.com/JuliaArrays/StaticArrays.jl/pull/670, caused by generated functions.