-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
in cases where analyze_recipe creates a combined food (by calling combining nutrients), analyze_food may override existing values using the same nutrient_id (
usda_fdc_python/usda_fdc/analysis/analysis.py
Line 148 in ce8c35d
elif nutrient_id == "calories": |
if nutrient_id == "protein":
analysis.protein_per_serving = amount
elif nutrient_id == "fat":
analysis.fat_per_serving = amount
elif nutrient_id == "carbs":
analysis.carbs_per_serving = amount
elif nutrient_id == "calories":
analysis.calories_per_serving = amount
For example, energy with KJ and energy with KCal both have calories as nutrient_id. This happens often in the combined food. As a result, the latter will override the calories_per_serving
with another amount, causing the previous amount overriden
Metadata
Metadata
Assignees
Labels
No labels