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

Fix bug with calculating quality evaluation #281

Merged
merged 2 commits into from
Jan 21, 2025

Conversation

jnatten
Copy link
Contributor

@jnatten jnatten commented Jan 20, 2025

NB: Krever at vi kjører et kall til /v1/admin/buildAverageTree for å gjenskape snittene.

Jeg tror denne skal fikse problemet med at kvalitetsvurderingssnittene noen ganger er feil.

Var en bug der som gjorde at databasen ikke var oppdatert ved en rekalkulering som gjorde at "count" var feil.
Dette vil jo propagere dersom noen oppdaterer et snitt som er feil.

Endrer også til at vi lagrer sum'en og heller regner ut snittet på vei ut av apiet. Dette gjør at vi unngår floating point precision problemer.

This patch improves the quality evaluation on a few points:
  - The stored value is no longer a calculated float. This helps us
    avoid floating point precision problems in the database.
  - The count is now correctly computed on full tree calculation.
    - Previously this was not the case and could lead to miscalculated
      averages after updates that happened after a full tree
      calculation.
@jnatten jnatten requested a review from a team January 20, 2025 14:29
Copy link
Member

@gunnarvelle gunnarvelle left a comment

Choose a reason for hiding this comment

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

lgtm

This makes calling `wipeQualityEvaluationAverages` slightly safer i
think 😄
@jnatten jnatten merged commit cec7003 into master Jan 21, 2025
3 checks passed
@jnatten jnatten deleted the grade-average-calculation-bug branch January 21, 2025 08:52
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