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

Feature request: plugin to apply European Commission nutrient rounding #1253

Open
jayaddison opened this issue Sep 9, 2024 · 1 comment
Open

Comments

@jayaddison
Copy link
Collaborator

          The European Commission provides some rounding rules that I believe could be implemented as a plugin: https://food.ec.europa.eu/document/download/3eb7952a-43b8-4c6a-8091-349ea707a9a7_en?filename=labelling_nutrition-vitamins_minerals-guidance_tolerances_1212_en.pdf#page=15

However: that's outside the scope of this pull request. I'll note also that it requires knowledge of the measurement units referenced in some cases, in order to select the relevant logic rules to apply.

Because I'd prefer to figure out a way to harmonise the output values of the nutrients field, I think it makes sense for me to file a feature request for that (and perhaps to try implementing it in the nearish future).

Originally posted by @jayaddison in #1237 (comment)

@jayaddison
Copy link
Collaborator Author

This turns out to be non-trivial to implement, partly because the values in the nutrients result are not simply decimal numbers, but are quantities represented as string (str) values that contain unit names -- and potentially those units may be qualified by scale (g vs mg vs kg).

This could be a candidate for a non-core plugin, either within this repository but disabled by default, or in an entirely separate source code repository. It would be nice to demonstrate that additional plugins can be written without requiring that they're part of the core / enabled by default, and with their own separate test coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant