FMIImport.jl icon indicating copy to clipboard operation
FMIImport.jl copied to clipboard

Type stability for StringToValueReference

Open CasBex opened this issue 7 months ago • 0 comments

fmi2StringToValueReference has a type instability where it can return either a UInt32 or a Nothing type result. This gives some impracticalities when for example broadcasting where you can get either a Vector{UInt32} or a Vector{Union{Nothing,UInt32}} depending on the input. This pull-request fixes that by returning typemax(UInt32) (= 4.3e9) by default. (If your model has more than 4.3e9 inputs then this will fail, but I don't think this edge case is realistic)

CasBex avatar Nov 16 '23 10:11 CasBex