Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of 0 and < in nutritional values #8163

Open
aleene opened this issue Mar 6, 2023 · 1 comment
Open

Handling of 0 and < in nutritional values #8163

aleene opened this issue Mar 6, 2023 · 1 comment
Labels
🐛 bug This is a bug, not a feature request. 📊 graphs ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it.

Comments

@aleene
Copy link
Contributor

aleene commented Mar 6, 2023

Describe the bug

The graphs and stats created by the advanced feature, now treat values with 0 and values with limits (< 0.5) like normal data. This results in strange graphs and stats.
Screenshot 2023-03-06 at 16 14 55
The graph above for example presents the protein values for the category apple nectars. The values around 0.5 and 0.1 are due limits on the package. The zeros ar no actual values either, but rounding errors mad by the producers. Only the values between 0 and 0.1 are actual measurements.

To Reproduce

For instance this graph and stats: https://world.openfoodfacts.org/cgi/search.pl?action=process&tagtype_0=categories&tag_contains_0=contains&tag_0=apple-nectars&sort_by=unique_scans_n&page_size=20&axis_x=energy&axis_y=proteins&graph=1

Expected behavior

The maxima (<) and 0 should be treated as special values:

  • 0 is in fact a rounding error, better is to interpret this as < 0.5. I reality it never can be 0. Some producers note 0.0 (which is now lost in records), which could be interpreted as < 0.05. (at least that is what I learned to do for my physics degree);
  • exclude the maxima (including the 0) from the stats calculations;
  • for the graphs have the possibility to exclude the maxima and/or display them in another way (a downward arrow would be best);

Number of products impacted

Any product with 0 or maxima.

Part of

@aleene aleene added the 🐛 bug This is a bug, not a feature request. label Mar 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 5, 2023

This issue is stale because it has been open 90 days with no activity.

@github-actions github-actions bot added the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug This is a bug, not a feature request. 📊 graphs ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it.
Projects
Status: To discuss and validate
Development

No branches or pull requests

2 participants