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

taxonomy: mushrooms etc #8371

Merged
merged 16 commits into from
Jul 4, 2023
Merged

Conversation

ArturLange
Copy link
Contributor

What

  • Standarize mushrooms taxonomy a little
  • Improve polish ingredients processing

Copy link
Contributor

@aleene aleene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your changes. You might update some entries and replace them with an xx: entry, the xx: works as a default when a language line is missing. This keeps some ingredients a bit smaller.

taxonomies/ingredients.txt Outdated Show resolved Hide resolved
taxonomies/ingredients.txt Outdated Show resolved Hide resolved
taxonomies/ingredients.txt Outdated Show resolved Hide resolved
Copy link
Contributor

@stephanegigandet stephanegigandet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@stephanegigandet
Copy link
Contributor

@ArturLange can you run "make lint" to make the tests pass?

@github-actions github-actions bot added the 💥 Merge Conflicts 💥 Merge Conflicts label May 3, 2023
@github-actions github-actions bot removed the 💥 Merge Conflicts 💥 Merge Conflicts label May 5, 2023
@ArturLange ArturLange requested a review from aleene May 5, 2023 16:57
@benbenben2
Copy link
Collaborator

Hi @ArturLange! Great job!

Looking at the logs, you have 3 failed tests:

2023-05-15T21:06:54.1160257Z #   Failed test at tests/unit/ingredients_parsing.t line 590.
2023-05-15T21:06:54.1161041Z Wide character in print at /opt/perl/local/lib/perl5/Test2/Formatter/TAP.pm line 125.
2023-05-15T21:06:54.1161833Z #          got: 'oleje roślinne (słonecznikowy, rzepakowy)'
2023-05-15T21:06:54.1162307Z #     expected: 'olej roślinny słonecznikowy, olej roślinny rzepakowy'

If you want to parse them, it seems to be in Ingredients.pm, "# Vegetal oil (palm, sunflower and olive)". But it seems not be as simple as that in Polish.

023-05-15T21:07:06.1133742Z #   Failed test at tests/unit/ingredients_processing.t line 1711.
2023-05-15T21:07:06.1134121Z #     Structures begin differing at:
2023-05-15T21:07:06.1134694Z #          $got->[0]{id} = 'en:dried-garlic'
2023-05-15T21:07:06.1135129Z #     $expected->[0]{id} = 'en:dried garlic'
2023-05-15T21:07:06.1135393Z [
2023-05-15T21:07:06.1135580Z   {
2023-05-15T21:07:06.1135882Z     'id' => 'en:dried-garlic',
2023-05-15T21:07:06.1136206Z     'text' => 'czosnek suszony'
2023-05-15T21:07:06.1136432Z   },
2023-05-15T21:07:06.1136646Z   {
2023-05-15T21:07:06.1136930Z     'id' => 'en:dried-garlic',
2023-05-15T21:07:06.1137232Z     'text' => 'suszony czosnek'
2023-05-15T21:07:06.1137796Z   }
2023-05-15T21:07:06.1138180Z ]
2023-05-15T21:07:32.3591462Z #   Failed test at /opt/product-opener/lib/ProductOpener/Test.pm line 329.
2023-05-15T21:07:32.3591806Z # 
2023-05-15T21:07:32.3606064Z #     Structures begin differing at:
2023-05-15T21:07:32.3606558Z #          $got->{ingredients_tags}[2] = 'en:pleurotus'
2023-05-15T21:07:32.3607006Z #     $expected->{ingredients_tags}[2] = 'fr:chapelure-de-mais'

That one seems to be from tests/unit/expected_test_results/nutriscore/mushrooms.json. Try to run "make update_tests_results". Or copy paste the file from the actual main branch.

@github-actions github-actions bot added the 💥 Merge Conflicts 💥 Merge Conflicts label May 26, 2023
@alexgarel
Copy link
Member

@ArturLange thanks for the contribution. If it's too hard for you to fix tests, just tell it, we might try to find the time to do it.

@alexgarel
Copy link
Member

BTW make update_tests_results can help you :-)

see https://openfoodfacts.github.io/openfoodfacts-server/dev/how-to-write-and-run-tests/#running-tests

@ArturLange ArturLange closed this Jun 10, 2023
@ArturLange ArturLange force-pushed the taxonomy_mushrooms branch 2 times, most recently from e15d54c to 2369f07 Compare June 10, 2023 04:53
@ArturLange ArturLange reopened this Jun 10, 2023
@github-actions github-actions bot added 🥗 Ingredients 🥗 Ingredients - processing 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies 🧪 tests and removed 💥 Merge Conflicts 💥 Merge Conflicts labels Jun 10, 2023
@alexgarel
Copy link
Member

@benbenben2 do you want to try to finish this PR ?

@github-actions github-actions bot added the 💥 Merge Conflicts 💥 Merge Conflicts label Jun 19, 2023
@github-actions github-actions bot added the 🥗🔍 Ingredients analysis https://wiki.openfoodfacts.org/Ingredients_Extraction_and_Analysis label Jun 21, 2023
@ArturLange
Copy link
Contributor Author

Thanks @alexgarel, it took me some time to get to know perl a little and set up the environment, but it really helped 👍

I fixed the tests and added preparsing to Polish language, @aleene could you review again? 🙂

@github-actions github-actions bot added 💥 Merge Conflicts 💥 Merge Conflicts and removed 💥 Merge Conflicts 💥 Merge Conflicts labels Jun 26, 2023
@sonarcloud
Copy link

sonarcloud bot commented Jun 28, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@github-actions github-actions bot removed the 💥 Merge Conflicts 💥 Merge Conflicts label Jun 29, 2023
@alexgarel
Copy link
Member

Big up @ArturLange for the though work 🎉

@alexgarel alexgarel merged commit 08ba32e into openfoodfacts:main Jul 4, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧪 additives 🥗 Ingredients - processing 🥗🔍 Ingredients analysis https://wiki.openfoodfacts.org/Ingredients_Extraction_and_Analysis 🥗 Ingredients 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies 🧪 tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants