Prepare existing capacities
Functions to prepare existing assets for the network
SHORT TERM FIX until PowerPlantMatching is implemented - required as split from add_existing_baseyear for remind compat
assign_year_bins(df, year_bins)
Assign a year bin to the existing capacities according to the config
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df
|
DataFrame
|
DataFrame with existing capacities and build years (DateIn) |
required |
year_bins
|
list
|
years to bin the existing capacities to |
required |
Returns: pd.DataFrame: DataFrame regridded to the year bins
Source code in workflow/scripts/prepare_existing_capacities.py
convert_CHP_to_poweronly(capacities)
Convert CHP capacities to power-only capacities by removing the heat part
Parameters:
Name | Type | Description | Default |
---|---|---|---|
capacities
|
DataFrame
|
DataFrame with existing capacities |
required |
Returns: pd.DataFrame: DataFrame with converted capacities
Source code in workflow/scripts/prepare_existing_capacities.py
determine_simulation_timespan(config, year)
Determine the simulation timespan in years (so the network object is not needed)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config
|
dict
|
the snakemake config |
required |
year
|
int
|
the year to simulate |
required |
Returns: int: the simulation timespan in years
Source code in workflow/scripts/prepare_existing_capacities.py
fix_existing_capacities(existing_df, costs, year_bins, baseyear)
add/fill missing dateIn, discretize lifetime to grouping year, rename columns drop plants that were retired before the smallest sim timeframe
Parameters:
Name | Type | Description | Default |
---|---|---|---|
existing_df
|
DataFrame
|
the existing capacities |
required |
costs
|
DataFrame
|
the technoeconomic data |
required |
year_bins
|
list
|
the year groups |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: fixed capacities |
Source code in workflow/scripts/prepare_existing_capacities.py
read_existing_capacities(paths_dict, techs)
Read existing capacities from csv files and format them Args: paths_dict (dict[str, os.PathLike]): dictionary with paths to the csv files techs (list): list of technologies to read Returns: pd.DataFrame: DataFrame with existing capacities