pypowsybl icon indicating copy to clipboard operation
pypowsybl copied to clipboard

Handling large number of properties

Open jeandemanged opened this issue 3 months ago • 0 comments

Describe the current behavior

With the introduction of https://github.com/powsybl/powsybl-core/pull/3139 in CGMES importer, getting e.g. line data frame on large CGMES based networks using all_attributes=True is really slow (tens of seconds). Each line now has properties CGMES.OperationalLimitSet_<mRID> that is unique to the line, hence the data frame has many many columns since a column is added for each property. Same for 2W and 3W transformers.

Describe the expected behavior

Probably https://github.com/powsybl/powsybl-core/pull/3139 made an abusive use of the iIDM Identifiable property feature, and CGMES importer/exporter should be improved to make use of an extension instead of properties in this case. Or alternatively, continue using property, but with stable keys / not including equipment specific keys/mRID.

That being said, there are things which could be improved on PyPowSyBl side:

  • First, improve to add properties columns only on request in the Network.get_<equipmentType> methods, e.g. via an additional argument property_attributes=True/False to be used in conjunction with all_attributes=True/False, i.e. all_attributes would only care about "optional" columns, and the new argument would decide on the addition of the "property" columns.
  • Second, add a method Network.get_elements_properties allowing to get properties as rows instead of columns, much like the existing Network.get_aliases

Describe the motivation

Performance, eventually usability

Extra Information

Since PyPowSyBl 1.8.x

jeandemanged avatar Nov 16 '24 11:11 jeandemanged