Skip to content

View or edit on GitHub

This page is synchronized from trase/models/diet_trase/coffee_fullmodel/diet_trase_coffee_2020.md. Last modified on 2026-03-21 22:30 CET by Trase Admin. Please view or edit the original file there; changes should be reflected here after a midnight build (CET time), or manually triggering it with a GitHub action (link).

Diet Trase Coffee 2020

This notebook summarises the output of the Diet Trase Coffee model. It runs off a single file:

s3://trase-storage/diet-trase/diet-trase-results-2020.parquet

Here is a summary of the data:

FloatProgress(value=0.0, layout=Layout(width='auto'), style=ProgressStyle(bar_color='black'))
column_name column_type min max approx_unique avg std q25 q50 q75 count null_percentage
0 branch VARCHAR 1.2 4 2 2204251 0
1 country_of_destination VARCHAR AFGHANISTAN ZIMBABWE 252 2204251 0
2 country_of_production_name VARCHAR ANGOLA ZIMBABWE 61 2204251 0
3 domestic_consumption_region_geocode VARCHAR 0101 XX 7496 2204251 0
4 domestic_consumption_region_level FLOAT 1.0 6.0 4 5.3594 1.31485 6 6 6 2204251 99.62
5 domestic_consumption_region_name VARCHAR ABANCAY ÚTICA 6290 2204251 0
6 economic_bloc VARCHAR AFGHANISTAN ZIMBABWE 232 2204251 0
7 exporter_group_name VARCHAR 06678 ZRII LLC SUCURSAL COLOMBIA 2830 2204251 0.38
8 exporter_group_parent VARCHAR BENECKE COFFEE GMBH & CO. KG WALTER MATTER 33 2204251 76.54
9 exporter_label VARCHAR 06678 ZRII LLC SUC COLOMBIA 3462 2204251 0.38
10 exporter_name VARCHAR 06678 ZRII LLC SUCURSAL COLOMBIA 2943 2204251 0.38
11 exporter_node_id INTEGER 17890 15608568 3106 3.96188e+06 6.12949e+06 71907 629348 2.31078e+06 2204251 0.38
12 fob DOUBLE 3.176467645129476e-05 354972528.0 2365011 9346.14 524447 98.3685 405.406 1701.22 2204251 0.38
13 hs6 VARCHAR 090111 210112 6 2204251 0.38
14 importer_group VARCHAR 1 RED RANGER LLC 新疆万达有限公司 [XINJIANG WANDA CO.,LTD] 2824 2204251 0.38
15 importer_label VARCHAR “““““““TABYS”““” LTD,““” ZYS GLOBAL LOJISTIK TIC LTD STI 9356 2204251 0.38
16 importer_name VARCHAR 1 RED RANGER LLC 新疆万达有限公司 [XINJIANG WANDA CO.,LTD] 3003 2204251 0.38
17 is_domestic BOOLEAN false true 2 2204251 0
18 linear_programming_failure_reason VARCHAR Traceback (most recent call last): 5 2204251 0.38
File “/home/sagemaker-user/users/harry/TRASE_copy/trase/models/diet_trase/coffee_fullmodel/model.py”, line 205, in linear_programming
allocation = linear_programming_for_country(supplychain, country)
File “/home/sagemaker-user/users/harry/TRASE_copy/trase/models/diet_trase/coffee_fullmodel/model.py”, line 255, in linear_programming_for_country
assert not dpop.empty, f”Missing population data for {country}”
AssertionError: Missing population data for VIETNAM
19 mass_tonnes DOUBLE 1.5803179420184944e-08 86638.6 1357430 3.56785 154.868 0.0324852 0.142323 0.630089 2204251 0.38
20 mass_tonnes_raw_equivalent DOUBLE 1.5803179420184944e-08 107581.86044999973 1556769 4.37439 175.085 0.0334483 0.14712 0.651956 2204251 0
21 padded BOOLEAN false true 2 2204251 0.38
22 padded_type VARCHAR partial_pad_hs6_prod_and_dest_countries 4 2204251 0
23 port_of_export_label VARCHAR 1088 BORDER GATE 1089 LS ZANZIBAR AIRPORT 278 2204251 0.38
24 port_of_export_name VARCHAR 1088 BORDER GATE 1089 LS ZANZIBAR AIRPORT 293 2204251 0
25 production_geocode VARCHAR 0101 XX 2100 2204251 0
26 production_geocode_level FLOAT 1.0 6.0 4 4.89429 1.48347 3 6 6 2204251 0.73
27 production_geocode_name VARCHAR ABEJORRAL Óleo 2235 2204251 0
28 proportion DOUBLE 4.1587314263644594e-07 1.0 819 0.0197169 0.116376 0.000887398 0.00271231 0.00642532 2204251 0
29 status VARCHAR LP FAILED TO RESULTS 3 2204251 0
30 year BIGINT 2020 2020 1 2020 0 2020 2020 2020 2204251 0

The model works on a country-by-country basis. Here is a summary of the outcome of each country:

branch status number of countries countries
4 TO RESULTS 47 HONDURAS, CHINA (MAINLAND), PARAGUAY, PAPUA NEW GUINEA, FIJI, BURUNDI, PHILIPPINES, SRI LANKA, DOMINICAN REPUBLIC, MADAGASCAR, THAILAND, TIMOR-LESTE, CAMEROON, GUATEMALA, UNITED STATES, BELIZE, SAO TOME AND PRINCIPE, ZIMBABWE, MYANMAR, DOMINICA ISLAND, JAMAICA, KENYA, GABON, TOGO, NEPAL, CONGO DEMOCRATIC REPUBLIC OF THE, NIGERIA, TRINIDAD AND TOBAGO, MOZAMBIQUE, GUYANA, ANGOLA, NICARAGUA, FRENCH POLYNESIA, BOLIVIA, ZAMBIA, RWANDA, CUBA, MALAWI, MEXICO, COSTA RICA, BENIN, MALAYSIA, PANAMA, CAMBODIA, LAO PEOPLE’S DEMOCRATIC REPUBLIC, ECUADOR, EL SALVADOR
1.2 LP SUCCEEDED 6 INDONESIA, TANZANIA, COLOMBIA, BRAZIL, PERU, INDIA
1.2 LP FAILED 4 ETHIOPIA, UGANDA, VIETNAM, COTE D’IVOIRE

Quality assurance check: each country should have exactly one status and branch. It cannot be that a country has a mix of statuses and branches. Checking this is the case and reporting back:

✅ Looks good