File tree 1 file changed +8
-3
lines changed
workflow/scripts/osemosys_global
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 17
17
remove_nodes = config .get ('nodes_to_remove' )
18
18
19
19
res_targets = config .get ('re_targets' )
20
- res_targets = list (res_targets .keys ())
20
+ if res_targets is not None :
21
+ res_targets = list (res_targets .keys ())
21
22
22
23
output_data_dir = config_paths .output_data_dir
23
24
scenario_dir = config_paths .scenario_dir
69
70
if 'FUEL' in df .columns :
70
71
df = df .loc [df ['FUEL' ].str [3 :6 ].isin (geographic_scope ) |
71
72
df ['FUEL' ].str [6 :9 ].isin (geographic_scope ) |
72
- df ['FUEL' ].isin (res_targets ) |
73
73
df ['FUEL' ].isin (international_fuels )]
74
74
75
+ if res_targets is not None :
76
+ df = df .loc [df ['FUEL' ].isin (res_targets )]
77
+
75
78
if remove_nodes :
76
79
df = df .loc [~ (df ['FUEL' ].str [3 :8 ].isin (remove_nodes ) |
77
80
df ['FUEL' ].str [6 :11 ].isin (remove_nodes ))]
78
81
79
82
if str (each_csv ).split ('/' )[- 1 ] == 'FUEL.csv' :
80
83
df = df .loc [df ['VALUE' ].str [3 :6 ].isin (geographic_scope ) |
81
84
df ['VALUE' ].str [6 :9 ].isin (geographic_scope ) |
82
- df ['VALUE' ].isin (res_targets ) |
83
85
df ['VALUE' ].isin (international_fuels )]
84
86
87
+ if res_targets is not None :
88
+ df = df .loc [df ['VALUE' ].isin (res_targets )]
89
+
85
90
if remove_nodes :
86
91
df = df .loc [~ (df ['VALUE' ].str [3 :8 ].isin (remove_nodes ) |
87
92
df ['VALUE' ].str [6 :11 ].isin (remove_nodes ))]
You can’t perform that action at this time.
0 commit comments