Use PowerTransformerEnd.endNumber to sort transformer windings #3234
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
No.
What kind of change does this PR introduce?
Refactoring.
What is the current behavior?
During CGMES conversion of a CIM16 file (CGMES 2.4.15),
WindingType
class is using Terminal.sequenceNumber to classify and sort the windings as PRIMARY/SECONDARY/TERTIARY. However, sequenceNumber isn't fetched by the SPARQL query and therefore is never used in theWindingType
class. As a consequence, WindingType.windingType always returns PRIMARY for CIM16 Propertybags.This is not an issue because another sort is done in the CGMES import using PowerTransformerEnd.endNumber, giving the correct classifications of windings for CIM16 files, but this additional sorting shouldn't be required and should be done directly in
WindingType
.What is the new behavior (if this is a feature change)?
Since the SPARQL queries fetch the PowerTransformerEnd.endNumber and use it to classify and sort the windings as PRIMARY/SECONDARY/TERTIARY, the use of Terminal.sequenceNumber is droped in favor of PowerTransformerEnd.endNumber.
As a consequence, the additional sorting in CGMES import isn't required anymore.
Does this PR introduce a breaking change or deprecate an API?
Other information:
This is bad practice to rely on PowerTransformerEnd.Terminal.sequenceNumber. The correct way to classify windings in CIM16 is with the use of PowerTransformerEnd.endNumber.