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

feat: added quality facet error for reversed kcal and kj #8438

Merged
merged 1 commit into from
May 23, 2023

Conversation

benbenben2
Copy link
Collaborator

@benbenben2 benbenben2 commented May 20, 2023

Make sure you've done all the following (You can delete the checklist before submitting)

  • PR title is prefixed by one of the following: feat, fix, docs, style, refactor, test, build, ci, chore, revert, l10n, taxonomy
  • Code is well documented
  • Include unit tests for new functionality
  • Code passes GitHub workflow checks in your branch
  • If you have multiple commits please combine them into one commit by squashing them.
  • Read and understood the contribution guidelines

What

added data quality error for reversed kj and kcal

Instead of the formula in issue #8394, we can use the exact opposite of the formula used for "en:energy-value-in-kcal-does-not-match-value-in-kj" (reverse kcal and kj, and reversed < and >, so that any kcal that is in the window 3.7*kj -2 and 4.7*kj + 2 can be considered as reversed kcal and kj)

Also added tests for "en:energy-value-in-kcal-does-not-match-value-in-kj" (see: # TODO: add tests in /tests/unit/dataqualityfood.t ?!?)

Screenshot

image

Related issue(s) and discussion

@benbenben2 benbenben2 self-assigned this May 20, 2023
@benbenben2 benbenben2 requested a review from a team as a code owner May 20, 2023 21:10
@github-actions github-actions bot added 🧽 Data quality https://wiki.openfoodfacts.org/Quality 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies 🧪 tests labels May 20, 2023
@sonarcloud
Copy link

sonarcloud bot commented May 20, 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

@codecov-commenter
Copy link

Codecov Report

Merging #8438 (8fb8b17) into main (95bb4e2) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #8438      +/-   ##
==========================================
+ Coverage   48.54%   48.61%   +0.06%     
==========================================
  Files         114      114              
  Lines       21314    21334      +20     
  Branches     4776     4777       +1     
==========================================
+ Hits        10347    10371      +24     
+ Misses       9679     9677       -2     
+ Partials     1288     1286       -2     
Impacted Files Coverage Δ
lib/ProductOpener/DataQualityFood.pm 61.22% <100.00%> (+1.28%) ⬆️
tests/unit/dataqualityfood.t 86.32% <100.00%> (+1.26%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

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

Really cool :-)

@alexgarel alexgarel merged commit 0c76d76 into main May 23, 2023
18 checks passed
@alexgarel alexgarel deleted the feat_kcal_kj_inversion branch May 23, 2023 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧽 Data quality https://wiki.openfoodfacts.org/Quality 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies 🧪 tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New data-quality-error for kcal/kj inversion
3 participants