From c0c85b42df8596c4fcfde83a62845141b1979bed Mon Sep 17 00:00:00 2001 From: Shane Jaroch Date: Sun, 25 Feb 2024 22:06:37 -0500 Subject: [PATCH] fix quadratic with -g | --grams --- ntclient/core/nutprogbar.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ntclient/core/nutprogbar.py b/ntclient/core/nutprogbar.py index d23a91d..9f30dd6 100644 --- a/ntclient/core/nutprogbar.py +++ b/ntclient/core/nutprogbar.py @@ -43,14 +43,13 @@ def nutrient_progress_bars( # Tally the nutrient totals nut_amts = {} - for food_id, grams in _food_amts.items(): - ratio = grams / 100.0 + for food_id in _food_amts.keys(): analysis = food_analyses_dict[food_id] for nutrient_id, amt in analysis.items(): if nutrient_id not in nut_amts: - nut_amts[int(nutrient_id)] = amt * ratio + nut_amts[int(nutrient_id)] = amt else: - nut_amts[int(nutrient_id)] += amt * ratio + nut_amts[int(nutrient_id)] += amt print_bars() return nut_amts -- 2.52.0