Skip to content

DBT: Hubs Crushing Capacities

File location: s3://trase-storage/brazil/soy/sei_pcs/supply_sheds/hubs_crushing_capacities.csv

DBT model name: hubs_crushing_capacities

Explore on Metabase: Full table; summary statistics

Explore dependencies/lineage: link

Relies on script: trase/models/brazil/soy_supply_sheds


Description

This model was auto-generated based off .yml 'lineage' files in S3. The DBT model just raises an error; the actual script that created the data lives elsewhere. The script is located at trase/models/brazil/soy_supply_sheds [permalink] (uploaded from main.ipynb, df_compare_hubs_crushing_demand).

Comparison of each aggregator/hub's allocated silo volume against ABIOVE crushing capacity, from the second-stage LP solve in model.py.


Details

Column Type Description
hub_trase_id VARCHAR
original_demand VARCHAR
final_demand VARCHAR
solution_vol VARCHAR
crushing_demand VARCHAR
hub_demand VARCHAR
solution_demand_ratio VARCHAR

No data tests defined 🧐

Not referenced by any model or exposure.

import pandas as pd


def model(dbt, cursor):
    dbt.ref("seipcs_brazil_soy_partial_branches_v27")  # Branches
    dbt.source("trase-storage-raw", "gadm41_bra_1")  # BrazilBoundaries
    dbt.source(
        "brazil_spatial_boundaries_ibge", "br_municipalities_wgs84_2023"
    )  # MunicipalityBoundaries
    dbt.source("trase-storage-raw", "municipality")  # MunicipalityNames
    dbt.ref("silos_consolidated_capacity_brazil_2024_1")  # SilosCapacities
    dbt.ref("soy_production_ibge_2003_2023_multilevel")  # Production
    dbt.ref("crushing_facilities_2003_2024")  # CrushingDemand
    dbt.ref("br_cost_matrix_osrm_2023_v2")  # Cost
    dbt.source(
        "trase-storage-raw", "antt_train_flows_station_to_station_2023"
    )  # TrainFlows
    dbt.source("trase-storage-raw", "distance_cutoff")  # DistanceCutoff

    raise NotImplementedError()
    return pd.DataFrame({"hello": ["world"]})