ThummeTo / FMIImport.jl

FMIImport.jl implements the import functionalities of the FMI-standard (fmi-standard.org) for the Julia programming language. FMIImport.jl provides the foundation for the Julia packages FMI.jl and FMIFlux.jl.
MIT License
18 stars 17 forks source link

FMI2: Parse type and unit definitions into `modelDescription` #74

Closed manuelbb-upb closed 1 year ago

manuelbb-upb commented 1 year ago

Based on the changes in https://github.com/ThummeTo/FMICore.jl/pull/33, this pull request modifies parsing of a model definition such that the modelDescription of an FMU2 actually holds non-trivial typeDefinitons and unitDefinitions if present.

There is also post-processing for the model variables to set the attributes according to a declaredType if applicable, i.e., if an attribute is not defined for the model variable but for the relevant SimpleType.

Lastly, there is a convenience function fmi2GetUnit(model_description, model_variable) to retrieve the unit corresponding to model_variable.Real.unit from model_description.unitDefinitions.

Marked as “draft” because:

ThummeTo commented 1 year ago

Thank you very much, we will check the PRs and merge if everything is ok. Much appreciated 👍

@JoKircher

JoKircher commented 1 year ago

Sure, I will give it a look

manuelbb-upb commented 1 year ago

Thanks for the review and sorry for not running the unit tests. Will submit a commit soon adding some documentation.