From f4fc1ddc374fe281036ea53a86c090c95898be76 Mon Sep 17 00:00:00 2001 From: Andy Lulham Date: Mon, 10 Jun 2024 14:58:22 +0100 Subject: [PATCH] refactor: rename variable --- x_notes/ratings.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/x_notes/ratings.py b/x_notes/ratings.py index 9f9f6adfb..b2db5db01 100644 --- a/x_notes/ratings.py +++ b/x_notes/ratings.py @@ -3,7 +3,11 @@ from .helpers import load_notes, save_notes from .tsv import get_generator -helpfulness_lookup = {"HELPFUL": 2, "SOMEWHAT_HELPFUL": 1, "NOT_HELPFUL": -2} +helpfulness_score = { + "HELPFUL": 2, + "SOMEWHAT_HELPFUL": 1, + "NOT_HELPFUL": -2, +} def add_ratings(notes: dict[str, dict[str, Any]]) -> None: @@ -26,7 +30,7 @@ def add_ratings(notes: dict[str, dict[str, Any]]) -> None: note["ratings"] = 0 note["score"] = 0 note["ratings"] += 1 - note["score"] += helpfulness_lookup[row["helpfulnessLevel"]] + note["score"] += helpfulness_score[row["helpfulnessLevel"]] index += 1 save_notes(notes)