CATIA-Systems / FMPy

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

create_fmu_container(configuration, fmufile) is working with old verion and not working with new version #654

Closed hafeezsk1995 closed 6 months ago

hafeezsk1995 commented 6 months ago

I have a configuration dict configuration = { 'description': description, 'variables': variables, 'components': components, 'connections': connections}

fmufile it is considering file path

I am using this fmpy container libary function create_fmu_container(configuration, fmufile) It is working properly with 0.2.26 but it is not working with 0.3.20 (update version)

"I am getting this error for update version 0.3.20" -----> dict object has no attribute 'fmiVersion'

Pls let me know what are changes i need to do Thanks

t-sommer commented 6 months ago

fmiVersion is a required attribute of the Configuration. See https://github.com/CATIA-Systems/FMPy/blob/main/tests/test_fmu_container.py#L21 for an example.

hafeezsk1995 commented 6 months ago

Thanks for your reply

But i am using own custom dict not using Configuration libary configuration = { 'description': description, 'variables': variables, 'components': components, 'connections': connections}

and i am using this custom dict for custom call create_fmu_container(configuration, fmufile)

--> This type of implementation is working with old version but it is not working with new version

I have some doubts , Please help with this

  1. Do i need to use Configuration libary for every version?
  2. If i need use Configuration libary . How to integrate my configuration dictionary?
  3. I tried to integrate my custom dict in to Configuration .. It is throwing some errors at connection block like need to provide starts, ends some data i am not sure about this How to use Libary Configuration function my custom dict
t-sommer commented 6 months ago

The API has changed. Please refer to https://github.com/CATIA-Systems/FMPy/blob/main/tests/test_fmu_container.py for an example of how to use the latest version.