-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add backward compatibility for CgmesControlAreas extension deserialization #3298
base: remove_cgmes_control_areas_extension
Are you sure you want to change the base?
Add backward compatibility for CgmesControlAreas extension deserialization #3298
Conversation
...ensions/src/main/java/com/powsybl/cgmes/extensions/compatibility/CgmesControlAreasSerDe.java
Show resolved
Hide resolved
I have tested the backward compatibility using a real world test case and it works perfectly. |
|
||
@Override | ||
public void write(DummyExt extension, SerializerContext context) { | ||
throw new UnsupportedOperationException("Backward writing compatibility is not yet supported."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yet
means we'll do it one day, will we? Besides shouldn't this rather be something like "cannot happen"? We're here with a DummyExt which is never created, and cannot be created.
...ensions/src/main/java/com/powsybl/cgmes/extensions/compatibility/CgmesControlAreasSerDe.java
Outdated
Show resolved
Hide resolved
…tension Signed-off-by: Olivier Perrin <[email protected]>
Signed-off-by: Olivier Perrin <[email protected]>
Signed-off-by: Olivier Perrin <[email protected]>
Signed-off-by: Olivier Perrin <[email protected]>
Signed-off-by: Olivier Perrin <[email protected]>
Signed-off-by: Olivier Perrin <[email protected]>
e90f061
to
3e1159d
Compare
|
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?
Feature
Does this PR introduce a new Powsybl Action implying to be implemented in simulators or pypowsybl?
What is the current behavior?
#3149 removes the
CgmesControlAreas
in favor of the usage of IIDMArea
s, but the backward compatibility with the extension is not supported. Therefore when importing an old generated IIDM network containing the extension, the content of this extension is not loaded and no CGMES areas are created.What is the new behavior (if this is a feature change)?
With this PR, the serialized extension is read and IIDM
Area
s are created for eachCgmesControlArea
of the extension.Note that when reading a CgmesControlArea from the serialized extension, if an
Area
with the same ID is already present on the network, the CgmesControlArea is skipped.Does this PR introduce a breaking change or deprecate an API?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
Other information:
For now, only the reading compatibility is supported, because it is not trivial to implement the writing compatibility: there's no extension corresponding to the CGMES areas on the network, so the extension serialization mechanism could not be used directly