@@ -1834,17 +1834,20 @@ def pmClicked(self):
1834
1834
except :
1835
1835
pass
1836
1836
for i in range (self .order .count ()):
1837
- if self .generators [self .order .item (i ).text ()].capacity > 0 :
1838
- gen = self .order .item (i ).text ()
1839
- try :
1840
- if self .generators [gen ].constraint in self .constraints and \
1841
- self .constraints [self .generators [gen ].constraint ].category == 'Generator' :
1842
- typ = 'G'
1843
- else :
1844
- typ = 'S'
1845
- except :
1846
- continue
1847
- datain .append ([gen , typ , self .generators [gen ].capacity ])
1837
+ try :
1838
+ if self .generators [self .order .item (i ).text ()].capacity > 0 :
1839
+ gen = self .order .item (i ).text ()
1840
+ try :
1841
+ if self .generators [gen ].constraint in self .constraints and \
1842
+ self .constraints [self .generators [gen ].constraint ].category == 'Generator' :
1843
+ typ = 'G'
1844
+ else :
1845
+ typ = 'S'
1846
+ except :
1847
+ continue
1848
+ datain .append ([gen , typ , self .generators [gen ].capacity ])
1849
+ except :
1850
+ pass
1848
1851
adjust = Adjustments (self , datain , self .adjustto , self .adjust_cap , self .results_prefix ,
1849
1852
show_multipliers = self .show_multipliers , save_folder = self .scenarios )
1850
1853
adjust .exec_ ()
@@ -2966,9 +2969,10 @@ def format_period(per):
2966
2969
cp = '${:.2f}' .format (self .carbon_price )
2967
2970
sp_data .append (['Carbon Price' , self .carbon_price , '' , '' , '' , cc , cs ])
2968
2971
# sp_data.append(['RE %age', round(re_sum * 100. / gen_sum, 1)])
2969
- sp_data .append (['RE %age' , '{:.1f}%' .format ((tml_sum - sto_sum - ff_sum ) * 100. / tml_sum )])
2970
- if sto_sum > 0 :
2971
- sp_data .append (['Storage %age' , '{:.1f}%' .format (sto_sum * 100. / tml_sum )])
2972
+ if tml_sum > 0 :
2973
+ sp_data .append (['RE %age' , '{:.1f}%' .format ((tml_sum - sto_sum - ff_sum ) * 100. / tml_sum )])
2974
+ if sto_sum > 0 :
2975
+ sp_data .append (['Storage %age' , '{:.1f}%' .format (sto_sum * 100. / tml_sum )])
2972
2976
# sp_data.append(['RE %age of Total Load', round((sp_load - sf_sums[0] - ff_sum) * \
2973
2977
# 100. / sp_load, 1)])
2974
2978
sp_data .append (' ' )
0 commit comments