add colors to wcel capacity
Browse files
apps/kpi_analysis/wcel_capacity.py
CHANGED
|
@@ -6,7 +6,7 @@ from process_kpi.process_wcel_capacity import (
|
|
| 6 |
WcelCapacity,
|
| 7 |
load_and_process_wcel_capacity_data,
|
| 8 |
)
|
| 9 |
-
from utils.convert_to_excel import
|
| 10 |
|
| 11 |
# Streamlit UI
|
| 12 |
|
|
@@ -92,7 +92,7 @@ if uploaded_file is not None:
|
|
| 92 |
wcel_analysis_df = results[0]
|
| 93 |
kpi_df = results[1]
|
| 94 |
|
| 95 |
-
WcelCapacity.final_results =
|
| 96 |
[wcel_analysis_df, kpi_df], ["wcel_analysis", "kpi"]
|
| 97 |
)
|
| 98 |
st.download_button(
|
|
|
|
| 6 |
WcelCapacity,
|
| 7 |
load_and_process_wcel_capacity_data,
|
| 8 |
)
|
| 9 |
+
from utils.convert_to_excel import convert_wcel_capacity_dfs
|
| 10 |
|
| 11 |
# Streamlit UI
|
| 12 |
|
|
|
|
| 92 |
wcel_analysis_df = results[0]
|
| 93 |
kpi_df = results[1]
|
| 94 |
|
| 95 |
+
WcelCapacity.final_results = convert_wcel_capacity_dfs(
|
| 96 |
[wcel_analysis_df, kpi_df], ["wcel_analysis", "kpi"]
|
| 97 |
)
|
| 98 |
st.download_button(
|
utils/convert_to_excel.py
CHANGED
|
@@ -190,6 +190,40 @@ def get_format_map_by_format_type(formats: dict, format_type: str) -> dict:
|
|
| 190 |
"congestion_comment": formats["orange"],
|
| 191 |
"final_comments": formats["green"],
|
| 192 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 193 |
else:
|
| 194 |
return {} # No formatting if format_type not matched
|
| 195 |
|
|
@@ -237,6 +271,11 @@ def convert_lte_analysis_dfs(dfs, sheet_names) -> bytes:
|
|
| 237 |
return _write_to_excel(dfs, sheet_names, index=True, format_type="LTE_Analysis")
|
| 238 |
|
| 239 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240 |
@st.cache_data
|
| 241 |
def convert_database_dfs(dfs, sheet_names) -> bytes:
|
| 242 |
return _write_to_excel(dfs, sheet_names, index=True, format_type="database")
|
|
|
|
| 190 |
"congestion_comment": formats["orange"],
|
| 191 |
"final_comments": formats["green"],
|
| 192 |
}
|
| 193 |
+
|
| 194 |
+
elif format_type == "WCEL_capacity":
|
| 195 |
+
return {
|
| 196 |
+
"code": formats["blue"],
|
| 197 |
+
"Region": formats["blue"],
|
| 198 |
+
"name": formats["blue"],
|
| 199 |
+
"Avg_availability": formats["blue_light"],
|
| 200 |
+
"Avail_exceed_days": formats["blue_light"],
|
| 201 |
+
"availability_comment": formats["blue_light"],
|
| 202 |
+
"sum_traffic_cs": formats["beurre"],
|
| 203 |
+
"sum_traffic_dl": formats["beurre"],
|
| 204 |
+
"max_dl_throughput": formats["beurre"],
|
| 205 |
+
"avg_dl_throughput": formats["beurre"],
|
| 206 |
+
"max_users": formats["beurre"],
|
| 207 |
+
"max_iub_frameloss": formats["purple5"],
|
| 208 |
+
"iub_frameloss_exceed_days": formats["purple5"],
|
| 209 |
+
"max_hsdpa_congestion_rate_iub": formats["purple5"],
|
| 210 |
+
"hsdpa_iub_exceed_days": formats["purple5"],
|
| 211 |
+
"max_rrc_fail_ac": formats["purple6"],
|
| 212 |
+
"ac_fail_exceed_days": formats["purple6"],
|
| 213 |
+
"max_rrc_fail_ac_ul": formats["purple6"],
|
| 214 |
+
"ac_ul_fail_exceed_days": formats["purple6"],
|
| 215 |
+
"max_rrc_fail_ac_dl": formats["purple6"],
|
| 216 |
+
"ac_dl_fail_exceed_days": formats["purple6"],
|
| 217 |
+
"max_rrc_fail_code": formats["purple6"],
|
| 218 |
+
"code_fail_exceed_days": formats["purple6"],
|
| 219 |
+
"max_rrc_fail_bts": formats["yellow"],
|
| 220 |
+
"bts_fail_exceed_days": formats["yellow"],
|
| 221 |
+
"tx_congestion_comments": formats["green"],
|
| 222 |
+
"operational_comments": formats["green"],
|
| 223 |
+
"fails_comments": formats["green"],
|
| 224 |
+
"final_comments": formats["green"],
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
else:
|
| 228 |
return {} # No formatting if format_type not matched
|
| 229 |
|
|
|
|
| 271 |
return _write_to_excel(dfs, sheet_names, index=True, format_type="LTE_Analysis")
|
| 272 |
|
| 273 |
|
| 274 |
+
@st.cache_data
|
| 275 |
+
def convert_wcel_capacity_dfs(dfs, sheet_names) -> bytes:
|
| 276 |
+
return _write_to_excel(dfs, sheet_names, index=True, format_type="WCEL_capacity")
|
| 277 |
+
|
| 278 |
+
|
| 279 |
@st.cache_data
|
| 280 |
def convert_database_dfs(dfs, sheet_names) -> bytes:
|
| 281 |
return _write_to_excel(dfs, sheet_names, index=True, format_type="database")
|