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_commodity_graphs_for_model
Builds base commodity graphs for each region and year
create_commodities_graph_for_region_year ๐Ÿ”’
Creates a directed graph of commodity flows for a given region and year.
get_edge_attributes ๐Ÿ”’
Gets custom DOT attributes for edges in a commodity graph
prepare_commodities_graph_for_validation ๐Ÿ”’
Prepares a graph for validation with validate_commodities_graph.
save_commodity_graphs_for_model
Saves commodity graphs to file
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.
validate_commodity_graphs_for_model
Validates commodity graphs for the entire model.

Type Aliasesยง

CommoditiesGraph
A graph of commodity flows for a given region and year