pypsa.SubNetwork.graph#
- SubNetwork.graph(branch_components: Collection[str] | None = None, weight: str | None = None, inf_weight: bool | float = False, include_inactive: bool = True) OrderedGraph #
Build NetworkX graph.
- Parameters:
n (Network|SubNetwork)
branch_components ([str]) – Components to use as branches. The default are passive_branch_components in the case of a SubNetwork and branch_components in the case of a Network.
weight (str) – Branch attribute to use as weight
inf_weight (bool|float) – How to treat infinite weights (default: False). True keeps the infinite weight. False skips edges with infinite weight. If a float is given it is used instead.
- Returns:
graph – NetworkX graph
- Return type:
OrderedGraph