CATIA-Systems / FMPy

Simulate Functional Mockup Units (FMUs) in Python
Other
429 stars 118 forks source link

modelDescription.xml is not extracted when the FMU is a zip file #632

Closed srdg closed 9 months ago

srdg commented 9 months ago

According to the FMI standard, the FMU file would have the following folder structure :

--- binaries
--- resources
--- ....
--- modelDescription.xml

This line of code in simulation does not extract the modelDescription.xml file when the FMU is an archive, but retains the structure if the path given is that of an unzipped folder. This does not make sense! The FMU structure should be maintained regardless of whether or not the file is an archive. This leads to an error in most simulators, unless there is an explicit fallback to look for the modelDescription.xml in the resources folder by the FMI2Interface.dll ( in my case). Kindly add the condition to also extract modelDescription.xml file if it is present at the root location. To do so, I think just adding modelDescription.xml in the required_paths list should suffice.

t-sommer commented 9 months ago

An FMI 2.0 FMU must not make any assumptions about the directory structure outside the path supplied by fmuResourceLocation. Even the binaries may be extracted to a different directory.