Skip to content
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

upgrade to powsybl-dependencies 2024.0.3 #18

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
import com.google.common.collect.Iterables;
import com.powsybl.cgmes.conformity.CgmesConformity1Catalog;
import com.powsybl.cgmes.conformity.CgmesConformity1ModifiedCatalog;
import com.powsybl.cgmes.conversion.CgmesImport;
import com.powsybl.cgmes.extensions.*;
import com.powsybl.commons.PowsyblException;
import com.powsybl.commons.datasource.ReadOnlyDataSource;
import com.powsybl.commons.datasource.ResourceDataSource;
import com.powsybl.commons.datasource.ResourceSet;
import com.powsybl.commons.extensions.Extension;
import com.powsybl.commons.reporter.ReporterModel;
import com.powsybl.computation.local.LocalComputationManager;
import com.powsybl.entsoe.util.EntsoeArea;
import com.powsybl.entsoe.util.EntsoeAreaImpl;
import com.powsybl.entsoe.util.EntsoeGeographicalCode;
Expand Down Expand Up @@ -4555,7 +4557,9 @@ public void baseVoltageMappingTest() {
public void cgmesControlAreaTieLineTest() {
try (NetworkStoreService service = createNetworkStoreService()) {
// import new network in the store
service.importNetwork(CgmesConformity1Catalog.microGridBaseCaseAssembled().dataSource());
Properties properties = new Properties();
properties.put(CgmesImport.IMPORT_CGM_WITH_SUBNETWORKS, "false");
service.importNetwork(CgmesConformity1Catalog.microGridBaseCaseAssembled().dataSource(), null, LocalComputationManager.getDefault(), properties);
}

try (NetworkStoreService service = createNetworkStoreService()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ public void testTwoWindingsTransformer() {
.setRegulating(true)
.setLoadTapChangingCapabilities(true)
.add())
.getMessage().contains("a target voltage has to be set for a regulating ratio tap changer"));
.getMessage().contains("2 windings transformer '2WT': regulation mode of regulating ratio tap changer must be given"));
assertTrue(assertThrows(PowsyblException.class, () -> t2e.newRatioTapChanger()
.setTapPosition(1)
.beginStep().setR(10).setX(10).setG(10).setB(10).setRho(10).endStep()
Expand Down Expand Up @@ -523,7 +523,7 @@ public void testTwoWindingsTransformer() {
.endStep()
.add();

assertTrue(assertThrows(PowsyblException.class, () -> ratioTapChanger.setTargetV(Double.NaN)).getMessage().contains("a target voltage has to be set for a regulating ratio tap changer"));
assertTrue(assertThrows(PowsyblException.class, () -> ratioTapChanger.setTargetV(Double.NaN)).getMessage().contains("2 windings transformer '2WT': a regulation value has to be set for a regulating ratio tap changer"));
assertTrue(assertThrows(PowsyblException.class, () -> ratioTapChanger.setTargetV(-50).setRegulating(true).setLoadTapChangingCapabilities(true)).getMessage().contains("bad target voltage "));
assertTrue(assertThrows(PowsyblException.class, () -> ratioTapChanger.setTargetDeadband(Double.NaN)).getMessage().contains("Undefined value for target deadband of regulating"));
assertTrue(assertThrows(PowsyblException.class, () -> ratioTapChanger.setTapPosition(-1)).getMessage().contains("incorrect tap position "));
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,17 @@ public ResponseEntity<TopLevelDocument<DanglingLineAttributes>> getVoltageLevelD
return getAll(() -> repository.getVoltageLevelDanglingLines(networkId, variantNum, voltageLevelId), null);
}

// grounds

@GetMapping(value = "/{networkId}/{variantNum}/voltage-levels/{voltageLevelId}/grounds", produces = APPLICATION_JSON_VALUE)
@Operation(summary = "Get grounds connected to voltage level")
@ApiResponses(@ApiResponse(responseCode = "200", description = "Successfully get grounds connected to the voltage level"))
public ResponseEntity<TopLevelDocument<GroundAttributes>> getVoltageLevelGrounds(@Parameter(description = "Network ID", required = true) @PathVariable("networkId") UUID networkId,
@Parameter(description = "Variant number", required = true) @PathVariable("variantNum") int variantNum,
@Parameter(description = "Voltage level ID", required = true) @PathVariable("voltageLevelId") String voltageLevelId) {
return getAll(List::of, null);
}

// generator

@PostMapping(value = "/{networkId}/generators")
Expand Down Expand Up @@ -1287,6 +1298,60 @@ public ResponseEntity<Void> updateDanglingLinesSv(@Parameter(description = "Netw
return updateAll(resources -> repository.updateDanglingLinesSv(networkId, resources), danglingLineResources);
}

// ground
@GetMapping(value = "/{networkId}/{variantNum}/grounds", produces = APPLICATION_JSON_VALUE)
@Operation(summary = "Get dangling lines")
@ApiResponses(@ApiResponse(responseCode = "200", description = "Successfully get ground list"))
public ResponseEntity<TopLevelDocument<GroundAttributes>> getGrounds(@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 grounds to get") @RequestParam(required = false) Integer limit) {
// FIXME: implement
return getAll(List::of, limit);
}

@GetMapping(value = "/{networkId}/{variantNum}/grounds/{groundId}", produces = APPLICATION_JSON_VALUE)
@Operation(summary = "Get a ground by id")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Successfully get ground"),
@ApiResponse(responseCode = "404", description = "Ground has not been found")
})
public ResponseEntity<TopLevelDocument<GroundAttributes>> getGround(@Parameter(description = "Network ID", required = true) @PathVariable("networkId") UUID networkId,
@Parameter(description = "Variant number", required = true) @PathVariable("variantNum") int variantNum,
@Parameter(description = "Ground ID", required = true) @PathVariable("groundId") String groundId) {
// FIXME: implement
return get(() -> null);
}

@PostMapping(value = "/{networkId}/grounds")
@Operation(summary = "Create grounds")
@ApiResponses(@ApiResponse(responseCode = "201", description = "Successfully create grounds"))
public ResponseEntity<Void> createGrounds(@Parameter(description = "Network ID", required = true) @PathVariable("networkId") UUID networkId,
@Parameter(description = "Ground resources", required = true) @RequestBody List<Resource<GroundAttributes>> groundResources) {
// FIXME: implement
return ResponseEntity.ok().build();
}

@PutMapping(value = "/{networkId}/grounds")
@Operation(summary = "Update grounds")
@ApiResponses(@ApiResponse(responseCode = "201", description = "Successfully update grounds"))
public ResponseEntity<Void> updateGrounds(@Parameter(description = "Network ID", required = true) @PathVariable("networkId") UUID networkId,
@Parameter(description = "Ground resources", required = true) @RequestBody List<Resource<GroundAttributes>> groundResources) {
// FIXME: implement
return ResponseEntity.ok().build();
}

@DeleteMapping(value = "/{networkId}/{variantNum}/grounds/{groundId}", produces = APPLICATION_JSON_VALUE)
@Operation(summary = "Delete a ground by id")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Successfully delete ground")
})
public ResponseEntity<Void> deleteGround(@Parameter(description = "Network ID", required = true) @PathVariable("networkId") UUID networkId,
@Parameter(description = "Variant number", required = true) @PathVariable("variantNum") int variantNum,
@Parameter(description = "Ground ID", required = true) @PathVariable("groundId") String groundId) {
// FIXME: implement
return ResponseEntity.ok().build();
}

// buses

@PostMapping(value = "/{networkId}/configured-buses")
Expand Down
Loading
Loading