]> Nutra Git (v2) - nutratech/cli.git/commitdiff
fix quadratic with -g | --grams
authorShane Jaroch <chown_tee@proton.me>
Mon, 26 Feb 2024 03:06:37 +0000 (22:06 -0500)
committerShane Jaroch <chown_tee@proton.me>
Mon, 26 Feb 2024 03:06:53 +0000 (22:06 -0500)
ntclient/core/nutprogbar.py

index d23a91dbe124d5a8910fd06b00cba913c7c08c3b..9f30dd6fd1a3bc78b20a5e237ac8f47343fa76ba 100644 (file)
@@ -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