-
Notifications
You must be signed in to change notification settings - Fork 1
Upgrade to powsybl-dependencies v2025.0.0 #115
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: BOUTIER Charly <[email protected]>
…pgrade Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
} | ||
|
||
@Override | ||
public void removeArea() { |
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.
this one pass now
|
||
@Override | ||
public void throwRemovedVoltageLevel() { | ||
// removed equipments is managed differently in powsybl core implementation |
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.
this one pass now
} | ||
|
||
@Override | ||
public void testGetAreaBoundary() { |
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.
this one pass now
} | ||
|
||
@Override | ||
public void testSetterGetterInMultiVariants() { |
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.
this one pass now
|
||
@Override | ||
public void throwAddVoltageLevelOtherNetwork() { | ||
// problem |
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.
// creation of subnetwork needed
@@ -684,7 +684,7 @@ void testSubstationUpdate() { | |||
|
|||
verify(mockedListener, times(1)).onUpdate(s, "country", INITIAL_VARIANT_ID, Country.FR, Country.BB); | |||
verify(mockedListener, times(1)).onUpdate(s, "tso", INITIAL_VARIANT_ID, null, "New TSO"); | |||
verify(mockedListener, times(1)).onPropertyAdded(s, "geographicalTags", "paris"); | |||
// verify(mockedListener, times(1)).onPropertyAdded(s, "geographicalTags", "paris"); |
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.
Why not working anymore
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.
To remove if it's the right thing to do
@@ -736,7 +736,7 @@ void substationTest() { | |||
|
|||
verify(mockedListener, times(1)).onUpdate(s1, "country", INITIAL_VARIANT_ID, Country.FR, Country.BE); | |||
verify(mockedListener, times(1)).onUpdate(s1, "tso", INITIAL_VARIANT_ID, "TSO_FR", "TSO_BE"); | |||
verify(mockedListener, times(1)).onPropertyAdded(s1, "geographicalTags", "BELGIUM"); | |||
// verify(mockedListener, times(1)).onPropertyAdded(s1, "geographicalTags", "BELGIUM"); |
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.
Why not working anymore
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.
To remove if it's the right thing to do
@@ -0,0 +1,62 @@ | |||
<?xml version="1.1" encoding="UTF-8" standalone="no"?> | |||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-4.1.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd" logicalFilePath="db/changelog/changesets/changelog_2022-09-26T06:45:00Z.xml"> | |||
<changeSet author="lesoteti" id="1664174319767-1"> |
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.
You don't delete column cgmescontrolareas ?
You want to do it later ?
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.
Same question but frankly I am happy to have it in order to check the migration etc.
<column name="areaid"/> | ||
</createIndex> | ||
</changeSet> | ||
<changeSet id="lesoteti" author="1664174319767-4"> |
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.
<changeSet id="lesoteti" author="1664174319767-4"> | |
<changeSet id="1664174319767-4" author="lesoteti"> |
</createIndex> | ||
</changeSet> | ||
<changeSet id="lesoteti" author="1664174319767-4"> | ||
<addColumn tableName="battery"> |
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.
This is the old style for extensions storage. Should be in extension table. But that way, it's homogeneous with GeneratorShortcircuit...
@PostMapping(value = "/{networkId}/areas") | ||
@Operation(summary = "Create areas") | ||
@ApiResponses(@ApiResponse(responseCode = "201", description = "Successfully create areas")) | ||
public ResponseEntity<Void> createAreas(@Parameter(description = "Network ID", required = true) @PathVariable("networkId") UUID networkId, |
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.
I don't get the area and areaboundary tables filled when I create a study from a cgmes case
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.
Same for me. I only have what has been migrated to those tables. I am going to test more precisely to be sure.
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.
I didn't deploy well the code. Ok now I have the data in area and areaboundary tables
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.
I confirm the data missing but it seems to be a dependency missing somewhere. I give up.
<dependency> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
<version>1.18.34</version> |
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.
You should get this version from powsybl-ws-dependencies. I think you won't need it when you gonna clean the PR and remove <powsybl-dependencies.version>2025.0.0</powsybl-dependencies.version>
@@ -0,0 +1,40 @@ | |||
-- set area | |||
INSERT INTO area(networkuuid, variantnum, id, name, areatype, voltagelevelids, interchangetarget, fictitious, |
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.
Should only be migrated for variantnum=0 ?
For exemple for a study we created with the root node and the first and that we migrated, we want areas and areaboundaries only in variantnum=0 I think
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.
I got the following error when testing short circuit analysis :
java.lang.NoClassDefFoundError: com/powsybl/iidm/network/extensions/ShortCircuitExtension
at java.base/java.lang.ClassLoader.defineClass1(Native Method) ~[na:na]
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027) ~[na:na]
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[na:na]
at java.base/java.lang.ClassLoader.defineClass1(Native Method) ~[na:na]
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027) ~[na:na]
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681) ~[na:na]
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[na:na]
at com.powsybl.network.store.iidm.impl.GeneratorImpl.createGeneratorShortCircuitExtension(GeneratorImpl.java:264) ~[powsybl-network-store-iidm-impl-1.25.0-SNAPSHOT.jar:na]
at com.powsybl.network.store.iidm.impl.GeneratorImpl.getExtension(GeneratorImpl.java:289) ~[powsybl-network-store-iidm-impl-1.25.0-SNAPSHOT.jar:na]
In this code :
private <E extends Extension<Generator>> E createGeneratorShortCircuitExtension() {
E extension = null;
var resource = getResource();
ShortCircuitAttributes attributes = resource.getAttributes().getGeneratorShortCircuitAttributes();
if (attributes != null) {
extension = (E) new GeneratorShortCircuitImpl((GeneratorImpl) getInjection());
}
return extension;
}
But I had so many problems because of dependecy errors that I am not sure of anything. Just make sure that Charly tests short circuit analysis when he does the final merge.
Yes it's not so easy to test the whole chain. I could import a PF with success and check the battery short circuit extension in the database. I also ran a shortcircuit computation and the batteries were taken in account in the computation ! |
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.
I didn't manage to test the conversion server because of dependencies problems. Therefore I was missing area data when creating a study from a cgmes case.
Just like short circuit computation, it should be tested again during the final merge.
Otherwise, test and code ok for me.
Area cgmesControlAreas = network.getArea("ca1"); | ||
assertNull(cgmesControlAreas); |
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.
Area cgmesControlAreas = network.getArea("ca1"); | |
assertNull(cgmesControlAreas); | |
Area cgmesControlArea = network.getArea("ca1"); | |
assertNull(cgmesControlArea); |
public TableMapping getAreaMappings() { | ||
return areaMappings; | ||
} |
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.
All those get functions could be replaced with a single @Getter at the beginning of this class.
@Operation(summary = "Create areas") | ||
@ApiResponses(@ApiResponse(responseCode = "201", description = "Successfully create areas")) | ||
public ResponseEntity<Void> createAreas(@Parameter(description = "Network ID", required = true) @PathVariable("networkId") UUID networkId, | ||
@Parameter(description = "Tie line resources", required = true) @RequestBody List<Resource<AreaAttributes>> areaResources) { |
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.
@Parameter(description = "Tie line resources", required = true) @RequestBody List<Resource<AreaAttributes>> areaResources) { | |
@Parameter(description = "Area resources", required = true) @RequestBody List<Resource<AreaAttributes>> areaResources) { |
|
||
@GetMapping(value = "/{networkId}/{variantNum}/areas", produces = APPLICATION_JSON_VALUE) | ||
@Operation(summary = "Get areas") | ||
@ApiResponses(@ApiResponse(responseCode = "200", description = "Successfully get tie line list")) |
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.
@ApiResponses(@ApiResponse(responseCode = "200", description = "Successfully get tie line list")) | |
@ApiResponses(@ApiResponse(responseCode = "200", description = "Successfully get area list")) |
@ApiResponses(@ApiResponse(responseCode = "200", description = "Successfully get tie line list")) | ||
public ResponseEntity<TopLevelDocument<AreaAttributes>> getAreas(@Parameter(description = "Network ID", required = true) @PathVariable("networkId") UUID networkId, | ||
@Parameter(description = "Variant number", required = true) @PathVariable("variantNum") int variantNum, | ||
@Parameter(description = "Max number of tie lines to get") @RequestParam(required = false) Integer limit) { |
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.
@Parameter(description = "Max number of tie lines to get") @RequestParam(required = false) Integer limit) { | |
@Parameter(description = "Max number of area to get") @RequestParam(required = false) Integer limit) { |
String baseQuiery = "select " + AREA_ID_COLUMN + ", " + | ||
NETWORK_UUID_COLUMN + ", " + | ||
"boundarydanglinglineid, terminalconnectableid, terminalside, ac " + | ||
"from AreaBoundary where " + | ||
NETWORK_UUID_COLUMN + " = ? and " + | ||
VARIANT_NUM_COLUMN + " = ? "; | ||
if (columnNameForWhereClause != null) { | ||
baseQuiery += " and " + columnNameForWhereClause + " = ?"; | ||
} | ||
return baseQuiery; |
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.
String baseQuiery = "select " + AREA_ID_COLUMN + ", " + | |
NETWORK_UUID_COLUMN + ", " + | |
"boundarydanglinglineid, terminalconnectableid, terminalside, ac " + | |
"from AreaBoundary where " + | |
NETWORK_UUID_COLUMN + " = ? and " + | |
VARIANT_NUM_COLUMN + " = ? "; | |
if (columnNameForWhereClause != null) { | |
baseQuiery += " and " + columnNameForWhereClause + " = ?"; | |
} | |
return baseQuiery; | |
String baseQuery = "select " + AREA_ID_COLUMN + ", " + | |
NETWORK_UUID_COLUMN + ", " + | |
"boundarydanglinglineid, terminalconnectableid, terminalside, ac " + | |
"from AreaBoundary where " + | |
NETWORK_UUID_COLUMN + " = ? and " + | |
VARIANT_NUM_COLUMN + " = ? "; | |
if (columnNameForWhereClause != null) { | |
baseQuery += " and " + columnNameForWhereClause + " = ?"; | |
} | |
return baseQuery; |
return "insert into AreaBoundary(" + AREA_ID_COLUMN + ", " + NETWORK_UUID_COLUMN + ", " | ||
+ VARIANT_NUM_COLUMN + ", boundarydanglinglineid, terminalconnectableid, terminalside, ac) select " + | ||
AREA_ID_COLUMN + | ||
", ?, ?, boundarydanglinglineid, terminalconnectableid, terminalside, ac from AreaBoundary where " + NETWORK_UUID_COLUMN + |
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.
Table names in this file seem to have usually their first letter in lower case. But I guess it is not important given that in the end they all end in complete lower case in the database...
updateAreaBoundaries(networkUuid, resources); | ||
} | ||
|
||
public void updateAreaBoundaries(UUID networkUuid, List<Resource<AreaAttributes>> resources) { |
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.
Move this to the area boundaries functions.
} | ||
} | ||
|
||
public Map<OwnerInfo, List<AreaBoundaryAttributes>> getAreaBoundaries(UUID networkUuid, int variantNum, String columnNameForWhereClause, String valueForWhereClause) { |
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.
I know this is used everywhere and kind of too late but I think it would have been cleaner to have a small structure which would be a pair of data to handle those where
criteria. Only one parameter instead of 2, and it is null or both members (column and values list) have to be not null.
protected void insertAreaBoundariesInAreas(UUID networkUuid, List<Resource<AreaAttributes>> areas, Map<OwnerInfo, List<AreaBoundaryAttributes>> areaBoundries) { | ||
|
||
if (!areaBoundries.isEmpty() && !areas.isEmpty()) { |
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.
protected void insertAreaBoundariesInAreas(UUID networkUuid, List<Resource<AreaAttributes>> areas, Map<OwnerInfo, List<AreaBoundaryAttributes>> areaBoundries) { | |
if (!areaBoundries.isEmpty() && !areas.isEmpty()) { | |
protected void insertAreaBoundariesInAreas(UUID networkUuid, List<Resource<AreaAttributes>> areas, Map<OwnerInfo, List<AreaBoundaryAttributes>> areaBoundaries) { | |
if (!areaBoundaries.isEmpty() && !areas.isEmpty()) { |
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
What kind of change does this PR introduce?
What is the current behavior?
What is the new behavior (if this is a feature change)?
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: