Skip to content

Commit 5643f40

Browse files
authored
Merge branch 'main' into fr-ingredients-boost
2 parents dad72d4 + 682007a commit 5643f40

54 files changed

Lines changed: 311044 additions & 1413 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.test_groups_cache/unit_groups.json

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
"tests/unit/load_csv_or_excel_file.t",
1313
"tests/unit/nutriscore.t",
1414
"tests/unit/packaging_food_contact.t",
15-
"tests/unit/product_schema_changes.t",
16-
"tests/unit/reuse_knowledge_panels.t",
17-
"tests/unit/tags.t",
18-
"tests/unit/test.t"
15+
"tests/unit/product_edit_form.t",
16+
"tests/unit/redis.t",
17+
"tests/unit/store.t",
18+
"tests/unit/templates.t"
1919
],
2020
"total_time": 450.0
2121
},
@@ -32,10 +32,10 @@
3232
"tests/unit/maintain_knowledge_panels.t",
3333
"tests/unit/nutrition.t",
3434
"tests/unit/packaging_stats.t",
35-
"tests/unit/products.t",
36-
"tests/unit/routing.t",
37-
"tests/unit/tags_unit.t",
38-
"tests/unit/text.t"
35+
"tests/unit/product_schema_changes.t",
36+
"tests/unit/reuse_knowledge_panels.t",
37+
"tests/unit/tags.t",
38+
"tests/unit/test.t"
3939
],
4040
"total_time": 450.0
4141
},
@@ -52,10 +52,10 @@
5252
"tests/unit/match_ingredient_origin.t",
5353
"tests/unit/nutrition_ciqual.t",
5454
"tests/unit/parse_origins_from_text.t",
55-
"tests/unit/products_comparison.t",
56-
"tests/unit/send_image_to_cloud_vision.t",
57-
"tests/unit/taxonomies.t",
58-
"tests/unit/texts.t"
55+
"tests/unit/products.t",
56+
"tests/unit/routing.t",
57+
"tests/unit/tags_unit.t",
58+
"tests/unit/text.t"
5959
],
6060
"total_time": 450.0
6161
},
@@ -72,10 +72,10 @@
7272
"tests/unit/nova.t",
7373
"tests/unit/nutrition_estimation.t",
7474
"tests/unit/paths.t",
75-
"tests/unit/products_tags.t",
76-
"tests/unit/spam_user.t",
77-
"tests/unit/taxonomies_enhancer.t",
78-
"tests/unit/units.t"
75+
"tests/unit/products_comparison.t",
76+
"tests/unit/send_image_to_cloud_vision.t",
77+
"tests/unit/taxonomies.t",
78+
"tests/unit/texts.t"
7979
],
8080
"total_time": 450.0
8181
},
@@ -92,10 +92,10 @@
9292
"tests/unit/numbers.t",
9393
"tests/unit/packager_codes.t",
9494
"tests/unit/process_product_edit_rules.t",
95-
"tests/unit/recipes.t",
96-
"tests/unit/storage_conditions.t",
97-
"tests/unit/taxonomy_suggestions.t",
98-
"tests/unit/vitamins.t"
95+
"tests/unit/products_tags.t",
96+
"tests/unit/spam_user.t",
97+
"tests/unit/taxonomies_enhancer.t",
98+
"tests/unit/units.t"
9999
],
100100
"total_time": 450.0
101101
},
@@ -112,10 +112,11 @@
112112
"tests/unit/nutrient_levels.t",
113113
"tests/unit/packaging.t",
114114
"tests/unit/producers.t",
115-
"tests/unit/redis.t",
116-
"tests/unit/store.t",
117-
"tests/unit/templates.t"
115+
"tests/unit/recipes.t",
116+
"tests/unit/storage_conditions.t",
117+
"tests/unit/taxonomy_suggestions.t",
118+
"tests/unit/vitamins.t"
118119
],
119-
"total_time": 420.0
120+
"total_time": 450.0
120121
}
121122
]

