-
Notifications
You must be signed in to change notification settings - Fork 0
Add specific parameters management #163
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
feat(): Add specific parameters for shortcircuit computation Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
…e/shortcircuit-server into add_specific_parameters
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
…ific parameters Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
|
I think we can fix 2 out of the 5 sonar issues |
src/main/java/org/gridsuite/shortcircuit/server/dto/ShortCircuitParametersValues.java
Show resolved
Hide resolved
...a/org/gridsuite/shortcircuit/server/entities/parameters/ShortCircuitParametersConstants.java
Show resolved
Hide resolved
...java/org/gridsuite/shortcircuit/server/entities/parameters/ShortCircuitParametersEntity.java
Outdated
Show resolved
Hide resolved
...java/org/gridsuite/shortcircuit/server/entities/parameters/ShortCircuitParametersEntity.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/shortcircuit/server/service/ShortCircuitParametersService.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/shortcircuit/server/service/ShortCircuitParametersService.java
Show resolved
Hide resolved
src/main/java/org/gridsuite/shortcircuit/server/service/ShortCircuitParametersService.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/shortcircuit/server/service/ShortCircuitParametersService.java
Outdated
Show resolved
Hide resolved
| if (result) { | ||
| parametersRepository.deleteById(parametersUuid); | ||
| } | ||
| return result; |
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.
in other services we directly
parametersRepository.deleteById(parametersUuid);
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.
ok it's moved code
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.
it allows REST API to return ResponseEntity.notFound() otherwise you get a 200 returned code even if the parameters don't exist. it uses repository existsById method which is lighter than a complete findById. I think it's ok like that. Something to do in other services I think
| if (getParameters() == null || getParameters().specificParameters() == null || getParameters().specificParameters().isEmpty()) { | ||
| return params; // no specific ShortCircuit params | ||
| } | ||
| return params; |
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 don't you need the part with the extension?
Extension<LoadFlowParameters> specificParametersExtension = lfProvider.loadSpecificParameters(PlatformConfig.defaultConfig())
.orElseThrow(() -> new PowsyblException("Cannot add specific loadflow parameters with provider " + getProvider()));
params.addExtension((Class) specificParametersExtension.getClass(), specificParametersExtension);
lfProvider.updateSpecificParameters(specificParametersExtension, getParameters().getSpecificParameters());doesn't it always return the default without this?
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.
Ok used, I don't know... maybe computation wasn't taking consideration of specific parameters ? arf, that's bad...
src/main/java/org/gridsuite/shortcircuit/server/ShortCircuitController.java
Outdated
Show resolved
Hide resolved
|
Thanks for making the shortcircuit-server parameters handling more consistent with the rest of the application! |
src/test/java/org/gridsuite/shortcircuit/server/report/ReportMapperShortCircuitTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/gridsuite/shortcircuit/server/service/ShortCircuitWorkerServiceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/gridsuite/shortcircuit/server/ShortCircuitParametersControllerTest.java
Outdated
Show resolved
Hide resolved
…IDER Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
|



feat(): Add specific parameters for shortcircuit computation
refactor(): parameters management adaptation from loadflow-server