adding number of site per lac to GSM and WCDMA charts
Browse files- apps/dump_analysis.py +29 -0
- documentations/database_doc.py +5 -0
- queries/process_gsm.py +39 -7
- queries/process_wcdma.py +26 -0
- utils/utils_vars.py +2 -0
apps/dump_analysis.py
CHANGED
@@ -79,6 +79,21 @@ def dump_analysis_space():
|
|
79 |
with bts_administate_distribution_plot_col:
|
80 |
st.bar_chart(GsmAnalysisData.bts_administate_distribution)
|
81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
st.markdown("***")
|
83 |
st.markdown(":blue[**Number of Cell per LAC**]")
|
84 |
number_of_cell_per_lac_data_col, number_of_cell_per_lac_plot_col = st.columns(2)
|
@@ -152,7 +167,21 @@ def dump_analysis_space():
|
|
152 |
st.bar_chart(WcdmaAnalysisData.number_of_site_per_rnc)
|
153 |
|
154 |
st.markdown("***")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
|
|
|
156 |
st.markdown(":green[**Number of Cell per LAC**]")
|
157 |
number_of_cell_per_lac_data_col, number_of_cell_per_lac_plot_col = st.columns(2)
|
158 |
with number_of_cell_per_lac_data_col:
|
|
|
79 |
with bts_administate_distribution_plot_col:
|
80 |
st.bar_chart(GsmAnalysisData.bts_administate_distribution)
|
81 |
|
82 |
+
st.markdown("***")
|
83 |
+
st.markdown(":blue[**Number of Site per LAC**]")
|
84 |
+
number_of_site_per_lac_data_col, number_of_site_per_lac_plot_col = st.columns(2)
|
85 |
+
with number_of_site_per_lac_data_col:
|
86 |
+
st.write(GsmAnalysisData.number_of_site_per_lac)
|
87 |
+
with number_of_site_per_lac_plot_col:
|
88 |
+
fig = create_lac_count_per_controller_subplots(
|
89 |
+
df=GsmAnalysisData.number_of_site_per_lac,
|
90 |
+
controller_column="BSC_NAME_ID",
|
91 |
+
lac_column="LAC",
|
92 |
+
count_column="count",
|
93 |
+
fig_title="Number of Site per LAC and BSC",
|
94 |
+
)
|
95 |
+
st.plotly_chart(fig)
|
96 |
+
|
97 |
st.markdown("***")
|
98 |
st.markdown(":blue[**Number of Cell per LAC**]")
|
99 |
number_of_cell_per_lac_data_col, number_of_cell_per_lac_plot_col = st.columns(2)
|
|
|
167 |
st.bar_chart(WcdmaAnalysisData.number_of_site_per_rnc)
|
168 |
|
169 |
st.markdown("***")
|
170 |
+
st.markdown(":green[**Number of Site per LAC**]")
|
171 |
+
number_of_site_per_lac_data_col, number_of_site_per_lac_plot_col = st.columns(2)
|
172 |
+
with number_of_site_per_lac_data_col:
|
173 |
+
st.write(WcdmaAnalysisData.number_of_site_per_lac)
|
174 |
+
with number_of_site_per_lac_plot_col:
|
175 |
+
fig = create_lac_count_per_controller_subplots(
|
176 |
+
df=WcdmaAnalysisData.number_of_site_per_lac,
|
177 |
+
controller_column="RNC",
|
178 |
+
lac_column="LAC",
|
179 |
+
count_column="Site_Count",
|
180 |
+
fig_title="Number of Site per LAC and RNC",
|
181 |
+
)
|
182 |
+
st.plotly_chart(fig)
|
183 |
|
184 |
+
st.markdown("***")
|
185 |
st.markdown(":green[**Number of Cell per LAC**]")
|
186 |
number_of_cell_per_lac_data_col, number_of_cell_per_lac_plot_col = st.columns(2)
|
187 |
with number_of_cell_per_lac_data_col:
|
documentations/database_doc.py
CHANGED
@@ -18,6 +18,7 @@ The app requires the following sheets to be present in the uploaded file:
|
|
18 |
- BTS
|
19 |
- BCF
|
20 |
- TRX
|
|
|
21 |
2. **3G :**
|
22 |
- WCEL
|
23 |
- WBTS
|
@@ -35,6 +36,10 @@ The app requires the following sheets to be present in the uploaded file:
|
|
35 |
- ADJW
|
36 |
- BTS
|
37 |
- WCEL
|
|
|
|
|
|
|
|
|
38 |
|
39 |
Please ensure that these sheets are present in the uploaded file to avoid any errors.
|
40 |
|
|
|
18 |
- BTS
|
19 |
- BCF
|
20 |
- TRX
|
21 |
+
- MAL
|
22 |
2. **3G :**
|
23 |
- WCEL
|
24 |
- WBTS
|
|
|
36 |
- ADJW
|
37 |
- BTS
|
38 |
- WCEL
|
39 |
+
5. **MRBTS :**
|
40 |
+
- MRBTS
|
41 |
+
6. **INVUNIT :**
|
42 |
+
- INVUNIT
|
43 |
|
44 |
Please ensure that these sheets are present in the uploaded file to avoid any errors.
|
45 |
|
queries/process_gsm.py
CHANGED
@@ -232,6 +232,14 @@ def gsm_analaysis(file_path: str):
|
|
232 |
df_site_per_bsc = gsm_df[["BSC", "code"]]
|
233 |
df_site_per_bsc = df_site_per_bsc.drop_duplicates(subset=["code"], keep="first")
|
234 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
GsmAnalysisData.total_number_of_bsc = len(gsm_df["BSC"].unique())
|
236 |
GsmAnalysisData.total_number_of_cell = len(gsm_df["ID_BTS"].unique())
|
237 |
GsmAnalysisData.number_of_site = len(gsm_df["site_name"].unique())
|
@@ -250,8 +258,10 @@ def gsm_analaysis(file_path: str):
|
|
250 |
# .rename(columns={"index": "value", 0: "count"})
|
251 |
# )
|
252 |
|
|
|
253 |
GsmAnalysisData.number_of_trx_per_bsc = trx_df["BSC"].value_counts()
|
254 |
-
|
|
|
255 |
GsmAnalysisData.number_of_cell_per_lac = (
|
256 |
gsm_df.groupby(["BSC", "locationAreaIdLAC"]).size().reset_index(name="count")
|
257 |
)
|
@@ -281,9 +291,31 @@ def gsm_analaysis(file_path: str):
|
|
281 |
["BSC_NAME_ID", "LAC", "count"]
|
282 |
]
|
283 |
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
df_site_per_bsc = gsm_df[["BSC", "code"]]
|
233 |
df_site_per_bsc = df_site_per_bsc.drop_duplicates(subset=["code"], keep="first")
|
234 |
|
235 |
+
df_site_per_lac = gsm_df[["BSC", "locationAreaIdLAC", "code"]]
|
236 |
+
df_site_per_lac["code_lac"] = (
|
237 |
+
df_site_per_lac["code"].astype(str)
|
238 |
+
+ "_"
|
239 |
+
+ df_site_per_lac["locationAreaIdLAC"].astype(str)
|
240 |
+
)
|
241 |
+
df_site_per_lac = df_site_per_lac.drop_duplicates(subset=["code_lac"], keep="first")
|
242 |
+
|
243 |
GsmAnalysisData.total_number_of_bsc = len(gsm_df["BSC"].unique())
|
244 |
GsmAnalysisData.total_number_of_cell = len(gsm_df["ID_BTS"].unique())
|
245 |
GsmAnalysisData.number_of_site = len(gsm_df["site_name"].unique())
|
|
|
258 |
# .rename(columns={"index": "value", 0: "count"})
|
259 |
# )
|
260 |
|
261 |
+
######################################## Number of trx per bsc
|
262 |
GsmAnalysisData.number_of_trx_per_bsc = trx_df["BSC"].value_counts()
|
263 |
+
|
264 |
+
######################################## Number of cell per lac
|
265 |
GsmAnalysisData.number_of_cell_per_lac = (
|
266 |
gsm_df.groupby(["BSC", "locationAreaIdLAC"]).size().reset_index(name="count")
|
267 |
)
|
|
|
291 |
["BSC_NAME_ID", "LAC", "count"]
|
292 |
]
|
293 |
|
294 |
+
######################################## Number of site per LA
|
295 |
+
GsmAnalysisData.number_of_site_per_lac = (
|
296 |
+
df_site_per_lac.groupby(["BSC", "locationAreaIdLAC"])
|
297 |
+
.size()
|
298 |
+
.reset_index(name="count")
|
299 |
+
)
|
300 |
+
# Get BSC name
|
301 |
+
GsmAnalysisData.number_of_site_per_lac["BSC_NAME"] = (
|
302 |
+
GsmAnalysisData.number_of_site_per_lac["BSC"].map(UtilsVars.bsc_name).fillna("")
|
303 |
+
)
|
304 |
+
|
305 |
+
# Rename columns
|
306 |
+
GsmAnalysisData.number_of_site_per_lac.rename(
|
307 |
+
columns={"BSC": "BSC", "locationAreaIdLAC": "LAC", "count": "count"},
|
308 |
+
inplace=True,
|
309 |
+
)
|
310 |
+
# Add "BSC_" and "LAC_" prefix to LAC column
|
311 |
+
GsmAnalysisData.number_of_site_per_lac["LAC"] = (
|
312 |
+
"LAC_" + GsmAnalysisData.number_of_site_per_lac["LAC"].astype(str)
|
313 |
+
)
|
314 |
+
GsmAnalysisData.number_of_site_per_lac["BSC_NAME_ID"] = (
|
315 |
+
GsmAnalysisData.number_of_site_per_lac[["BSC_NAME", "BSC"]]
|
316 |
+
.astype(str)
|
317 |
+
.apply("_".join, axis=1)
|
318 |
+
)
|
319 |
+
GsmAnalysisData.number_of_site_per_lac = GsmAnalysisData.number_of_site_per_lac[
|
320 |
+
["BSC_NAME_ID", "LAC", "count"]
|
321 |
+
]
|
queries/process_wcdma.py
CHANGED
@@ -244,6 +244,12 @@ def wcdma_analaysis(
|
|
244 |
df_site_per_rnc = wcdma_df[["RNC", "code"]]
|
245 |
df_site_per_rnc = df_site_per_rnc.drop_duplicates(subset=["code"], keep="first")
|
246 |
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
WcdmaAnalysisData.total_number_of_rnc = wcdma_df["RNC"].nunique()
|
248 |
WcdmaAnalysisData.total_number_of_wcel = wcdma_df["ID_WCEL"].nunique()
|
249 |
WcdmaAnalysisData.number_of_site = len(wcdma_df["site_name"].unique())
|
@@ -273,3 +279,23 @@ def wcdma_analaysis(
|
|
273 |
WcdmaAnalysisData.number_of_cell_per_lac["LAC"] = (
|
274 |
"LAC_" + WcdmaAnalysisData.number_of_cell_per_lac["LAC"].astype(str)
|
275 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
df_site_per_rnc = wcdma_df[["RNC", "code"]]
|
245 |
df_site_per_rnc = df_site_per_rnc.drop_duplicates(subset=["code"], keep="first")
|
246 |
|
247 |
+
df_site_per_lac = wcdma_df[["RNC", "LAC", "code"]]
|
248 |
+
df_site_per_lac["code_lac"] = (
|
249 |
+
df_site_per_lac["code"].astype(str) + "_" + df_site_per_lac["LAC"].astype(str)
|
250 |
+
)
|
251 |
+
df_site_per_lac = df_site_per_lac.drop_duplicates(subset=["code_lac"], keep="first")
|
252 |
+
|
253 |
WcdmaAnalysisData.total_number_of_rnc = wcdma_df["RNC"].nunique()
|
254 |
WcdmaAnalysisData.total_number_of_wcel = wcdma_df["ID_WCEL"].nunique()
|
255 |
WcdmaAnalysisData.number_of_site = len(wcdma_df["site_name"].unique())
|
|
|
279 |
WcdmaAnalysisData.number_of_cell_per_lac["LAC"] = (
|
280 |
"LAC_" + WcdmaAnalysisData.number_of_cell_per_lac["LAC"].astype(str)
|
281 |
)
|
282 |
+
|
283 |
+
##################### Number of site per LAC
|
284 |
+
WcdmaAnalysisData.number_of_site_per_lac = (
|
285 |
+
df_site_per_lac.groupby(["RNC", "LAC"]).size().reset_index(name="count")
|
286 |
+
)
|
287 |
+
# Rename columns
|
288 |
+
WcdmaAnalysisData.number_of_site_per_lac = (
|
289 |
+
WcdmaAnalysisData.number_of_site_per_lac.rename(
|
290 |
+
columns={"RNC": "RNC", "LAC": "LAC", "count": "Site_Count"}
|
291 |
+
)
|
292 |
+
)
|
293 |
+
# Add "RNC_" and "LAC_" prefix
|
294 |
+
WcdmaAnalysisData.number_of_site_per_lac["RNC"] = (
|
295 |
+
"RNC_" + WcdmaAnalysisData.number_of_site_per_lac["RNC"].astype(str)
|
296 |
+
)
|
297 |
+
WcdmaAnalysisData.number_of_site_per_lac["LAC"] = (
|
298 |
+
"LAC_" + WcdmaAnalysisData.number_of_site_per_lac["LAC"].astype(str)
|
299 |
+
)
|
300 |
+
|
301 |
+
print(WcdmaAnalysisData.number_of_site_per_lac)
|
utils/utils_vars.py
CHANGED
@@ -138,6 +138,7 @@ class GsmAnalysisData:
|
|
138 |
trx_administate_distribution = pd.DataFrame()
|
139 |
number_of_trx_per_bsc = pd.DataFrame()
|
140 |
number_of_cell_per_lac = pd.DataFrame()
|
|
|
141 |
|
142 |
|
143 |
class WcdmaAnalysisData:
|
@@ -151,6 +152,7 @@ class WcdmaAnalysisData:
|
|
151 |
wcel_administate_distribution = pd.DataFrame()
|
152 |
psc_distribution = pd.DataFrame()
|
153 |
number_of_cell_per_lac = pd.DataFrame()
|
|
|
154 |
|
155 |
|
156 |
class LteFddAnalysisData:
|
|
|
138 |
trx_administate_distribution = pd.DataFrame()
|
139 |
number_of_trx_per_bsc = pd.DataFrame()
|
140 |
number_of_cell_per_lac = pd.DataFrame()
|
141 |
+
number_of_site_per_lac = pd.DataFrame()
|
142 |
|
143 |
|
144 |
class WcdmaAnalysisData:
|
|
|
152 |
wcel_administate_distribution = pd.DataFrame()
|
153 |
psc_distribution = pd.DataFrame()
|
154 |
number_of_cell_per_lac = pd.DataFrame()
|
155 |
+
number_of_site_per_lac = pd.DataFrame()
|
156 |
|
157 |
|
158 |
class LteFddAnalysisData:
|