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

Improvement of the code coverage #238

Merged
merged 28 commits into from
Aug 7, 2022
Merged

Improvement of the code coverage #238

merged 28 commits into from
Aug 7, 2022

Conversation

JB-H
Copy link
Contributor

@JB-H JB-H commented Aug 2, 2022

Signed-off-by: JB-H jbheyberger@gmail.com

Please check if the PR fulfills these requirements (please use '[x]' to check the checkboxes, or submit the PR and then click the checkboxes)

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem ? If so, link to this issue using '#XXX' and skip the rest

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

What is the current behavior? (You can also link to an open issue here)

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change or deprecate an API? If yes, check the following:

  • The Breaking Change or Deprecated label has been added
  • The migration guide has been updated in the github wiki (What changes might users need to make in their application due to this PR?)

Other information:

(if any of the questions/checkboxes don't apply, please delete them entirely)

JB-H and others added 24 commits August 2, 2022 23:01
Signed-off-by: Jean-Baptiste Heyberger <jean-baptiste.heyberger@rte-france.com>
Signed-off-by: JB-H <jbheyberger@gmail.com>
Signed-off-by: Jean-Baptiste Heyberger <jbheyberger@gmail.com>
Signed-off-by: JB-H <jbheyberger@gmail.com>
Signed-off-by: Jean-Baptiste Heyberger <jbheyberger@gmail.com>
Signed-off-by: JB-H <jbheyberger@gmail.com>
Signed-off-by: Jean-Baptiste Heyberger <jbheyberger@gmail.com>
Signed-off-by: JB-H <jbheyberger@gmail.com>
Signed-off-by: Jean-Baptiste Heyberger <jbheyberger@gmail.com>
Signed-off-by: JB-H <jbheyberger@gmail.com>
Signed-off-by: Jean-Baptiste Heyberger <jbheyberger@gmail.com>
Signed-off-by: JB-H <jbheyberger@gmail.com>
Signed-off-by: Jean-Baptiste Heyberger <jbheyberger@gmail.com>
Signed-off-by: JB-H <jbheyberger@gmail.com>
Signed-off-by: Jean-Baptiste Heyberger <jbheyberger@gmail.com>
Signed-off-by: JB-H <jbheyberger@gmail.com>
Signed-off-by: Jean-Baptiste Heyberger <jbheyberger@gmail.com>
Signed-off-by: JB-H <jbheyberger@gmail.com>
…does not have an impact

Signed-off-by: Jean-Baptiste Heyberger <jbheyberger@gmail.com>
Signed-off-by: JB-H <jbheyberger@gmail.com>
Signed-off-by: Jean-Baptiste Heyberger <jbheyberger@gmail.com>
Signed-off-by: JB-H <jbheyberger@gmail.com>
Signed-off-by: Jean-Baptiste Heyberger <jbheyberger@gmail.com>
Signed-off-by: JB-H <jbheyberger@gmail.com>
…va class for more genericity in the AdmittanceLinearResolution

Signed-off-by: Jean-Baptiste Heyberger <jbheyberger@gmail.com>
Signed-off-by: JB-H <jbheyberger@gmail.com>
Signed-off-by: Jean-Baptiste Heyberger <jbheyberger@gmail.com>
Signed-off-by: JB-H <jbheyberger@gmail.com>
Signed-off-by: Jean-Baptiste Heyberger <jbheyberger@gmail.com>
Signed-off-by: JB-H <jbheyberger@gmail.com>
Signed-off-by: Jean-Baptiste Heyberger <jbheyberger@gmail.com>
Signed-off-by: JB-H <jbheyberger@gmail.com>
Signed-off-by: Jean-Baptiste Heyberger <jbheyberger@gmail.com>
Signed-off-by: JB-H <jbheyberger@gmail.com>
Signed-off-by: Jean-Baptiste Heyberger <jbheyberger@gmail.com>
Signed-off-by: JB-H <jbheyberger@gmail.com>
Signed-off-by: Jean-Baptiste Heyberger <jbheyberger@gmail.com>
Signed-off-by: JB-H <jbheyberger@gmail.com>
…ution.java to have a clear separation between Admittance System to be solved and Impedance Resolution which provides the result of the inversion of the admittance system

Signed-off-by: Jean-Baptiste Heyberger <jbheyberger@gmail.com>
Signed-off-by: JB-H <jbheyberger@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
*/
public class CalculationLocation {

private final String busLocation;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

busId1 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree


private final String busLocation;

private final String busLocationBiPhased;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

busId2 to be more generic ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree


private final String busLocationBiPhased;

private final boolean voltageUpdate;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seem not to be used?

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 should be used later

@@ -472,7 +472,7 @@ private void defineZones(LfNetwork network) {
}

// Example to compute full sytem nodal current injectors I = Y*V
public void computeCurrentInjections(AdmittanceEquationSystem.AdmittanceType admittanceType) {
/*public void computeCurrentInjections(AdmittanceEquationSystem.AdmittanceType admittanceType) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To fix before merging this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented it because it is not used and decreases the code coverage, I can try to put it in a test in a next commit

if (Math.abs(gSum) > epsilon || Math.abs(bSum) > epsilon) {
double det = 1 / (gSum * gSum + bSum * bSum);
if (Math.abs(gSum) > EPSILON || Math.abs(bSum) > EPSILON) {
double det = 1 / (gSum * gSum + bSum * bSum);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a Sonar false positive, because of the previous check it cannot be zero.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree

Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
@sonarcloud
Copy link

sonarcloud bot commented Aug 7, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug D 2 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 127 Code Smells

0.0% 0.0% Coverage
4.7% 4.7% Duplication

@geofjamg geofjamg merged commit 753f9be into main Aug 7, 2022
@geofjamg geofjamg deleted the scImprove branch August 7, 2022 15:16
geofjamg pushed a commit that referenced this pull request Sep 9, 2022
Signed-off-by: JB-H <jbheyberger@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
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.

2 participants