-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_assump_dlg.py
909 lines (854 loc) · 50.7 KB
/
model_assump_dlg.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
from PyQt6.QtWidgets import *
from PyQt6.QtGui import *
from PyQt6.uic import loadUi
import pathlib
import numpy as np
PROJECT_PATH = pathlib.Path(__file__).parent
ASSUMP_DLG = PROJECT_PATH / "model_assumptions.ui"
DEFAULT_WHITE = u'font: 10pt "Segoe UI";background-color: rgb(255, 255, 255);'
DEFAULT_ERROR = u'font: 10pt "Segoe UI";background-color: rgb(255, 103, 103);'
class model_assump_dlg(QDialog):
def __init__(self, assump_json, color_red=[]):
super(model_assump_dlg, self).__init__()
loadUi(ASSUMP_DLG, self)
self.assump_json = assump_json
# Load the values from the assumption json
#### Wind ####
self.wind_frac_lineEdit.setText(str(assump_json['wind']['system']['fraction_of_average_wind_speed']))
self.wind_turb_diam_lineEdit.setText(str(assump_json['wind']['system']['turbine_diameter']))
self.wind_CapFac_lineEdit.setText(str(assump_json['wind']['system']['capacity_factor']))
self.wind_Nturb_lineEdit.setText(str(assump_json['wind']['system']['N_turbines']))
self.wind_spacing_lineEdit.setText(str(assump_json['wind']['system']['turbine_spacing']))
self.wind_pow_coef_lineEdit.setText(str(assump_json['wind']['system']['power_coefficient']))
self.wind_eff_lineEdit.setText(str(assump_json['wind']['system']['overall_efficiency']))
self.wg_disc_rate_lineEdit.setText(str(assump_json['wind']['gov_rates']['discount_rate']))
self.wg_infl_rate_lineEdit.setText(str(assump_json['wind']['gov_rates']['inflation_rate']))
self.wg_ece_LB_lineEdit.setText(str(assump_json['wind']['gov_rates']['electric_cost_escalation_lb']))
self.wg_ece_UB_lineEdit.setText(str(assump_json['wind']['gov_rates']['electric_cost_escalation_ub']))
self.wg_tax_lineEdit.setText(str(assump_json['wind']['gov_rates']['taxation']))
self.wg_proj_life_lineEdit.setText(str(assump_json['wind']['gov_rates']['project_life']))
self.wt_disc_rate_lineEdit.setText(str(assump_json['wind']['third_party_rates']['discount_rate']))
self.wt_infl_rate_lineEdit.setText(str(assump_json['wind']['third_party_rates']['inflation_rate']))
self.wt_ece_LB_lineEdit.setText(str(assump_json['wind']['third_party_rates']['electric_cost_escalation_lb']))
self.wt_ece_UB_lineEdit.setText(str(assump_json['wind']['third_party_rates']['electric_cost_escalation_ub']))
self.wt_tax_lineEdit.setText(str(assump_json['wind']['third_party_rates']['taxation']))
self.wt_proj_life_lineEdit.setText(str(assump_json['wind']['third_party_rates']['project_life']))
#### Solar ####
self.module_type_comboBox.setCurrentIndex(assump_json['solar']['system']['module_type'])
self.sys_losses_lineEdit.setText(str(assump_json['solar']['system']['system_losses']))
if assump_json['solar']['system']['use_lat_tilt']:
self.tilt_checkBox.setChecked(True)
self.tilt_lineEdit.setText("")
self.tilt_lineEdit.setEnabled(False)
else:
self.tilt_checkBox.setChecked(False)
self.tilt_lineEdit.setText(str(assump_json['solar']['system']['tilt']))
self.tilt_lineEdit.setEnabled(True)
self.azimuth_lineEdit.setText(str(assump_json['solar']['system']['azimuth']))
self.dc_ac_lineEdit.setText(str(assump_json['solar']['system']['dc_to_ac_ratio']))
self.inverter_lineEdit.setText(str(assump_json['solar']['system']['invert_eff']))
self.per_roof_lineEdit.setText(str(assump_json['solar']['system']['precent_roof_avail']))
self.perc_land_used_lineEdit.setText(str(assump_json['solar']['system']['perc_land_used']))
self.sg_disc_rate_lineEdit.setText(str(assump_json['solar']['gov_rates']['discount_rate']))
self.sg_infl_rate_lineEdit.setText(str(assump_json['solar']['gov_rates']['inflation_rate']))
self.sg_ece_LB_lineEdit.setText(str(assump_json['solar']['gov_rates']['electric_cost_escalation_lb']))
self.sg_ece_UB_lineEdit.setText(str(assump_json['solar']['gov_rates']['electric_cost_escalation_ub']))
self.sg_tax_lineEdit.setText(str(assump_json['solar']['gov_rates']['taxation']))
self.sg_proj_life_lineEdit.setText(str(assump_json['solar']['gov_rates']['project_life']))
self.st_disc_rate_lineEdit.setText(str(assump_json['solar']['third_party_rates']['discount_rate']))
self.st_infl_rate_lineEdit.setText(str(assump_json['solar']['third_party_rates']['inflation_rate']))
self.st_ece_LB_lineEdit.setText(str(assump_json['solar']['third_party_rates']['electric_cost_escalation_lb']))
self.st_ece_UB_lineEdit.setText(str(assump_json['solar']['third_party_rates']['electric_cost_escalation_ub']))
self.st_tax_lineEdit.setText(str(assump_json['solar']['third_party_rates']['taxation']))
self.st_proj_life_lineEdit.setText(str(assump_json['solar']['third_party_rates']['project_life']))
#### Concentrating Solar ####
self.opt_eff_lineEdit.setText(str(assump_json['conc_solar']['system']['optical_eff']))
self.elec_eff_lineEdit.setText(str(assump_json['conc_solar']['system']['elec_eff']))
self.therm_stor_lineEdit.setText(str(assump_json['conc_solar']['system']['thermal_storage']))
self.avg_sunhrs_lineEdit.setText(str(assump_json['conc_solar']['system']['avg_sun_hours']))
self.per_agency_land_lineEdit.setText(str(assump_json['conc_solar']['system']['perc_land_used']))
self.cs_cap_fac_lineEdit.setText(str(assump_json['conc_solar']['system']['capacity_factor']))
self.csg_disc_rate_lineEdit.setText(str(assump_json['conc_solar']['gov_rates']['discount_rate']))
self.csg_infl_rate_lineEdit.setText(str(assump_json['conc_solar']['gov_rates']['inflation_rate']))
self.csg_ece_LB_lineEdit.setText(str(assump_json['conc_solar']['gov_rates']['electric_cost_escalation_lb']))
self.csg_ece_UB_lineEdit.setText(str(assump_json['conc_solar']['gov_rates']['electric_cost_escalation_ub']))
self.csg_tax_lineEdit.setText(str(assump_json['conc_solar']['gov_rates']['taxation']))
self.csg_proj_life_lineEdit.setText(str(assump_json['conc_solar']['gov_rates']['project_life']))
self.cst_disc_rate_lineEdit.setText(str(assump_json['conc_solar']['third_party_rates']['discount_rate']))
self.cst_infl_rate_lineEdit.setText(str(assump_json['conc_solar']['third_party_rates']['inflation_rate']))
self.cst_ece_LB_lineEdit.setText(str(assump_json['conc_solar']['third_party_rates']['electric_cost_escalation_lb']))
self.cst_ece_UB_lineEdit.setText(str(assump_json['conc_solar']['third_party_rates']['electric_cost_escalation_ub']))
self.cst_tax_lineEdit.setText(str(assump_json['conc_solar']['third_party_rates']['taxation']))
self.cst_proj_life_lineEdit.setText(str(assump_json['conc_solar']['third_party_rates']['project_life']))
#### Hydrogen ####
self.h_cap_fac_lineEdit.setText(str(assump_json['hydrogen']['system']['capacity_factor']))
self.hrs_oper_lineEdit.setText(str(assump_json['hydrogen']['system']['daily_operation']))
for ind, entry in enumerate([self.fuel_emp_comboBox.itemText(i) for i in range(self.fuel_emp_comboBox.count())]):
if entry == str(assump_json['hydrogen']['system']['fuel_used']):
self.fuel_emp_comboBox.setCurrentIndex(ind)
self.cur_den_lineEdit.setText(str(assump_json['hydrogen']['system']['curr_density']))
self.cell_volt_lineEdit.setText(str(assump_json['hydrogen']['system']['cell_voltage']))
self.cell_act_area_lineEdit.setText(str(assump_json['hydrogen']['system']['cell_active_area']))
self.Nstacks_lineEdit.setText(str(assump_json['hydrogen']['system']['N_stacks']))
# If we ever add the other option we will have to change this
self.prot_exch_comboBox.setCurrentIndex(0)
self.heat_rec_comboBox.setCurrentIndex(0)
self.heat_val_lineEdit.setText(str(assump_json['hydrogen']['system']['heating_value']))
self.stack_replace_lineEdit.setText(str(assump_json['hydrogen']['system']['stack_replacement']))
self.annual_degrade_lineEdit.setText(str(assump_json['hydrogen']['system']['annual_degredation']))
self.hg_disc_rate_lineEdit.setText(str(assump_json['hydrogen']['gov_rates']['discount_rate']))
self.hg_infl_rate_lineEdit.setText(str(assump_json['hydrogen']['gov_rates']['inflation_rate']))
self.hg_ece_LB_lineEdit.setText(str(assump_json['hydrogen']['gov_rates']['electric_cost_escalation_lb']))
self.hg_ece_UB_lineEdit.setText(str(assump_json['hydrogen']['gov_rates']['electric_cost_escalation_ub']))
self.hg_tax_lineEdit.setText(str(assump_json['hydrogen']['gov_rates']['taxation']))
self.hg_proj_life_lineEdit.setText(str(assump_json['hydrogen']['gov_rates']['project_life']))
self.ht_disc_rate_lineEdit.setText(str(assump_json['hydrogen']['third_party_rates']['discount_rate']))
self.ht_infl_rate_lineEdit.setText(str(assump_json['hydrogen']['third_party_rates']['inflation_rate']))
self.ht_ece_LB_lineEdit.setText(str(assump_json['hydrogen']['third_party_rates']['electric_cost_escalation_lb']))
self.ht_ece_UB_lineEdit.setText(str(assump_json['hydrogen']['third_party_rates']['electric_cost_escalation_ub']))
self.ht_tax_lineEdit.setText(str(assump_json['hydrogen']['third_party_rates']['taxation']))
self.ht_proj_life_lineEdit.setText(str(assump_json['hydrogen']['third_party_rates']['project_life']))
#### Geothermal ####
self.well_depth_lineEdit.setText(str(assump_json['geo_therm']['system']['well_depth']))
self.amb_temp_lineEdit.setText(str(assump_json['geo_therm']['system']['ambient_temp']))
self.geo_cap_fac_lineEdit.setText(str(assump_json['geo_therm']['system']['capacity_factor']))
self.num_wells_lineEdit.setText(str(assump_json['geo_therm']['system']['number_of_wells']))
self.pump_eff_lineEdit.setText(str(assump_json['geo_therm']['system']['overall_pump_efficiency']))
self.gg_disc_rate_lineEdit.setText(str(assump_json['geo_therm']['gov_rates']['discount_rate']))
self.gg_infl_rate_lineEdit.setText(str(assump_json['geo_therm']['gov_rates']['inflation_rate']))
self.gg_ece_LB_lineEdit.setText(str(assump_json['geo_therm']['gov_rates']['electric_cost_escalation_lb']))
self.gg_ece_UB_lineEdit.setText(str(assump_json['geo_therm']['gov_rates']['electric_cost_escalation_ub']))
self.gg_tax_lineEdit.setText(str(assump_json['geo_therm']['gov_rates']['taxation']))
self.gg_proj_life_lineEdit.setText(str(assump_json['geo_therm']['gov_rates']['project_life']))
self.gt_disc_rate_lineEdit.setText(str(assump_json['geo_therm']['third_party_rates']['discount_rate']))
self.gt_infl_rate_lineEdit.setText(str(assump_json['geo_therm']['third_party_rates']['inflation_rate']))
self.gt_ece_LB_lineEdit.setText(str(assump_json['geo_therm']['third_party_rates']['electric_cost_escalation_lb']))
self.gt_ece_UB_lineEdit.setText(str(assump_json['geo_therm']['third_party_rates']['electric_cost_escalation_ub']))
self.gt_tax_lineEdit.setText(str(assump_json['geo_therm']['third_party_rates']['taxation']))
self.gt_proj_life_lineEdit.setText(str(assump_json['geo_therm']['third_party_rates']['project_life']))
# valid and message class values
self.valid = True
self.errors = []
# other class var
self.color_red = color_red.copy()
self.line_edits = [self.wind_frac_lineEdit, self.wind_turb_diam_lineEdit, self.wind_CapFac_lineEdit, self.wind_Nturb_lineEdit,
self.wind_spacing_lineEdit, self.wind_pow_coef_lineEdit, self.wind_eff_lineEdit, self.wg_disc_rate_lineEdit,
self.wg_infl_rate_lineEdit, self.wg_ece_LB_lineEdit, self.wg_ece_UB_lineEdit, self.wg_tax_lineEdit,
self.wg_proj_life_lineEdit, self.wt_disc_rate_lineEdit, self.wt_infl_rate_lineEdit, self.wt_ece_LB_lineEdit,
self.wt_ece_UB_lineEdit, self.wt_tax_lineEdit, self.wt_proj_life_lineEdit, self.module_type_comboBox,
self.sys_losses_lineEdit, self.tilt_lineEdit, self.azimuth_lineEdit, self.dc_ac_lineEdit, self.inverter_lineEdit,
self.per_roof_lineEdit, self.perc_land_used_lineEdit, self.sg_disc_rate_lineEdit, self.sg_infl_rate_lineEdit,
self.sg_ece_LB_lineEdit, self.sg_ece_UB_lineEdit, self.sg_tax_lineEdit, self.sg_proj_life_lineEdit,
self.st_disc_rate_lineEdit, self.st_infl_rate_lineEdit, self.st_ece_LB_lineEdit, self.st_ece_UB_lineEdit,
self.st_tax_lineEdit, self.st_proj_life_lineEdit, self.opt_eff_lineEdit, self.elec_eff_lineEdit, self.therm_stor_lineEdit,
self.avg_sunhrs_lineEdit, self.per_agency_land_lineEdit, self.cs_cap_fac_lineEdit,
self.csg_disc_rate_lineEdit, self.csg_infl_rate_lineEdit, self.csg_ece_LB_lineEdit, self.csg_ece_UB_lineEdit,
self.csg_tax_lineEdit, self.csg_proj_life_lineEdit, self.cst_disc_rate_lineEdit, self.cst_infl_rate_lineEdit,
self.cst_ece_LB_lineEdit, self.cst_ece_UB_lineEdit, self.cst_tax_lineEdit, self.cst_proj_life_lineEdit, self.h_cap_fac_lineEdit,
self.hrs_oper_lineEdit, self.fuel_emp_comboBox, self.cur_den_lineEdit, self.cell_volt_lineEdit, self.cell_act_area_lineEdit,
self.Nstacks_lineEdit, self.prot_exch_comboBox, self.heat_rec_comboBox, self.heat_val_lineEdit, self.stack_replace_lineEdit,
self.annual_degrade_lineEdit, self.hg_disc_rate_lineEdit, self.hg_infl_rate_lineEdit, self.hg_ece_LB_lineEdit,
self.hg_ece_UB_lineEdit, self.hg_tax_lineEdit, self.hg_proj_life_lineEdit, self.ht_disc_rate_lineEdit, self.ht_infl_rate_lineEdit,
self.ht_ece_LB_lineEdit, self.ht_ece_UB_lineEdit, self.ht_tax_lineEdit, self.ht_proj_life_lineEdit, self.well_depth_lineEdit,
self.amb_temp_lineEdit, self.geo_cap_fac_lineEdit, self.num_wells_lineEdit, self.pump_eff_lineEdit, self.gg_disc_rate_lineEdit,
self.gg_infl_rate_lineEdit, self.gg_ece_LB_lineEdit, self.gg_ece_UB_lineEdit, self.gg_tax_lineEdit, self.gg_proj_life_lineEdit,
self.gt_disc_rate_lineEdit, self.gt_infl_rate_lineEdit, self.gt_ece_LB_lineEdit,self.gt_ece_UB_lineEdit, self.gt_tax_lineEdit,
self.gt_proj_life_lineEdit]
# Reset all page options to valid background
for qq, obj in enumerate(self.line_edits):
if qq in self.color_red:
obj.setStyleSheet(DEFAULT_ERROR)
else:
obj.setStyleSheet(DEFAULT_WHITE)
# Set functions
self.tilt_checkBox.toggled.connect(self.tilt_switch)
self.ok_button = self.buttonBox.button(QDialogButtonBox.StandardButton.Ok)
self.ok_button.clicked.connect(self.validate)
def validate(self):
"""
Goes through all of page one and makes sure that all
entries are valid.
Parameters
----------
None
Returns
-------
bool
valid
list
errors
"""
errors = ["Please address the following issues to continue:"]
valid = True
color_red = []
# Check wind
diam = np.nan
try:
val = float(self.wind_frac_lineEdit.text())
self.assump_json['wind']['system']['fraction_of_average_wind_speed'] = val
if val < 0:
color_red.append(self.wind_frac_lineEdit)
valid = False
errors.append(f"The Fraction of Averate Wind Speed must be greater than zero")
elif val > 3:
color_red.append(self.wind_frac_lineEdit)
valid = False
errors.append(f"The Fraction of Averate Wind Speed must be less than 3")
except:
color_red.append(self.wind_frac_lineEdit)
valid = False
errors.append(f"The Fraction of Averate Wind Speed must be numeric")
try:
val = float(self.wind_turb_diam_lineEdit.text())
self.assump_json['wind']['system']['turbine_diameter'] = val
diam = val
if val < 9:
color_red.append(self.wind_turb_diam_lineEdit)
valid = False
errors.append(f"The Turbine Rotor Diameter must be greater than or equal to 9 meters")
elif val > 252:
color_red.append(self.wind_turb_diam_lineEdit)
valid = False
errors.append(f"The Turbine Rotor Diameter must be less than or equal to 252 meters")
except:
color_red.append(self.wind_turb_diam_lineEdit)
valid = False
errors.append(f"The Turbine Rotor Diameter must be numeric")
try:
val = float(self.wind_CapFac_lineEdit.text())
self.assump_json['wind']['system']['capacity_factor'] = val
if val <= 0:
color_red.append(self.wind_CapFac_lineEdit)
valid = False
errors.append(f"The Wind Capacity Factor must be greater than 0%")
elif val > 100:
color_red.append(self.wind_CapFac_lineEdit)
valid = False
errors.append(f"The Wind Capacity Factor must be less than or equal to 100%")
except:
color_red.append(self.wind_CapFac_lineEdit)
valid = False
errors.append(f"The Wind Capacity Factor must be numeric")
# I think the spacing is wrong. Nothing supports a 2*diameter. 5 was the lowest https://www.renewablesfirst.co.uk/renewable-energy-technologies/windpower/community-windpower/location-size-no-of-wind-turbines/#:~:text=The%20number%20of%20wind%20turbines,turbine%20it%20is%20410%20metres.
# I saw and SAM has it as 8 https://github.com/NREL/SAM/blob/85b6974a7f9f02e931b9013b7d250a7eccd87b1c/deploy/runtime/ui/Wind%20Farm%20Specifications.txt#L1631C30-L1631C30
try:
val = float(self.wind_Nturb_lineEdit.text())
self.assump_json['wind']['system']['N_turbines']
except:
color_red.append(self.wind_Nturb_lineEdit)
valid = False
errors.append(f"The number of turbines must be numeric")
try:
val = float(self.wind_spacing_lineEdit.text())
self.assump_json['wind']['system']['turbine_spacing'] = val
except:
color_red.append(self.wind_spacing_lineEdit)
valid = False
errors.append(f"The distance between turbines must be numeric")
if not np.isnan(diam):
try:
nturb = float(self.wind_Nturb_lineEdit.text())
req_spa = float(self.wind_spacing_lineEdit.text())
spacing = (req_spa/nturb)/diam
if spacing < 5:
color_red.append(self.wind_Nturb_lineEdit)
color_red.append(self.wind_spacing_lineEdit)
valid = False
errors.append(f"The distance between turbines must be greater than or equal to 5 turbine diameters. Currently: {spacing}")
except:
pass
try:
val = float(self.wind_eff_lineEdit.text())
self.assump_json['wind']['system']['overall_efficiency'] = val
if val <= 0:
color_red.append(self.wind_eff_lineEdit)
valid = False
errors.append(f"The Overall Electrical Efficiency must be greater than 0%")
elif val > 100:
color_red.append(self.wind_eff_lineEdit)
valid = False
errors.append(f"The Overall Electrical Efficiency must be less than or equal to 100%")
except:
color_red.append(self.wind_eff_lineEdit)
valid = False
errors.append(f"The Overall Electrical Efficiency must be numeric")
try:
val = float(self.wind_pow_coef_lineEdit.text())
self.assump_json['wind']['system']['power_coefficient'] = val
if val <= 0:
color_red.append(self.wind_pow_coef_lineEdit)
valid = False
errors.append(f"The wind power coefficient must be greater than 0")
elif val > 1:
color_red.append(self.wind_pow_coef_lineEdit)
valid = False
errors.append(f"The wind power coefficient must be less than or equal to 1")
except:
color_red.append(self.wind_pow_coef_lineEdit)
valid = False
errors.append(f"The wind power coefficient must be numeric")
# Check Solar
self.assump_json['solar']['system']['module_type'] = self.module_type_comboBox.currentIndex()
try:
val = float(self.sys_losses_lineEdit.text())
self.assump_json['solar']['system']['system_losses'] = val
if val < 0:
color_red.append(self.sys_losses_lineEdit)
valid = False
errors.append(f"The total system losses must be greater than or equal to 0%")
elif val > 100:
color_red.append(self.sys_losses_lineEdit)
valid = False
errors.append(f"The total system losses must be less than or equal to 100%")
except:
color_red.append(self.sys_losses_lineEdit)
valid = False
errors.append(f"The total system losses must be numeric")
self.assump_json['solar']['system']['use_lat_tilt'] = self.tilt_checkBox.isChecked()
if not self.tilt_checkBox.isChecked():
try:
val = float(self.tilt_lineEdit.text())
self.assump_json['solar']['system']['tilt'] = val
if val < 0:
color_red.append(self.tilt_lineEdit)
valid = False
errors.append(f"The solar array tilt must be greater than or equal to 0 degrees")
elif val > 90:
color_red.append(self.tilt_lineEdit)
valid = False
errors.append(f"The solar array tilt must be less than or equal to 90 degrees")
except:
color_red.append(self.tilt_lineEdit)
valid = False
errors.append(f"The solar array tilt must be numeric")
try:
val = float(self.azimuth_lineEdit.text())
self.assump_json['solar']['system']['azimuth'] = val
if val < 0:
color_red.append(self.azimuth_lineEdit)
valid = False
errors.append(f"The solar azimuth must be greater than or equal to 0 degrees")
elif val >= 360:
color_red.append(self.azimuth_lineEdit)
valid = False
errors.append(f"The solar azimuth must be less than 360 degrees")
except:
color_red.append(self.azimuth_lineEdit)
valid = False
errors.append(f"The solar azimuth must be numeric")
try:
val = float(self.dc_ac_lineEdit.text())
self.assump_json['solar']['system']['dc_to_ac_ratio'] = val
if val < 1:
color_red.append(self.dc_ac_lineEdit)
valid = False
errors.append(f"The D.C. to A.C. ratio must be greater than or equal to 1")
elif val > 1.35:
color_red.append(self.dc_ac_lineEdit)
valid = False
errors.append(f"The D.C. to A.C. ratio must be less than or equal to 1.35")
except:
color_red.append(self.dc_ac_lineEdit)
valid = False
errors.append(f"The D.C. to A.C. ratio must be numeric")
try:
val = float(self.inverter_lineEdit.text())
self.assump_json['solar']['system']['invert_eff'] = val
if val < 90:
color_red.append(self.inverter_lineEdit)
valid = False
errors.append(f"The inverter efficiency must be greater than or equal to 90%")
elif val > 99.5:
color_red.append(self.inverter_lineEdit)
valid = False
errors.append(f"The inverter efficiency must be less than or equal to 99.5%")
except:
color_red.append(self.inverter_lineEdit)
valid = False
errors.append(f"The inverter efficiency must be numeric")
try:
val = float(self.per_roof_lineEdit.text())
self.assump_json['solar']['system']['precent_roof_avail'] = val
if val <= 0:
color_red.append(self.per_roof_lineEdit)
valid = False
errors.append(f"The percent of rooftop available for solar must be greater than 0%")
elif val > 100:
color_red.append(self.per_roof_lineEdit)
valid = False
errors.append(f"The percent of rooftop available for solar must be less than or equal to 100%")
except:
color_red.append(self.per_roof_lineEdit)
valid = False
errors.append(f"The percent of rooftop available for solar must be numeric")
try:
val = float(self.perc_land_used_lineEdit.text())
self.assump_json['solar']['system']['perc_land_used'] = val
if val <= 0:
color_red.append(self.perc_land_used_lineEdit)
valid = False
errors.append(f"The percent of land used for solar must be greater than 0%")
elif val > 100:
color_red.append(self.perc_land_used_lineEdit)
valid = False
errors.append(f"The percent of land used for solar must be less than or equal to 100%")
except:
color_red.append(self.perc_land_used_lineEdit)
valid = False
errors.append(f"The percent of land used for solar must be numeric")
# Check Concentrating Solar
try:
val = float(self.opt_eff_lineEdit.text())
self.assump_json['conc_solar']['system']['optical_eff'] = val
if val <= 0:
color_red.append(self.opt_eff_lineEdit)
valid = False
errors.append(f"The optical efficiency for concentrating solar must be greater than 0%")
elif val > 100:
color_red.append(self.opt_eff_lineEdit)
valid = False
errors.append(f"The optical efficiency for concentrating solar must be less than or equal to 100%")
except:
color_red.append(self.opt_eff_lineEdit)
valid = False
errors.append(f"The optical efficiency for concentrating solar must be numeric")
try:
val = float(self.elec_eff_lineEdit.text())
self.assump_json['conc_solar']['system']['elec_eff'] = val
if val <= 0:
color_red.append(self.elec_eff_lineEdit)
valid = False
errors.append(f"The electrical efficiency for concentrating solar must be greater than 0%")
elif val > 100:
color_red.append(self.elec_eff_lineEdit)
valid = False
errors.append(f"The electrical efficiency for concentrating solar must be less than or equal to 100%")
except:
color_red.append(self.elec_eff_lineEdit)
valid = False
errors.append(f"The electrical efficiency for concentrating solar must be numeric")
try:
val = float(self.therm_stor_lineEdit.text())
self.assump_json['conc_solar']['system']['thermal_storage'] = val
if val < 0:
color_red.append(self.therm_stor_lineEdit)
valid = False
errors.append(f"The thermal storage for concentrating solar must be greater than or equal to 0")
elif val > 30:
color_red.append(self.therm_stor_lineEdit)
valid = False
errors.append(f"The thermal storage for concentrating solar must be less than or equal to 30")
except:
color_red.append(self.therm_stor_lineEdit)
valid = False
errors.append(f"The thermal storage for concentrating solar must be numeric")
try:
val = float(self.avg_sunhrs_lineEdit.text())
self.assump_json['conc_solar']['system']['avg_sun_hours'] = val
if val < 0:
color_red.append(self.avg_sunhrs_lineEdit)
valid = False
errors.append(f"The average hours of sun per day for concentrating solar must be greater than or equal to 0")
elif val > 30:
color_red.append(self.avg_sunhrs_lineEdit)
valid = False
errors.append(f"The average hours of sun per day for concentrating solar must be less than or equal to 24")
except:
color_red.append(self.avg_sunhrs_lineEdit)
valid = False
errors.append(f"The average hours of sun per day for concentrating solar must be numeric")
try:
val = float(self.per_agency_land_lineEdit.text())
self.assump_json['conc_solar']['system']['perc_land_used'] = val
if val <= 0:
color_red.append(self.per_agency_land_lineEdit)
valid = False
errors.append(f"The precent of land used for concentrating solar must be greater than 0%")
elif val > 100:
color_red.append(self.per_agency_land_lineEdit)
valid = False
errors.append(f"The precent of land used for concentrating solar must be less than or equal to 100%")
except:
color_red.append(self.per_agency_land_lineEdit)
valid = False
errors.append(f"The precent of land used for concentrating solar must be numeric")
try:
val = float(self.cs_cap_fac_lineEdit.text())
self.assump_json['conc_solar']['system']['capacity_factor'] = val
if val <= 0:
color_red.append(self.cs_cap_fac_lineEdit)
valid = False
errors.append(f"The precent of land used for concentrating solar must be greater than 0%")
elif val > 100:
color_red.append(self.cs_cap_fac_lineEdit)
valid = False
errors.append(f"The precent of land used for concentrating solar must be less than or equal to 100%")
except:
color_red.append(self.cs_cap_fac_lineEdit)
valid = False
errors.append(f"The precent of land used for concentrating solar must be numeric")
# Check Hydrogen Cells
try:
val = float(self.h_cap_fac_lineEdit.text())
self.assump_json['hydrogen']['system']['capacity_factor'] = val
if val <= 0:
color_red.append(self.h_cap_fac_lineEdit)
valid = False
errors.append(f"The capacity factor for hydrogen fuel cells must be greater than 0%")
elif val > 100:
color_red.append(self.h_cap_fac_lineEdit)
valid = False
errors.append(f"The capacity factor for hydrogen fuel cells must be less than or equal to 100%")
except:
color_red.append(self.h_cap_fac_lineEdit)
valid = False
errors.append(f"The capacity factor for hydrogen fuel cells must be numeric")
try:
val = float(self.hrs_oper_lineEdit.text())
self.assump_json['hydrogen']['system']['daily_operation'] = val
if val < 0:
color_red.append(self.hrs_oper_lineEdit)
valid = False
errors.append(f"The operational hours per day for hydrogen fuel cells must be greater than or equal to 0")
elif val > 30:
color_red.append(self.hrs_oper_lineEdit)
valid = False
errors.append(f"The operational hours per day for hydrogen fuel cells must be less than or equal to 24")
except:
color_red.append(self.hrs_oper_lineEdit)
valid = False
errors.append(f"The operational hours per day for hydrogen fuel cells must be numeric")
try:
val = float(self.cur_den_lineEdit.text())
self.assump_json['hydrogen']['system']['curr_density'] = val
if val < 0:
color_red.append(self.cur_den_lineEdit)
valid = False
errors.append(f"The hydrogen fuel cell current density must be greater than or equal to 0")
elif val > 15000:
color_red.append(self.cur_den_lineEdit)
valid = False
errors.append(f"The hydrogen fuel cell current density must be less than or equal to 15,000")
except:
color_red.append(self.cur_den_lineEdit)
valid = False
errors.append(f"The hydrogen fuel cell current density must be numeric")
try:
val = float(self.cell_act_area_lineEdit.text())
self.assump_json['hydrogen']['system']['cell_active_area'] = val
if val < 0:
color_red.append(self.cell_act_area_lineEdit)
valid = False
errors.append(f"The hydrogen fuel cell active area must be greater than or equal to 0")
elif val > 5:
color_red.append(self.cell_act_area_lineEdit)
valid = False
errors.append(f"The hydrogen fuel cell active area must be less than or equal to 5")
except:
color_red.append(self.cell_act_area_lineEdit)
valid = False
errors.append(f"The hydrogen fuel cell active area must be numeric")
try:
val = float(self.cell_volt_lineEdit.text())
self.assump_json['hydrogen']['system']['cell_voltage'] = val
if val < 0.6:
color_red.append(self.cell_volt_lineEdit)
valid = False
errors.append(f"The hydrogen fuel cell voltage must be greater than or equal to 0.6")
elif val > 0.8:
color_red.append(self.cell_volt_lineEdit)
valid = False
errors.append(f"The hydrogen fuel cell voltage must be less than or equal to 0.8")
except:
color_red.append(self.cell_volt_lineEdit)
valid = False
errors.append(f"The hydrogen fuel cell voltage must be numeric")
try:
val = int(self.Nstacks_lineEdit.text())
self.assump_json['hydrogen']['system']['N_stacks'] = val
if val < 1:
color_red.append(self.Nstacks_lineEdit)
valid = False
errors.append(f"The number of stacks for hydrogen fuel cell must be greater than or equal to 1")
elif val > 100:
color_red.append(self.Nstacks_lineEdit)
valid = False
errors.append(f"The number of stacks for hydrogen fuel cell must be less than or equal to 100")
except:
color_red.append(self.Nstacks_lineEdit)
valid = False
errors.append(f"The number of stacks for hydrogen fuel cell must be numeric")
try:
val = float(self.stack_replace_lineEdit.text())
self.assump_json['hydrogen']['system']['stack_replacement'] = val
if val < 1:
color_red.append(self.stack_replace_lineEdit)
valid = False
errors.append(f"The time to replace hydrogen fuel cell must be greater than or equal to 1")
elif val > 10:
color_red.append(self.stack_replace_lineEdit)
valid = False
errors.append(f"The time to replace hydrogen fuel cell must be less than or equal to 10")
except:
color_red.append(self.stack_replace_lineEdit)
valid = False
errors.append(f"The time to replace for hydrogen fuel cell must be numeric")
try:
val = float(self.annual_degrade_lineEdit.text())
self.assump_json['hydrogen']['system']['annual_degredation'] = val
if val < 3:
color_red.append(self.annual_degrade_lineEdit)
valid = False
errors.append(f"The hydrogen fuel cell degradation must be greater than or equal to 1")
elif val > 20:
color_red.append(self.annual_degrade_lineEdit)
valid = False
errors.append(f"The hydrogen fuel cell degradation must be less than or equal to 10")
except:
color_red.append(self.annual_degrade_lineEdit)
valid = False
errors.append(f"The hydrogen fuel cell degradation must be numeric")
# Check Geothermal
try:
# https://utahforge.com/2021/03/29/did-you-know-geothermal-wells-can-be-highly-deviated-too/
val = float(self.well_depth_lineEdit.text())
self.assump_json['geo_therm']['system']['well_depth'] = val
if val < 1000:
color_red.append(self.well_depth_lineEdit)
valid = False
errors.append(f"The geothermal well depth must be greater than or equal to 1000 m")
elif val > 6000:
color_red.append(self.well_depth_lineEdit)
valid = False
errors.append(f"The geothermal well depth must be less than or equal to 6000 m")
except:
color_red.append(self.well_depth_lineEdit)
valid = False
errors.append(f"The geothermal well depth must be numeric")
try:
val = float(self.amb_temp_lineEdit.text())
self.assump_json['geo_therm']['system']['ambient_temp'] = val
if val < 0:
color_red.append(self.amb_temp_lineEdit)
valid = False
errors.append(f"The geothermal ambient temperature must be greater than or equal to 0 C")
elif val > 43.33:
color_red.append(self.amb_temp_lineEdit)
valid = False
errors.append(f"The geothermal ambient temperature must be less than or equal to 43.33 C")
except:
color_red.append(self.amb_temp_lineEdit)
valid = False
errors.append(f"The geothermal ambient temperature must be numeric")
try:
val = float(self.geo_cap_fac_lineEdit.text())
self.assump_json['geo_therm']['system']['capacity_factor'] = val
if val <= 0:
color_red.append(self.geo_cap_fac_lineEdit)
valid = False
errors.append(f"The capacity factor for geothermal wells must be greater than 0%")
elif val > 100:
color_red.append(self.geo_cap_fac_lineEdit)
valid = False
errors.append(f"The capacity factor for geothermal wells must be less than or equal to 100%")
except:
color_red.append(self.geo_cap_fac_lineEdit)
valid = False
errors.append(f"The capacity factor for geothermal wells must be numeric")
try:
val = int(float(self.num_wells_lineEdit.text()))
self.assump_json['geo_therm']['system']['number_of_wells'] = val
if val < 1:
color_red.append(self.num_wells_lineEdit)
valid = False
errors.append(f"The number geothermal wells must be greater than or equal to 1")
except:
color_red.append(self.num_wells_lineEdit)
valid = False
errors.append(f"The number of geothermal wells must be numeric")
try:
val = float(self.pump_eff_lineEdit.text())
self.assump_json['geo_therm']['system']['overall_pump_efficiency'] = val
if val <= 0:
color_red.append(self.pump_eff_lineEdit)
valid = False
errors.append(f"The pumping efficieny for geothermal wells must be greater than 0%")
elif val > 100:
color_red.append(self.pump_eff_lineEdit)
valid = False
errors.append(f"The pumping efficieny for geothermal wells must be less than or equal to 100%")
except:
color_red.append(self.pump_eff_lineEdit)
valid = False
errors.append(f"The pumping efficieny for geothermal wells must be numeric")
# Check Goverment Rates
for entry in [(self.wg_disc_rate_lineEdit, "wind"), (self.sg_disc_rate_lineEdit, "solar"),
(self.csg_disc_rate_lineEdit, "conc_solar"), (self.hg_disc_rate_lineEdit, "hydrogen"),
(self.gg_disc_rate_lineEdit, "geo_therm")]:
try:
val = float(entry[0].text())
self.assump_json[entry[1]]['gov_rates']['discount_rate'] = val
except:
color_red.append(entry)
valid = False
errors.append(f"Government owned discounted rate must be numeric")
for entry in [(self.wg_infl_rate_lineEdit, "wind"), (self.sg_infl_rate_lineEdit, "solar"),
(self.csg_infl_rate_lineEdit, "conc_solar"), (self.hg_infl_rate_lineEdit, "hydrogen"),
(self.gg_infl_rate_lineEdit, "geo_therm")]:
try:
val = float(entry[0].text())
self.assump_json[entry[1]]['gov_rates']['inflation_rate'] = val
except:
color_red.append(entry)
valid = False
errors.append(f"Government owned inflation rate must be numeric")
for entry in [(self.wg_ece_LB_lineEdit, "wind"), (self.sg_ece_LB_lineEdit, "solar"),
(self.csg_ece_LB_lineEdit, "conc_solar"), (self.hg_ece_LB_lineEdit, "hydrogen"),
(self.gg_ece_LB_lineEdit, "geo_therm")]:
try:
val = float(entry[0].text())
self.assump_json[entry[1]]['gov_rates']['electric_cost_escalation_lb'] = val
except:
color_red.append(entry)
valid = False
errors.append(f"Government owned electric cost escalation lower bound must be numeric")
for entry in [(self.wg_ece_UB_lineEdit, "wind"), (self.sg_ece_UB_lineEdit, "solar"),
(self.csg_ece_UB_lineEdit, "conc_solar"), (self.hg_ece_UB_lineEdit, "hydrogen"),
(self.gg_ece_UB_lineEdit, "geo_therm")]:
try:
val = float(entry[0].text())
self.assump_json[entry[1]]['gov_rates']['electric_cost_escalation_ub'] = val
except:
color_red.append(entry)
valid = False
errors.append(f"Government owned electric cost escalation upper bound must be numeric")
for entry in [[self.wg_ece_LB_lineEdit,self.wg_ece_UB_lineEdit], [self.sg_ece_LB_lineEdit,self.sg_ece_UB_lineEdit],
[self.csg_ece_LB_lineEdit,self.csg_ece_UB_lineEdit], [self.hg_ece_LB_lineEdit,self.hg_ece_UB_lineEdit],
[self.gg_ece_LB_lineEdit,self.gg_ece_UB_lineEdit]]:
try:
val_lb = float(entry[0].text())
val_ub = float(entry[1].text())
if val_ub <= val_lb:
color_red.append(entry[0])
color_red.append(entry[1])
valid = False
errors.append(f"The goverment owned upper bound on electric cost escalation must be larger than the lower bound")
except:
pass
for entry in [(self.wg_tax_lineEdit, "wind"), (self.sg_tax_lineEdit, "solar"),
(self.csg_tax_lineEdit, "conc_solar"), (self.hg_tax_lineEdit, "hydrogen"),
(self.gg_tax_lineEdit, "geo_therm")]:
try:
val = float(entry[0].text())
self.assump_json[entry[1]]['gov_rates']['taxation'] = val
except:
color_red.append(entry)
valid = False
errors.append(f"overnment owned taxation rate must be numeric")
for entry in [(self.wg_proj_life_lineEdit, "wind"), (self.sg_proj_life_lineEdit, "solar"),
(self.csg_proj_life_lineEdit, "conc_solar"), (self.hg_proj_life_lineEdit, "hydrogen"),
(self.gg_proj_life_lineEdit, "geo_therm")]:
try:
val = float(entry[0].text())
self.assump_json[entry[1]]['gov_rates']['project_life'] = val
if val <= 0:
color_red.append(entry)
valid = False
errors.append(f"Government owned project life must be greater than 0")
except:
color_red.append(entry)
valid = False
errors.append(f"Government owned project life must be numeric")
# Check Third-Party Rates
for entry in [(self.wt_disc_rate_lineEdit, "wind"), (self.st_disc_rate_lineEdit, "solar"),
(self.cst_disc_rate_lineEdit, "conc_solar"), (self.ht_disc_rate_lineEdit, "hydrogen"),
(self.gt_disc_rate_lineEdit, "geo_therm")]:
try:
val = float(entry[0].text())
self.assump_json[entry[1]]['third_party_rates']['discount_rate'] = val
except:
color_red.append(entry)
valid = False
errors.append(f"Third party owned discounted rate must be numeric")
for entry in [(self.wt_infl_rate_lineEdit, "wind"), (self.st_infl_rate_lineEdit, "solar"),
(self.cst_infl_rate_lineEdit, "conc_solar"), (self.ht_infl_rate_lineEdit, "hydrogen"),
(self.gt_infl_rate_lineEdit, "geo_therm")]:
try:
val = float(entry[0].text())
self.assump_json[entry[1]]['third_party_rates']['inflation_rate'] = val
except:
color_red.append(entry)
valid = False
errors.append(f"Third party owned inflation rate must be numeric")
for entry in [(self.wt_ece_LB_lineEdit, "wind"), (self.st_ece_LB_lineEdit, "solar"),
(self.cst_ece_LB_lineEdit, "conc_solar"), (self.ht_ece_LB_lineEdit, "hydrogen"),
(self.gt_ece_LB_lineEdit, "geo_therm")]:
try:
val = float(entry[0].text())
self.assump_json[entry[1]]['third_party_rates']['electric_cost_escalation_lb'] = val
except:
color_red.append(entry)
valid = False
errors.append(f"Third party owned electric cost escalation lower bound must be numeric")
for entry in [(self.wt_ece_UB_lineEdit, "wind"), (self.st_ece_UB_lineEdit, "solar"),
(self.cst_ece_UB_lineEdit, "conc_solar"), (self.ht_ece_UB_lineEdit, "hydrogen"),
(self.gt_ece_UB_lineEdit, "geo_therm")]:
try:
val = float(entry[0].text())
self.assump_json[entry[1]]['third_party_rates']['electric_cost_escalation_ub'] = val
except:
color_red.append(entry)
valid = False
errors.append(f"Third party owned electric cost escalation upper bound must be numeric")
for entry in [[self.wt_ece_LB_lineEdit,self.wt_ece_UB_lineEdit], [self.st_ece_LB_lineEdit,self.st_ece_UB_lineEdit],
[self.cst_ece_LB_lineEdit,self.cst_ece_UB_lineEdit], [self.ht_ece_LB_lineEdit,self.ht_ece_UB_lineEdit],
[self.gt_ece_LB_lineEdit,self.gt_ece_UB_lineEdit]]:
try:
val_lb = float(entry[0].text())
val_ub = float(entry[1].text())
if val_ub <= val_lb:
color_red.append(entry[0])
color_red.append(entry[1])
valid = False
errors.append(f"The third party owned upper bound on electric cost escalation must be larger than the lower bound")
except:
pass
for entry in [(self.wt_tax_lineEdit, "wind"), (self.st_tax_lineEdit, "solar"),
(self.cst_tax_lineEdit, "conc_solar"), (self.ht_tax_lineEdit, "hydrogen"),
(self.gt_tax_lineEdit, "geo_therm")]:
try:
val = float(entry[0].text())
self.assump_json[entry[1]]['third_party_rates']['taxation'] = val
except:
color_red.append(entry)
valid = False
errors.append(f"Third party owned taxation rate must be numeric")
for entry in [(self.wt_proj_life_lineEdit, "wind"), (self.st_proj_life_lineEdit, "solar"),
(self.cst_proj_life_lineEdit, "conc_solar"), (self.ht_proj_life_lineEdit, "hydrogen"),
(self.gt_proj_life_lineEdit, "geo_therm")]:
try:
val = float(entry[0].text())
self.assump_json[entry[1]]['third_party_rates']['project_life'] = val
if val <= 0:
color_red.append(entry)
valid = False
errors.append(f"Third party owned project life must be greater than 0")
except:
color_red.append(entry)
valid = False
errors.append(f"Third party owned project life must be numeric")
errors.append("")
errors.append("*If any values were found to be non-numeric, they were reset to their default values")
self.valid = valid
self.errors = errors
self.color_red = []
for qq, obj in enumerate(self.line_edits):
if obj in color_red:
self.color_red.append(qq)
def tilt_switch(self):
if self.tilt_checkBox.isChecked():
self.tilt_lineEdit.setText("")
self.tilt_lineEdit.setEnabled(False)
else:
self.tilt_lineEdit.setText(str(self.assump_json['solar']['system']['tilt']))
self.tilt_lineEdit.setEnabled(True)