Skip to content

Main

View or edit on GitHub

This page is synchronized from trase/models/brazil/soy_2017_qa/main.ipynb. Last modified on 2025-12-14 23:19 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).

Quality assurance branches

This table presents the quality assurance decision tree branches:

Overlap better hub same hub different hub in same state hub in different state old unknown new unknown
CNPJ-port-country 2.1 1.1 3.1 4.1 5.1 6.1
CNPJ-port 2.2 1.2 3.2 4.2 5.2 6.2
CNPJ 2.3 1.3 3.3 4.3 5.3 6.3
CNPJ8-port-country - 1.4 3.4 4.4 - 6.4
CNPJ8-port - 1.5 3.5 4.5 - 6.5
CNPJ8 - 1.6 3.6 4.6 - 6.6
port-country - 1.7 3.7 4.7 - 6.7
port - 1.8 3.8 4.8 - 6.8
from trase.tools import sps

supplychain = sps.SupplyChain("brazil/soy_2017_qa", year=2017)
supplychain.preparation()
supplychain.load()
data = supplychain.run()
# supplychain.flow_report_by_attribute("vol", ["qa_branch"], 8)
# supplychain.flow_report_by_attribute("vol", ["detailed_qa_branch"], 8)
# supplychain.flow_report_by_attribute("vol", ["agreement"], 8)
# supplychain.flow_report_by_attribute("vol", ["overlap"], 8)
supplychain.export_results()

import numpy as np

np.random.seed(0)
import seaborn as sns

sns.set_theme()
ax = sns.heatmap(data / 1000000000, cmap="YlGnBu", annot=True, square=True, cbar=False)
ax.invert_yaxis()
ax.set_xlabel("overlap (data)", fontsize=20)
ax.set_ylabel("agreement (models)", fontsize=20)
ax.set_title("volume (Mtons)", fontsize=20)
overlap (data) | agreement (models) | 8: same CNPJ/port/country | 4: possibly better hub 7: same CNPJ/port | 3: same hub 6: same CNPJ | 2: different hub in same state 5: same CNPJ8/port/country | 1: hub in different state or unknown 4: same CNPJ8/port | 0: unknown (new or old) 3: same CNPJ8 | 2: same port/country | 1: same port | 0: no overlap |