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
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | |
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
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | |
determine_simulation_timespan(config, year)
Determine the simulation timespan in years (so the network object is not needed) Args: config (dict): the snakemake config year (int): the year to simulate Returns: int: the simulation timespan in years
Source code in workflow/scripts/prepare_existing_capacities.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
distribute_vre_by_grade(cap_by_year, grade_capacities)
distribute vre capacities by grade potential, use up better grades first
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cap_by_year
|
Series
|
the vre tech potential p_nom_max added per year |
required |
grade_capacities
|
Series
|
the vre grade potential for the tech and bus |
required |
Returns: pd.DataFrame: DataFrame with the distributed vre capacities (shape: years x buses)
Source code in workflow/scripts/prepare_existing_capacities.py
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | |
fix_existing_capacities(existing_df, costs, year_bins, baseyear)
add/fill missing dateIn, drop expired assets, drop too new assets
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 |
baseyear
|
int
|
the base year (run year) |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: fixed capacities |
Source code in workflow/scripts/prepare_existing_capacities.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
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
Source code in workflow/scripts/prepare_existing_capacities.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |