@@ -691,9 +691,9 @@ def available_timeseries(self):
691691 MAP_EPA_MVS .get (sub_cat , sub_cat )
692692 )
693693 if storage_subasset is not None :
694- storage_subasset [
695- " category"
696- ] = format_storage_subasset_name ( category , sub_cat )
694+ storage_subasset ["category" ] = (
695+ format_storage_subasset_name ( category , sub_cat )
696+ )
697697 storage_subasset ["type_oemof" ] = asset ["type_oemof" ]
698698 storage_subasset ["energy_vector" ] = asset [
699699 "energy_vector"
@@ -755,10 +755,10 @@ def single_asset_results(self, asset_name, asset_category=None):
755755 if storage_subasset is not None :
756756 if answer is None :
757757 answer = storage_subasset
758- answer [
759- "category"
760- ] = format_storage_subasset_name (
761- category , sub_cat
758+ answer ["category" ] = (
759+ format_storage_subasset_name (
760+ category , sub_cat
761+ )
762762 )
763763 answer ["energy_vector" ] = asset ["energy_vector" ]
764764 break
@@ -1045,15 +1045,19 @@ def graph_capacities(simulations, y_variables):
10451045
10461046 installed_capacity_dict = {
10471047 "capacity" : [],
1048- "name" : _ ("Installed Capacity" )
1049- if multi_scenario is False
1050- else _ ("Inst. Cap." ) + f"{ simulation .scenario .name } " ,
1048+ "name" : (
1049+ _ ("Installed Capacity" )
1050+ if multi_scenario is False
1051+ else _ ("Inst. Cap." ) + f"{ simulation .scenario .name } "
1052+ ),
10511053 }
10521054 optimized_capacity_dict = {
10531055 "capacity" : [],
1054- "name" : _ ("Optimized Capacity" )
1055- if multi_scenario is False
1056- else _ ("Opt. Cap." ) + f"{ simulation .scenario .name } " ,
1056+ "name" : (
1057+ _ ("Optimized Capacity" )
1058+ if multi_scenario is False
1059+ else _ ("Opt. Cap." ) + f"{ simulation .scenario .name } "
1060+ ),
10571061 }
10581062
10591063 # read information about the installed capacity
@@ -1304,16 +1308,20 @@ def graph_costs(
13041308 y = df .iloc [:, i ].values .tolist ()
13051309 y_values .append (
13061310 {
1307- "base" : df .iloc [:, :i ].sum (axis = 1 ).values .tolist ()
1308- if i > 0
1309- else None ,
1311+ "base" : (
1312+ df .iloc [:, :i ].sum (axis = 1 ).values .tolist ()
1313+ if i > 0
1314+ else None
1315+ ),
13101316 "value" : y ,
13111317 "text" : [name for j in range (len (x_values ))],
1312- "name" : name
1313- if multi_scenario is False
1314- else name + f" { simulation .scenario .name } " ,
1318+ "name" : (
1319+ name
1320+ if multi_scenario is False
1321+ else name + f" { simulation .scenario .name } "
1322+ ),
13151323 "hover" : "<b>%{text}, </b><br><br>Block value: %{customdata:.2f}$<br>Stacked value: %{y:.2f}$<extra> %{x}</extra>" ,
1316- "customdata" : y
1324+ "customdata" : y ,
13171325 # https://stackoverflow.com/questions/59057881/python-plotly-how-to-customize-hover-template-on-with-what-information-to-show
13181326 }
13191327 )
@@ -1326,14 +1334,18 @@ def graph_costs(
13261334 y = df .iloc [i , :].values .tolist ()
13271335 y_values .append (
13281336 {
1329- "base" : df .iloc [:i , :].sum (axis = 0 ).values .tolist ()
1330- if i > 0
1331- else None ,
1337+ "base" : (
1338+ df .iloc [:i , :].sum (axis = 0 ).values .tolist ()
1339+ if i > 0
1340+ else None
1341+ ),
13321342 "value" : y ,
13331343 "text" : [name for j in range (len (x_values ))],
1334- "name" : name
1335- if multi_scenario is False
1336- else name + f" { simulation .scenario .name } " ,
1344+ "name" : (
1345+ name
1346+ if multi_scenario is False
1347+ else name + f" { simulation .scenario .name } "
1348+ ),
13371349 "hover" : "<b>%{text}</b><br><br>Block value: %{customdata:.2f}$<br>Stacked value: %{y:.2f}$" ,
13381350 "customdata" : y ,
13391351 }
@@ -1495,6 +1507,7 @@ def graph_sankey(simulation, energy_vector, timestep=None):
14951507 GRAPH_SANKEY : graph_sankey ,
14961508}
14971509
1510+
14981511# # TODO change the form from this model to adapt the choices depending on single scenario/compare scenario or sensitivity
14991512class ReportItem (models .Model ):
15001513 title = models .CharField (max_length = 120 , default = "" , blank = True )
0 commit comments