@@ -29,7 +29,10 @@ power_plant_files = [
29
29
'powerplant/ResidualCapacity' ,
30
30
'powerplant/TECHNOLOGY' ,
31
31
'YEAR' ,
32
- 'AvailabilityFactor'
32
+ 'AvailabilityFactor' ,
33
+ 'TotalAnnualMaxCapacity' ,
34
+ 'AccumulatedAnnualDemand' ,
35
+ 'TotalAnnualMinCapacity'
33
36
]
34
37
35
38
transmission_files = [
@@ -100,11 +103,6 @@ emission_files = [
100
103
'AnnualEmissionLimit'
101
104
]
102
105
103
- max_capacity_files = [
104
- 'TotalAnnualMaxCapacity' ,
105
- 'AccumulatedAnnualDemand' ,
106
- ]
107
-
108
106
user_capacity_files = [
109
107
'TotalAnnualMinCapacityInvestment' ,
110
108
'TotalAnnualMaxCapacityInvestment'
@@ -116,7 +114,8 @@ fuel_limit_files = [
116
114
117
115
GENERATED_CSVS = (
118
116
power_plant_files + transmission_files + storage_files + timeslice_files \
119
- + reserves_files + demand_files + emission_files + max_capacity_files + fuel_limit_files
117
+ + reserves_files + demand_files + emission_files + fuel_limit_files
118
+
120
119
)
121
120
GENERATED_CSVS = [Path (x ).stem for x in GENERATED_CSVS ]
122
121
EMPTY_CSVS = [x for x in OTOOLE_PARAMS if x not in GENERATED_CSVS ]
@@ -127,37 +126,78 @@ rule make_data_dir:
127
126
output : directory ('results/data' )
128
127
shell : 'mkdir -p {output}'
129
128
129
+ def demand_custom_csv () -> str :
130
+ if config ["nodes_to_add" ]:
131
+ return "resources/data/custom_nodes/specified_annual_demand.csv"
132
+ else :
133
+ return []
134
+
135
+ rule demand_projections :
136
+ message :
137
+ "Generating demand data..."
138
+ input :
139
+ plexos = "resources/data/PLEXOS_World_2015_Gold_V1.1.xlsx" ,
140
+ plexos_demand = "resources/data/All_Demand_UTC_2015.csv" ,
141
+ iamc_gdp = "resources/data/iamc_db_GDPppp_Countries.xlsx" ,
142
+ iamc_pop = "resources/data/iamc_db_POP_Countries.xlsx" ,
143
+ iamc_urb = "resources/data/iamc_db_URB_Countries.xlsx" ,
144
+ iamc_missing = "resources/data/iamc_db_POP_GDPppp_URB_Countries_Missing.xlsx" ,
145
+ td_losses = "resources/data/T&D Losses.xlsx" ,
146
+ ember = "resources/data/ember_yearly_electricity_data.csv" ,
147
+ custom_nodes = demand_custom_csv ()
148
+ params :
149
+ start_year = config ['startYear' ],
150
+ end_year = config ['endYear' ],
151
+ custom_nodes = config ["nodes_to_add" ]
152
+ output :
153
+ csv_files = 'results/data/SpecifiedAnnualDemand.csv' ,
154
+ log :
155
+ log = 'results/logs/demand_projections.log'
156
+ script :
157
+ "../scripts/osemosys_global/demand/main.py"
130
158
131
159
def powerplant_cap_custom_csv () -> str :
132
160
if config ["nodes_to_add" ]:
133
161
return "resources/data/custom_nodes/residual_capacity.csv"
134
162
else :
135
- return []
163
+ return []
164
+
165
+ def powerplant_res_potentials_custom_csv () -> str :
166
+ if config ["nodes_to_add" ]:
167
+ return "resources/data/custom_nodes/RE_potentials.csv"
168
+ else :
169
+ return []
136
170
137
171
rule powerplant :
138
172
message :
139
173
"Generating powerplant data..."
140
174
input :
175
+ rules .demand_projections .output .csv_files ,
141
176
plexos = 'resources/data/PLEXOS_World_2015_Gold_V1.1.xlsx' ,
177
+ res_limit = 'resources/data/PLEXOS_World_MESSAGEix_GLOBIOM_Softlink.xlsx' ,
178
+ fuel_limit = 'resources/data/fuel_limits.csv' ,
179
+ build_rates = 'resources/data/powerplant_build_rates.csv' ,
142
180
weo_costs = 'resources/data/weo_2020_powerplant_costs.csv' ,
143
181
weo_regions = 'resources/data/weo_region_mapping.csv' ,
144
182
default_op_life = 'resources/data/operational_life.csv' ,
145
183
naming_convention_tech = 'resources/data/naming_convention_tech.csv' ,
146
184
default_av_factors = 'resources/data/availability_factors.csv' ,
147
185
custom_res_cap = powerplant_cap_custom_csv (),
148
- cmo_forecasts = 'resources/data/CMO-October-2024-Forecasts.xlsx' ,
149
- fuel_prices = 'resources/data/fuel_prices.csv' ,
186
+ custom_res_potentials = powerplant_res_potentials_custom_csv (),
150
187
params :
151
188
start_year = config ['startYear' ],
152
189
end_year = config ['endYear' ],
153
190
region_name = 'GLOBAL' ,
191
+ geographic_scope = config ['geographic_scope' ],
154
192
custom_nodes = config ['nodes_to_add' ],
193
+ remove_nodes = config ['nodes_to_remove' ],
155
194
user_defined_capacity = config ['user_defined_capacity' ],
156
195
no_investment_techs = config ['no_invest_technologies' ],
196
+ res_targets = config ['re_targets' ],
197
+ calibration = config ['calibration' ],
157
198
output_data_dir = 'results/data' ,
158
199
input_data_dir = 'resources/data' ,
159
200
powerplant_data_dir = 'results/data/powerplant' ,
160
-
161
201
output :
162
202
csv_files = expand ('results/data/{output_file}.csv' , output_file = power_plant_files )
163
203
log :
@@ -298,36 +338,6 @@ rule reserves:
298
338
script :
299
339
"../scripts/osemosys_global/reserves/main.py"
300
340
301
- def demand_custom_csv () - > str :
302
- if config ["nodes_to_add" ]:
303
- return "resources/data/custom_nodes/specified_annual_demand.csv"
304
- else :
305
- return []
306
-
307
- rule demand_projections :
308
- message :
309
- "Generating demand data..."
310
- input :
311
- plexos = "resources/data/PLEXOS_World_2015_Gold_V1.1.xlsx" ,
312
- plexos_demand = "resources/data/All_Demand_UTC_2015.csv" ,
313
- iamc_gdp = "resources/data/iamc_db_GDPppp_Countries.xlsx" ,
314
- iamc_pop = "resources/data/iamc_db_POP_Countries.xlsx" ,
315
- iamc_urb = "resources/data/iamc_db_URB_Countries.xlsx" ,
316
- iamc_missing = "resources/data/iamc_db_POP_GDPppp_URB_Countries_Missing.xlsx" ,
317
- td_losses = "resources/data/T&D Losses.xlsx" ,
318
- ember = "resources/data/ember_yearly_electricity_data.csv" ,
319
- custom_nodes = demand_custom_csv ()
320
- params :
321
- start_year = config ['startYear' ],
322
- end_year = config ['endYear' ],
323
- custom_nodes = config ["nodes_to_add" ]
324
- output :
325
- csv_files = 'results/data/SpecifiedAnnualDemand.csv' ,
326
- log :
327
- log = 'results/logs/demand_projections.log'
328
- script :
329
- "../scripts/osemosys_global/demand/main.py"
330
-
331
341
rule demand_projection_figures :
332
342
message :
333
343
"Generating demand figures..."
@@ -350,36 +360,24 @@ rule emissions:
350
360
message :
351
361
'Generating emission data...'
352
362
input :
353
- 'resources/data/emission_factors.csv' ,
354
- 'results/data/InputActivityRatio.csv' ,
363
+ ember = 'resources/data/ember_yearly_electricity_data.csv' ,
364
+ emissions_factors = 'resources/data/emission_factors.csv' ,
365
+ iar = 'results/data/InputActivityRatio.csv' ,
366
+ oar = 'results/data/OutputActivityRatio.csv' ,
355
367
params :
356
368
start_year = config ['startYear' ],
357
369
end_year = config ['endYear' ],
358
- emission = config ['emission_penalty' ],
359
- storage_parameters = config ['storage_parameters' ]
370
+ region_name = 'GLOBAL' ,
371
+ output_data_dir = 'results/data' ,
372
+ input_data_dir = 'resources/data' ,
373
+ emission_penalty = config ['emission_penalty' ],
374
+ emission_limit = config ['emission_limit' ],
360
375
output :
361
376
csv_files = expand ('results/data/{output_file}.csv' , output_file = emission_files ),
362
377
log :
363
378
log = 'results/logs/emissions.log'
364
- shell :
365
- 'python workflow/scripts/osemosys_global/emissions.py 2> {log}'
366
-
367
- rule max_capacity :
368
- message :
369
- 'Generating capacity limits...'
370
- input :
371
- 'resources/data/PLEXOS_World_MESSAGEix_GLOBIOM_Softlink.xlsx' ,
372
- 'results/data/ResidualCapacity.csv' ,
373
- 'results/data/SpecifiedAnnualDemand.csv'
374
- params :
375
- start_year = config ['startYear' ],
376
- end_year = config ['endYear' ],
377
- output :
378
- csv_files = expand ('results/data/{output_file}.csv' , output_file = max_capacity_files ),
379
- log :
380
- log = 'results/logs/max_capacity.log'
381
- shell :
382
- 'python workflow/scripts/osemosys_global/max_capacity.py 2> {log}'
379
+ script :
380
+ "../scripts/osemosys_global/emissions/main.py"
383
381
384
382
rule create_missing_csv :
385
383
message :
0 commit comments