Skip to content

Conversation

@sBouzols
Copy link
Contributor

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

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>
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>
…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>
@sBouzols sBouzols changed the title [WIP] Add specific parameters management Add specific parameters management Nov 17, 2025
@antoinebhs
Copy link
Contributor

I think we can fix 2 out of the 5 sonar issues

if (result) {
parametersRepository.deleteById(parametersUuid);
}
return result;
Copy link
Contributor

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);

Copy link
Contributor

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

Copy link
Contributor Author

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;
Copy link
Contributor

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?

Copy link
Contributor Author

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...

@antoinebhs
Copy link
Contributor

Thanks for making the shortcircuit-server parameters handling more consistent with the rest of the application!

…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>
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants