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

Change disconnected sensitivities management #236

Merged
merged 5 commits into from
Mar 5, 2021

Conversation

Djazouli
Copy link
Contributor

@Djazouli Djazouli commented Mar 2, 2021

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
Do not throw an error if we are asking a sensitivity on a component that is not in the network

…cted component

Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
@Djazouli Djazouli force-pushed the disconnected_sensitivities_management branch from 59b593d to 393137d Compare March 2, 2021 17:58
@Djazouli Djazouli requested a review from annetill March 2, 2021 18:09
enum Status {
VALID,
SKIP,
NULL
Copy link
Member

Choose a reason for hiding this comment

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

You don't need this enum value, just use a null status

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For me, null and Status.NULL would represent two different things:

  • If the status is Status.NULL, it means that the value for this sensitivity factor will be null (0), because it is a sensitivity on a disconnected branch
  • if the status is null (meaning: the sensitivity factor has no value), then this is a bug

Copy link
Member

Choose a reason for hiding this comment

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

So here NULL means zero. this make me think it is NULL as null in Java so an enum with a mix of business and technical values which is a bad practice

Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
@geofjamg
Copy link
Member

geofjamg commented Mar 4, 2021

@Djazouli I just tested, it works very well, but it is quite verbose. When a transformer is disconnected and is the variable of many factors we end up with as many warn as functions for this variables. Maybe we can in this skip have just one warning saying: "skipping all factors with variable ..." ?

Signed-off-by: Gael Macherel <gael.macherel@artelys.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 4, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 7 Code Smells

94.2% 94.2% Coverage
0.0% 0.0% Duplication

@geofjamg geofjamg merged commit aec2d27 into master Mar 5, 2021
@geofjamg geofjamg deleted the disconnected_sensitivities_management branch March 5, 2021 08:49
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