File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1244,6 +1244,28 @@ def format_superstructure_dataframe(self) -> None:
1244
1244
+ [s ["name" ] for s in self .scenarios ]
1245
1245
]
1246
1246
1247
+ # ensure that no production flows have zero values
1248
+ # in any of the scenario columns
1249
+ # replace zeroes with ones
1250
+
1251
+ print (self .scenario_df .loc [
1252
+ self .scenario_df ["flow type" ] == "production" ,
1253
+ [s ["name" ] for s in self .scenarios ],
1254
+ ].sum ())
1255
+
1256
+ self .scenario_df .loc [
1257
+ self .scenario_df ["flow type" ] == "production" ,
1258
+ [s ["name" ] for s in self .scenarios ],
1259
+ ] = self .scenario_df .loc [
1260
+ self .scenario_df ["flow type" ] == "production" ,
1261
+ [s ["name" ] for s in self .scenarios ],
1262
+ ].replace (0 , 1 , regex = True )
1263
+
1264
+ print (self .scenario_df .loc [
1265
+ self .scenario_df ["flow type" ] == "production" ,
1266
+ [s ["name" ] for s in self .scenarios ],
1267
+ ].sum ())
1268
+
1247
1269
def unfold (
1248
1270
self ,
1249
1271
scenarios : List [int ] = None ,
You can’t perform that action at this time.
0 commit comments