OpenEnergyTools / scl-lib

5 stars 4 forks source link

tIED: Avoid unnecessary datatype duplication #70

Open danyill opened 10 months ago

danyill commented 10 months ago

Using insertIED:

  1. We import an IED A with DataType y
  2. We import another IED B with DataType z in it's datamodel which has the same id but it is different from the previous DataType y (different objects defined).
  3. When we use the extension we get a separate datatype created for B.
  4. If we import another IED which is from the same ICD file as B then we get another set of DataTypeTemplates created.

This behaviour is currently by design but requires icd files to have their DataTypeTemplate ids to be "pre-segregated" to get a good outcome.

The describe function in scl-diff could be used along with cataloguing the existing datatypes to resolve this, but at the cost of CPU cycles and it might become a little slow in large files when insertIED is used on multiple IEDs (as I currently do in oscd-import-templates)

(from https://github.com/danyill/oscd-import-templates/issues/3)