.test_groups_cache/unit_groups.mk

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# Auto-calculated 6 groups for 89 tests (total estimated time: 44m)
1+
# Auto-calculated 6 groups for 90 tests (total estimated time: 45m)
22
# Generated test groups for unit tests
3-
UNIT_GROUP_1_TESTS := additives.t api.t cache_safe_cache_ops.t dataqualitydimensions.t food.t images.t ingredients_clean.t ingredients_percent.t load_csv_or_excel_file.t nutriscore.t packaging_food_contact.t product_schema_changes.t reuse_knowledge_panels.t tags.t test.t
4-
UNIT_GROUP_2_TESTS := additives_tags.t attributes.t contribution_knowledge_panels.t dataqualityfood.t food_groups.t import.t ingredients_contents.t ingredients_preparsing.t maintain_knowledge_panels.t nutrition.t packaging_stats.t products.t routing.t tags_unit.t text.t
5-
UNIT_GROUP_3_TESTS := all_pod_correct.t auth_oidc_cache.t convert_gs1_xml_to_json.t dataqualityfood_labels.t forest_footprint.t import_convert_carrefour_france.t ingredients_extract.t ingredients_processing.t match_ingredient_origin.t nutrition_ciqual.t parse_origins_from_text.t products_comparison.t send_image_to_cloud_vision.t taxonomies.t texts.t
6-
UNIT_GROUP_4_TESTS := allergens.t auth_oidc_state_validation.t cursor.t display.t forest_footprint_2026.t import_gs1.t ingredients_nesting.t ingredients_tags.t nova.t nutrition_estimation.t paths.t products_tags.t spam_user.t taxonomies_enhancer.t units.t
7-
UNIT_GROUP_5_TESTS := allergens_tags.t booleans.t data_quality_tags_panel.t environmental_impact.t health.t ingredients.t ingredients_nutriscore.t knowledge_panels.t numbers.t packager_codes.t process_product_edit_rules.t recipes.t storage_conditions.t taxonomy_suggestions.t vitamins.t
8-
UNIT_GROUP_6_TESTS := analyze_and_enrich_product_data.t brevo.t dataquality.t environmental_score.t i18n.t ingredients_analysis.t ingredients_parsing_todo.t lang.t nutrient_levels.t packaging.t producers.t redis.t store.t templates.t
3+
UNIT_GROUP_1_TESTS := additives.t api.t cache_safe_cache_ops.t dataqualitydimensions.t food.t images.t ingredients_clean.t ingredients_percent.t load_csv_or_excel_file.t nutriscore.t packaging_food_contact.t product_edit_form.t redis.t store.t templates.t
4+
UNIT_GROUP_2_TESTS := additives_tags.t attributes.t contribution_knowledge_panels.t dataqualityfood.t food_groups.t import.t ingredients_contents.t ingredients_preparsing.t maintain_knowledge_panels.t nutrition.t packaging_stats.t product_schema_changes.t reuse_knowledge_panels.t tags.t test.t
5+
UNIT_GROUP_3_TESTS := all_pod_correct.t auth_oidc_cache.t convert_gs1_xml_to_json.t dataqualityfood_labels.t forest_footprint.t import_convert_carrefour_france.t ingredients_extract.t ingredients_processing.t match_ingredient_origin.t nutrition_ciqual.t parse_origins_from_text.t products.t routing.t tags_unit.t text.t
6+
UNIT_GROUP_4_TESTS := allergens.t auth_oidc_state_validation.t cursor.t display.t forest_footprint_2026.t import_gs1.t ingredients_nesting.t ingredients_tags.t nova.t nutrition_estimation.t paths.t products_comparison.t send_image_to_cloud_vision.t taxonomies.t texts.t
7+
UNIT_GROUP_5_TESTS := allergens_tags.t booleans.t data_quality_tags_panel.t environmental_impact.t health.t ingredients.t ingredients_nutriscore.t knowledge_panels.t numbers.t packager_codes.t process_product_edit_rules.t products_tags.t spam_user.t taxonomies_enhancer.t units.t
8+
UNIT_GROUP_6_TESTS := analyze_and_enrich_product_data.t brevo.t dataquality.t environmental_score.t i18n.t ingredients_analysis.t ingredients_parsing_todo.t lang.t nutrient_levels.t packaging.t producers.t recipes.t storage_conditions.t taxonomy_suggestions.t vitamins.t
99

1010
# Group Statistics:
1111
# Group 1: 15 tests, 7m 30s
1212
# Group 2: 15 tests, 7m 30s
1313
# Group 3: 15 tests, 7m 30s
1414
# Group 4: 15 tests, 7m 30s
1515
# Group 5: 15 tests, 7m 30s
16-
# Group 6: 14 tests, 7m 0s
17-
# Max group time: 8m, Min: 7m, Avg: 7m
16+
# Group 6: 15 tests, 7m 30s
17+
# Max group time: 8m, Min: 8m, Avg: 8m

projects/foodture/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ingredients_sum.csv
2+
representative_products.csv
3+
tmp/
4+

scripts/projects/foodture/extract_data_for_representative_products.pl renamed to projects/foodture/extract_data_for_representative_products.pl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
my @ingredient_languages = qw/en fr/;
8888

8989
# caching directory for API responses
90-
my $cache_dir = "foodture/api_cache";
90+
my $cache_dir = "projects/foodture/tmp/api_cache";
9191
mkdir $cache_dir unless -d $cache_dir;
9292

9393
# variables for API fetching
@@ -150,7 +150,7 @@ sub collect_ingredients {
150150
}
151151

152152
# first pass: read ranked products and group by country/category tags
153-
my $ranked_file = "foodture/ranked_products_202602231414.csv";
153+
my $ranked_file = "projects/foodture/ranked_products_202602231414.csv";
154154
open my $RANK, '<:encoding(UTF-8)', $ranked_file or die "Cannot open $ranked_file: $!\n";
155155
<$RANK>; # skip header
156156
my $parser = Text::CSV->new(
@@ -188,12 +188,12 @@ sub collect_ingredients {
188188
close $RANK;
189189

190190
# read target country/category pairs and output rows as we go
191-
my $list_file = "foodture/16.06.2026_Correspondance_FT_OFF_pour_extract.csv";
191+
my $list_file = "projects/foodture/foodture_foodex2_categories_mapping_to_off.csv";
192192
open my $LIST, '<:encoding(UTF-8)', $list_file or die "Cannot open $list_file: $!\n";
193193
<$LIST>; # skip header
194194

195195
# prepare output file
196-
my $out_file = "foodture/representative_products.csv";
196+
my $out_file = "projects/foodture/representative_products.csv";
197197
open my $OUT, '>:encoding(UTF-8)', $out_file or die "Cannot write $out_file: $!\n";
198198
my $csv_out = Text::CSV->new({binary => 1, eol => "\n"})
199199
or die "Cannot create CSV writer: " . Text::CSV->error_diag();
@@ -420,7 +420,7 @@ sub collect_ingredients {
420420
close $OUT;
421421

422422
# Create a second CSV table that lists all ingredients with the sum of their percentages across all products
423-
my $ingredients_file = "foodture/ingredients_sum.csv";
423+
my $ingredients_file = "projects/foodture/ingredients_sum.csv";
424424
open my $ING_OUT, '>:encoding(UTF-8)', $ingredients_file or die "Cannot write $ingredients_file: $!\n";
425425
my @ingredients_header = (
426426
"ingredient_id",

0 commit comments

Comments
 (0)