Skip to content
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

Type stability for StringToValueReference #109

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CasBex
Copy link
Contributor

@CasBex CasBex commented Nov 16, 2023

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)

@ThummeTo
Copy link
Owner

ThummeTo commented Jun 17, 2024

Thanks for noticing, we will do a complete check with DispatchDoctor.jl in all libraries.

Some FMUs (e.g. Dymola) start counting at higher values... returning 0 could be a better option (value refs must be greater than 0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants