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

refactor: extracted processing of child scores #8

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

janniclas
Copy link
Contributor

extracted processing of child scores in CalculationStrategy in a separate method.

  • removed redundant loops
  • added documentation

…CalculationStrategy in a separate method.

- removed redundant loops
- added documentation
@janniclas janniclas self-assigned this Aug 14, 2024
)
)
}
hasIncompleteResults = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

instead of setting this explicitly you could make it an auto-computed property on the SeparatedKpiResults and check if either list does not has elements. (or if missingEdgeWeights is > 0.0 [if that's a valid constraint])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually no.
Neither the failed list nor missingEdgeWeights tells us this information.
This flag should indicate if there was any incomplete (Incomplete, Failed, Error) element in the initial childScores. However, in non strict mode, we cast Incomplete elements to Success elements and continue calculation. Thus, the failed list can be empty in this case, the missingEdgeWeights is 0.0, however, there was an incomplete input.
This happens for this input childScores = listOf(KpiResult.Incomplete(..), 1.0) calculateKpi(childScores, strict = false). Here we want to continue our calculation due to strict = false, however, we still want to indicate that the calculation is based on an incomplete result. Thus the flag.

This is something to maybe improve on later or somehow make it more explicit.

@janniclas janniclas merged commit 0c0f9f3 into main Aug 14, 2024
1 check passed
@janniclas janniclas deleted the f-extractProcessChild branch August 14, 2024 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants