Skip to content

Commit 42154f9

Browse files
committed
Remove hardcoding and loop over possible uplift_names in printout.
1 parent cab01a4 commit 42154f9

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

flasc/analysis/expected_power_analysis_output.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,20 @@ def __init__(
6363
self.cov_terms = cov_terms
6464

6565
def _return_uplift_string(self):
66-
return (
67-
f"{self.uplift_results['scada_uplift']['energy_uplift_ctr_pc']:+0.2f}%, ("
68-
f"{self.uplift_results['scada_uplift']['energy_uplift_lb_pc']:+0.2f}% - "
69-
f"{self.uplift_results['scada_uplift']['energy_uplift_ub_pc']:+0.2f}%)"
70-
f" -- N={self.uplift_results['scada_uplift']['count']}"
71-
)
66+
return_string = ""
67+
68+
for un in self.uplift_names:
69+
uplift_string = (
70+
f"{un}: "
71+
f"{self.uplift_results[un]['energy_uplift_ctr_pc']:+0.2f}%, ("
72+
f"{self.uplift_results[un]['energy_uplift_lb_pc']:+0.2f}% - "
73+
f"{self.uplift_results[un]['energy_uplift_ub_pc']:+0.2f}%)"
74+
f" -- N={self.uplift_results[un]['count']}"
75+
"\n"
76+
)
77+
return_string += uplift_string
78+
79+
return return_string
7280

7381
def print_uplift(self):
7482
"""Print the uplift results."""

0 commit comments

Comments
 (0)