simphony / simphony-common

The native implementation of the Simphony cuds objects
BSD 2-Clause "Simplified" License
7 stars 5 forks source link

Check that subcomponents of CUDSComponent are in CUDS model when adding new component #314

Closed tuopuu closed 7 years ago

tuopuu commented 8 years ago

@mehdisadeghi , with #312, Could you please add a check to model.CUDS.add that if the added CUDSComponent contains references to other components (as in the case of MaterialRelation it will hold references to a number of Material objects), then these are also added to the model (if they don't already exist there).

tuopuu commented 8 years ago

In the case the above functionality is implemented then we should also prevent removing of CUDSComponents that are referenced somewhere else in the model to keep the model consistent. Removal of the referencing object should be done first before allowing removal of the referenced object.

mehdisadeghi commented 8 years ago

I see your point. Let's keep this as a separate issue/PR and keep the above mentioned PR relatively small.

tuopuu commented 7 years ago

Yaml serialisation implemented in #322 generates yaml for all included and referenced CUDSComponents in a model, even if referenced objects are not directly in the model.