simphony / simphony-metadata

[LEGACY] This repository contains the metadata definitions used in SimPhoNy project.
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Metadata code generation fails to store data to self._data DataContainer #41

Closed tuopuu closed 8 years ago

tuopuu commented 8 years ago

Metadata code generation is not working correctly. There should be self._data instead of self.data on the line 649 in file generate.py (/simphony-metadata/scripts/).

Currently, setting data at object initialization overwrites the setter/getter methods of the generated classes and I can't create proper "test CUDS objects" that contain CUBA data in a way it's supposed to be stored.

@mehdisadeghi , @kitchoi Could you fix it, or correct me if I'm missing something.

kitchoi commented 8 years ago

Currently, setting data at object initialization overwrites the setter/getter methods of the generated classes and I can't create proper "test CUDS objects" that contain CUBA data in a way it's supposed to be stored.

Setting data at initialisation would trigger the setter method. Can you please provide a use case for "create proper test CUDS objects that contain CUBA data in a way it's supposed to be stored" please? I am not sure I understand what that means.

tuopuu commented 8 years ago

Setting data at initialisation would trigger the setter method.

You are right. self.data = data should work. I think the problem was in my computer/SimPhoNy installation. I probably forgot to python setup.py install after git pull --rebase... which caused old .pyc files to be loaded. There seemed to be a problem with being able to store the vector attribute of CUBA.BOX into self._data DataContainer. I tried manually changing the generated code, and reinstalled SimPhoNy which fixed the problem.

Now, testing the code with generated code changed back to normal everything works. We can close this issue. Thanks for giving it a thought! :)