Skip to content

Commit

Permalink
Readme corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
john-gom committed Nov 20, 2023
1 parent fbdd6e4 commit 145946d
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ This is using Python3.

Create a virtualenv.
```
cd ./backend
python -m venv venv
```

Expand All @@ -43,7 +42,6 @@ pip install -r requirements.txt
To run the API server:

```
cd ./backend
uvicorn main:app --reload
```

Expand Down Expand Up @@ -94,8 +92,6 @@ curl https://static.openfoodfacts.org/data/taxonomies/ingredients.json --output

Having found the ingredient in CIQUAL a nutrient map is added to each ingredient. Only the "main" nutrient is used (one without an underscore suffix).

A separate map is also returned providing the CIQUAL database identifier for each OFF nutrient.

## Determine nutrients for computation

Only nutrients that occur on every ingredient can be used. Energy is also eliminated as this combines multiple nutrients.
Expand All @@ -112,7 +108,7 @@ The estimation attempts to find the proportion of each ingredient that minimises

An example return structure is shown below:

```
```json
ingredients: [
{
id: "en:tomato",
Expand All @@ -129,18 +125,17 @@ ingredients: [
recipe_estimator: {
nutrients: {
calcium: {
product_value: 0.06,
product_total: 0.06,
weighting: 1000,
ciqual_id: "Calcium (mg/100g)"
},
vitamin-b2: {
ciqual_id: "Vitamin B2 or Riboflavin (mg/100g)",
notes: "Not listed on product"
},
...
},
ingredients_count: 3,
ingredient_count: 3,
iterations: 35,
status: 0,
time: 0.2
}
```
Expand All @@ -167,6 +162,7 @@ This will provide details of the computation performed, such as time taken and n
# TODO

- Need to return a more formal error object
- Use min and max for ingredient nutrient when stated as "< ..." in CIQUAL
- Use min and max from CIQUAL for unmatched ingredients
- Cope with min and max on product nutrients (e.g. if we had to get from a category)

Expand Down

0 comments on commit 145946d

Please sign in to comment.