FMPy
FMPy copied to clipboard
[Feature Request] Expose function to write a model description
Seeing as this library already implements the functionality, it was somewhat pointless to reimplement the writing on the users side again.
This could be refactored out like https://github.com/CATIA-Systems/FMPy/pull/451/files#diff-f7a75463637f732e168728bf7998e4c8f8f683206aaf0cfa32867705ec0664edR207
What would be the benefit of having this separate function?
Writing model descriptions is a task I have to do sometimes. I find the FMPy abstractions to be reasonable, so I prefer to work with the ModelDescription
, ScalarVariable
types etc. However I don't want to have to implement a function to write a model descriptions based on those types again, seeing as this lib already does that but just doesn't expose it.
So: Usage from application code is the benefit
Also: The function to write the container FMU could be factored better and would be easier to understand if it were split up into multiple functions.
Something like
def modelDescription2XML(model_description: ModelDescription)
...
?
Something like
def modelDescription2XML(model_description: ModelDescription) ...
?
Yes essentially 👍🏽