Module graph

Source
Expand description

Module for creating and analysing commodity graphs

Enumsยง

GraphEdge ๐Ÿ”’
An edge in the commodity graph
GraphNode ๐Ÿ”’
A node in the commodity graph

Functionsยง

build_and_validate_commodity_graphs_for_model
Builds and validates commodity graphs for the entire model.
create_commodities_graph_for_region_year ๐Ÿ”’
Creates a directed graph of commodity flows for a given region and year.
prepare_commodities_graph_for_validation ๐Ÿ”’
Prepares a graph for validation with validate_commodities_graph.
topo_sort_commodities ๐Ÿ”’
Performs topological sort on the commodity graph to get the ordering for investments
validate_commodities_graph ๐Ÿ”’
Validates that the commodity graph follows the rules for different commodity types.

Type Aliasesยง

CommoditiesGraph ๐Ÿ”’
A graph of commodity flows for a given region and year