From a85e95bd32bbfbed1d62b832815ad99d1ec4e01d Mon Sep 17 00:00:00 2001 From: trevorb1 Date: Sun, 6 Oct 2024 20:13:45 -0700 Subject: [PATCH] fix udc powerplant fuels --- .../powerplant/user_defined_capacity.py | 29 +++++++------------ workflow/snakefile | 2 +- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/workflow/scripts/osemosys_global/powerplant/user_defined_capacity.py b/workflow/scripts/osemosys_global/powerplant/user_defined_capacity.py index 27b3b50..ca5f133 100644 --- a/workflow/scripts/osemosys_global/powerplant/user_defined_capacity.py +++ b/workflow/scripts/osemosys_global/powerplant/user_defined_capacity.py @@ -137,25 +137,16 @@ def set_user_defined_capacity(tech_capacity, op_life_dict, df_tech_set, 'MODE_OF_OPERATION', 'YEAR'] ) - # IAR in modes 1 and 2 are primary electricity commodity ('ELC*01') in - # node_from and node_to, respectively. - # OAR is the inverse of the above - df_iar_custom.loc[df_iar_custom['MODE_OF_OPERATION']==1, - 'FUEL'] = ('ELC' + - df_iar_custom['TECHNOLOGY'].str[3:8] + - '01') - df_iar_custom.loc[df_iar_custom['MODE_OF_OPERATION']==2, - 'FUEL'] = ('ELC' + - df_iar_custom['TECHNOLOGY'].str[8:13] + - '01') - df_oar_custom.loc[df_iar_custom['MODE_OF_OPERATION']==1, - 'FUEL'] = ('ELC' + - df_oar_custom['TECHNOLOGY'].str[8:13] + - '01') - df_oar_custom.loc[df_iar_custom['MODE_OF_OPERATION']==2, - 'FUEL'] = ('ELC' + - df_oar_custom['TECHNOLOGY'].str[3:8] + - '01') + + df_iar_custom.loc[df_iar_custom['MODE_OF_OPERATION']==1,'FUEL'] = ( + df_iar_custom['TECHNOLOGY'].str[3:9]) + df_iar_custom.loc[df_iar_custom['MODE_OF_OPERATION']==2,'FUEL'] = ( + df_iar_custom['TECHNOLOGY'].str[3:6] + "INT") + df_oar_custom.loc[df_oar_custom['MODE_OF_OPERATION']==1,'FUEL'] = ( + 'ELC' + df_oar_custom['TECHNOLOGY'].str[6:11] + '01') + df_oar_custom.loc[df_oar_custom['MODE_OF_OPERATION']==2,'FUEL'] = ( + 'ELC' + df_oar_custom['TECHNOLOGY'].str[6:11] + '01') + df_iar_custom['VALUE'] = DF_IAR_CUSTOM_VAL df_oar_custom['VALUE'] = DF_OAR_CUSTOM_VAL df_iar_custom['REGION'] = region_name diff --git a/workflow/snakefile b/workflow/snakefile index aed6d03..ab2c20b 100644 --- a/workflow/snakefile +++ b/workflow/snakefile @@ -85,7 +85,7 @@ rule generate_input_data: message: "Generating input CSV data..." input: - csv_files = expand('results/{scenario}/data/{csv}', scenario=config['scenario'], csv=OTOOLE_PARAMS), + csv_files = expand('results/{scenario}/data/{csv}.csv', scenario=config['scenario'], csv=OTOOLE_PARAMS), rule make_dag: message: