Skip to content

Conversation

@rolnico
Copy link
Member

@rolnico rolnico commented Nov 19, 2025

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • A PR or issue has been opened in all impacted repositories (if any)

Does this PR already have an issue describing the problem?
No

What kind of change does this PR introduce?
Feature

What is the current behavior?
PowSyBl uses univocity-parsers for handling fixed-width files (parsing and writing), but this lib is abandoned since 2021.

What is the new behavior (if this is a feature change)?
PowSyBl now handles fixed-width files (parsing and writing) by itself, without using external libraries.

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

The following classes have been moved from com.powsybl.ieeecdf.model to com.powsybl.ieeecdf.model.elements:

  • IeeeCdfBranch
  • IeeeCdfBus
  • IeeeCdfInterchangeData
  • IeeeCdfLossZone
  • IeeeCdfTieLine
  • IeeeCdfTitle

They now extend the new abstract class AbstractIeeeElement.

The following classes have been moved from com.powsybl.ieeecdf.model to com.powsybl.ieeecdf.model.conversion:

  • BranchSideConversion
  • BranchTypeConversion
  • BusTypeConversion
  • LocalDateConversion
  • SeasonConversion

They do not extend anymore the class com.univocity.parsers.conversions.ObjectConversion.

Other information:

@rolnico
Copy link
Member Author

rolnico commented Nov 19, 2025

I did some tests to compare the performances of this version vs main. Each test consisted of importing an IEEE-CDF test file and then exporting the model. Each operation was performed 10000 times consecutively, and the results are based on the last 9950 draws.

Operation File Main (ms) Manual (ms) Diff (ms) Diff %
Import ieee9cdf.txt 9.779 0.055 -9.724 -99.44%
Export ieee9cdf.txt 4.104 0.254 -3.850 -93.82%
Import ieee14cdf.txt 6.051 0.080 -5.971 -98.68%
Export ieee14cdf.txt 2.695 0.252 -2.443 -90.63%
Import ieee14cdf-solved.txt 8.126 0.078 -8.048 -99.04%
Export ieee14cdf-solved.txt 3.837 0.266 -3.571 -93.06%
Import ieee30cdf.txt 2.480 0.135 -2.345 -94.55%
Export ieee30cdf.txt 2.638 0.303 -2.335 -88.49%
Import ieee57cdf.txt 2.784 0.223 -2.561 -92.00%
Export ieee57cdf.txt 2.766 0.382 -2.384 -86.16%
Import ieee118cdf.txt 4.905 0.318 -4.587 -93.52%
Export ieee118cdf.txt 3.603 0.611 -2.992 -83.04%
Import ieee300cdf.txt 5.764 0.775 -4.989 -86.59%
Export ieee300cdf.txt 4.948 1.199 -3.749 -75.78%
Import ieee9zeroimpedancecdf.txt 1.825 0.038 -1.787 -97.92%
Export ieee9zeroimpedancecdf.txt 1.417 0.245 -1.172 -82.71%

Thanks to the change of dependency, we could have a major gain in performances.

Note: exported files have changed a bit, but they are now closer to IEEE-CDF standard. The models created from the files are however unchanged.

Signed-off-by: Nicolas Rol <[email protected]>
@rolnico
Copy link
Member Author

rolnico commented Nov 19, 2025

This PR replaces #3629 and avoids using an external library

Signed-off-by: Nicolas Rol <[email protected]>
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants