@@ -349,7 +349,7 @@ def make_plots(df: pyam.IamDataFrame, model: str, scenario: str, regions: List[s
349
349
if se :
350
350
locator = mdates .AutoDateLocator (minticks = 10 )
351
351
# locator.intervald['YEARLY'] = [10]
352
- pe .plot .bar (ax = ax , stacked = True , title = "Power generation mix %s" % region )
352
+ se .plot .bar (ax = ax , stacked = True , title = "Power generation mix %s" % region )
353
353
plt .legend (bbox_to_anchor = (0.0 , - 0.5 ), loc = "upper left" )
354
354
plt .tight_layout ()
355
355
ax .xaxis .set_major_locator (locator )
@@ -408,15 +408,26 @@ def main(config: Dict, inputs_path: str, results_path: str) -> pyam.IamDataFrame
408
408
Path to a folder of CSV files (OSeMOSYS results)
409
409
"""
410
410
blob = []
411
+ filename = os .path .join (inputs_path , "YEAR.csv" )
412
+ years = pd .read_csv (filename )
413
+
411
414
try :
412
415
for input in config ["inputs" ]:
413
416
414
417
inputs = read_file (inputs_path , input ["osemosys_param" ], config ["region" ])
415
418
416
419
unit = input ["unit" ]
417
420
418
- technologies = input ["variable_cost" ]
419
- data = filter_capacity (inputs , technologies )
421
+ if "variable_cost" in input .keys ():
422
+ technologies = input ["variable_cost" ]
423
+ data = filter_capacity (inputs , technologies )
424
+ elif "reg_tech_param" in input .keys ():
425
+ technologies = input ["reg_tech_param" ]
426
+ data = filter_technologies (inputs , technologies )
427
+ list_years = years ["VALUE" ]
428
+ data ["YEAR" ] = [list_years ] * len (data )
429
+ data = data .explode ("YEAR" ).reset_index (drop = True )
430
+ data = data .drop (["TECHNOLOGY" ], axis = 1 )
420
431
421
432
if not data .empty :
422
433
data = data .rename (
@@ -522,6 +533,7 @@ def main(config: Dict, inputs_path: str, results_path: str) -> pyam.IamDataFrame
522
533
all_data = all_data .convert_unit ("PJ/yr" , to = "EJ/yr" )
523
534
all_data = all_data .convert_unit ("ktCO2/yr" , to = "Mt CO2/yr" , factor = 0.001 )
524
535
all_data = all_data .convert_unit ("MEUR_2015/PJ" , to = "EUR_2020/GJ" , factor = 1.05 )
536
+ all_data = all_data .convert_unit ("MEUR_2015/GW" , to = "EUR_2020/kW" , factor = 1.05 )
525
537
all_data = all_data .convert_unit ("kt CO2/yr" , to = "Mt CO2/yr" )
526
538
527
539
all_data = pyam .IamDataFrame (all_data )
0 commit comments