Main

View or edit on GitHub

This page is synchronized from trase/models/brazil/soy/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).

from trase.tools import sps
from quality_assurance import quality_assurance

for year in [
    2019,
    2020,
    2021,
    2022,
]:
    try:
        print(f"Running {year}")
        supplychain = sps.SupplyChain("brazil/soy", year=year)
        supplychain.preparation()
        supplychain.load()
        supplychain.run()
        supplychain.flow_report_by_attribute("vol", ["branch"], 8)
        supplychain.flow_report_by_attribute("vol", ["exporter_type"], 8)
        supplychain.export_results()
        quality_assurance(year)
        supplychain.upload_results()
    except Exception as e:
        print(f"Failed {year}: {e}")