Make summary
Create summary CSV files for all scenario runs including costs, capacities, capacity factors, curtailment, energy balances, prices and other metrics.
assign_carriers(n)
Assign AC where missing Args: n (pypsa.Network): the network object to fix
calculate_capacities(n, label, capacities, adjust_link_capacities=None)
Calculate the optimal capacities by carrier and bus carrier
For links that connect to AC buses (bus1=AC), the capacity can be multiplied by efficiency to report the actual capacity available at the AC side rather than the input side. This ensures consistent capacity reporting across the network.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
Network
|
the network object |
required |
label
|
str
|
the label used by make summaries |
required |
capacities
|
DataFrame
|
the dataframe to fill/update |
required |
adjust_link_capacities
|
bool
|
Whether to adjust link capacities by efficiency. If None, reads from config. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: updated capacities |
Source code in workflow/scripts/make_summary.py
calculate_cfs(n, label, cfs)
Calculate the capacity factors by carrier
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
Network
|
the network object |
required |
label
|
str
|
the label used by make summaries |
required |
cfs
|
DataFrame
|
the dataframe to fill/update |
required |
Returns: pd.DataFrame: updated cfs
Source code in workflow/scripts/make_summary.py
calculate_co2_balance(n, label, co2_balance, withdrawal_stores=['CO2 capture'])
Calc the co2 balance [DOES NOT INCLUDE EMISSION GENERATING LINKSs]
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
Network
|
the network object |
required |
withdrawal_stores
|
list
|
names of stores. Defaults to ["CO2 capture"]. |
['CO2 capture']
|
label
|
str
|
the label for the column |
required |
co2_balance
|
DataFrame
|
the df to update |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: updated co2_balance (bad style) |
Source code in workflow/scripts/make_summary.py
calculate_costs(n, label, costs)
Calculate the costs by carrier Args: n (pypsa.Network): the network object label (str): the label used by make summaries costs (pd.DataFrame): the dataframe to fill/update Returns: pd.DataFrame: updated costs
Source code in workflow/scripts/make_summary.py
calculate_curtailment(n, label, curtailment)
Calculate curtailed energy by carrier
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
Network
|
the network object |
required |
label
|
str
|
the label used by make summaries |
required |
curtailment
|
DataFrame
|
the dataframe to fill/update |
required |
Returns: pd.DataFrame: updated curtailment
Source code in workflow/scripts/make_summary.py
calculate_expanded_capacities(n, label, capacities)
Calculate the capacities by carrier
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
Network
|
the network object |
required |
label
|
str
|
the label used by make summaries |
required |
capacities
|
DataFrame
|
the dataframe to fill |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
pd.Dataframe: updated capacities (bad style) |
Source code in workflow/scripts/make_summary.py
calculate_market_values(n, label, market_values)
Calculate the market value of the generators and links Args: n (pypsa.Network): the network object label (str): the label representing the pathway market_values (pd.DataFrame): the dataframe to write to (not needed, refactor)
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: updated market_values |
Source code in workflow/scripts/make_summary.py
calculate_metrics(n, label, metrics)
LEGACY calculate a set of metrics for lines and co2 Args: n (pypsa.Network): the network object label (str): the label to update the table row with metrics (pd.DataFrame): the dataframe to write to (not needed, refactor)
Returns:
Type | Description |
---|---|
pd.DataFrame: updated metrics |
Source code in workflow/scripts/make_summary.py
calculate_nodal_capacities(n, label, nodal_capacities)
Calculate the capacities by carrier and node
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
Network
|
the network object |
required |
label
|
str
|
the label used by make summaries |
required |
nodal_capacities
|
DataFrame
|
the dataframe to fill/update |
required |
Returns: pd.DataFrame: updated nodal_capacities
Source code in workflow/scripts/make_summary.py
calculate_nodal_cfs(n, label, nodal_cfs)
Calculate the capacity factors by for each node and genertor Args: n (pypsa.Network): the network object label (str): the label used by make summaries nodal_cfs (pd.DataFrame): the cap fac dataframe to fill/update Returns: pd.DataFrame: updated nodal_cfs
Source code in workflow/scripts/make_summary.py
calculate_nodal_costs(n, label, nodal_costs)
Calculate the costs by carrier and location Args: n (pypsa.Network): the network object label (str): the label used by make summaries nodal_costs (pd.DataFrame): the dataframe to fill/update Returns: pd.DataFrame: updated nodal_costs
Source code in workflow/scripts/make_summary.py
calculate_nodal_lcoe(n, label, nodal_lcoe)
Calculate LCOE by province and technology
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
Network
|
the network object |
required |
label
|
str
|
the label used by make summaries |
required |
nodal_lcoe
|
DataFrame
|
the dataframe to fill/update |
required |
Returns: pd.DataFrame: updated nodal_lcoe
Source code in workflow/scripts/make_summary.py
calculate_peak_dispatch(n, label, supply)
Calculate the MAX dispatch of each component at the buses aggregated by carrier.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
Network
|
the network object |
required |
label
|
str
|
the labe representing the pathway |
required |
supply
|
DataFrame
|
supply energy balance (empty df) |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: updated supply DF |
Source code in workflow/scripts/make_summary.py
calculate_supply_energy(n, label, supply_energy)
Calculate the total energy supply/consuption of each component at the buses aggregated by carrier.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
Network
|
the network object |
required |
label
|
str
|
the labe representing the pathway |
required |
supply_energy
|
DataFrame
|
supply energy balance (empty df) |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: updated supply energy balance |
Source code in workflow/scripts/make_summary.py
calculate_t_avgd_prices(n, label, prices)
Time averaged prices for nodes averaged over carrier (bit silly?)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
Network
|
the network object |
required |
label
|
str
|
the label representing the pathway (not needed, refactor) |
required |
prices
|
DataFrame
|
the dataframe to write to (not needed, refactor) |
required |
Returns:
Type | Description |
---|---|
pd.DataFrame: updated prices |
Source code in workflow/scripts/make_summary.py
calculate_weighted_prices(n, label, weighted_prices)
Demand-weighed prices for stores and loads. For stores if withdrawal is zero, use supply instead.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
Network
|
the network object |
required |
label
|
str
|
the label representing the pathway (not needed, refactor) |
required |
weighted_prices
|
DataFrame
|
the dataframe to write to (not needed, refactor) |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: updated weighted_prices |
Source code in workflow/scripts/make_summary.py
expand_from_wildcard(key, config)
Return a list of values for the given key in the config file Args: key (str): the key to look for in the config file config (dict): the config file Returns: list: a list of values for the given key
Source code in workflow/scripts/make_summary.py
make_summaries(networks_dict, opts=None)
Make summary tables for the given network Args: networks_dict (dict): a dictionary of (pathway, time):network_path used in the run opts (dict): options for each summary function Returns: dict: a dictionary of dataframes with the summary tables