adding Analysis for site database
Browse files- apps/dump_analysis.py +62 -3
- queries/process_site_db.py +39 -25
- utils/utils_vars.py +12 -0
apps/dump_analysis.py
CHANGED
|
@@ -9,18 +9,77 @@ from utils.utils_vars import (
|
|
| 9 |
GsmAnalysisData,
|
| 10 |
LteFddAnalysisData,
|
| 11 |
LteTddAnalysisData,
|
|
|
|
| 12 |
WcdmaAnalysisData,
|
| 13 |
)
|
| 14 |
|
| 15 |
-
":red[**L2300 Parameters:**]"
|
| 16 |
-
|
| 17 |
|
| 18 |
def dump_analysis_space():
|
| 19 |
|
| 20 |
st.title("ANALYTICS DATA")
|
| 21 |
|
| 22 |
-
#######################
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
st.subheader(":blue[GSM ANALYTICS DATA]")
|
| 25 |
|
| 26 |
(
|
|
|
|
| 9 |
GsmAnalysisData,
|
| 10 |
LteFddAnalysisData,
|
| 11 |
LteTddAnalysisData,
|
| 12 |
+
SiteAnalysisData,
|
| 13 |
WcdmaAnalysisData,
|
| 14 |
)
|
| 15 |
|
|
|
|
|
|
|
| 16 |
|
| 17 |
def dump_analysis_space():
|
| 18 |
|
| 19 |
st.title("ANALYTICS DATA")
|
| 20 |
|
| 21 |
+
####################### SITE ANALYTICS DATA #######################################
|
| 22 |
+
|
| 23 |
+
st.subheader(":violet[SITE ANALYTICS DATA]")
|
| 24 |
+
|
| 25 |
+
(
|
| 26 |
+
total_number_of_site_col,
|
| 27 |
+
total_munber_of_gsm_site_col,
|
| 28 |
+
total_munber_of_wcdma_site_col,
|
| 29 |
+
total_munber_of_lte_site_col,
|
| 30 |
+
) = st.columns((1, 1, 1, 1))
|
| 31 |
+
with total_number_of_site_col:
|
| 32 |
+
st.metric("Number of Site", SiteAnalysisData.total_number_of_site)
|
| 33 |
+
with total_munber_of_gsm_site_col:
|
| 34 |
+
st.metric("Number of GSM Site", SiteAnalysisData.total_munber_of_gsm_site)
|
| 35 |
+
with total_munber_of_wcdma_site_col:
|
| 36 |
+
st.metric("Number of WCDMA Site", SiteAnalysisData.total_number_of_wcdma_site)
|
| 37 |
+
with total_munber_of_lte_site_col:
|
| 38 |
+
st.metric("Number of LTE Site", SiteAnalysisData.total_number_of_lte_site)
|
| 39 |
+
|
| 40 |
+
st.markdown("***")
|
| 41 |
+
st.markdown(":violet[**Gsm Bands Distribution**]")
|
| 42 |
+
gsm_distribution_data_col, gsm_distribution_plot_col = st.columns(2)
|
| 43 |
+
with gsm_distribution_data_col:
|
| 44 |
+
st.write(SiteAnalysisData.gsm_bands_distribution)
|
| 45 |
+
with gsm_distribution_plot_col:
|
| 46 |
+
st.bar_chart(SiteAnalysisData.gsm_bands_distribution, horizontal=True)
|
| 47 |
+
|
| 48 |
+
st.markdown("***")
|
| 49 |
+
st.markdown(":violet[**Wcdma Bands Distribution**]")
|
| 50 |
+
wcdma_distribution_data_col, wcdma_distribution_plot_col = st.columns(2)
|
| 51 |
+
with wcdma_distribution_data_col:
|
| 52 |
+
st.write(SiteAnalysisData.wcdma_bands_distribution)
|
| 53 |
+
with wcdma_distribution_plot_col:
|
| 54 |
+
st.bar_chart(SiteAnalysisData.wcdma_bands_distribution, horizontal=True)
|
| 55 |
|
| 56 |
+
st.markdown("***")
|
| 57 |
+
st.markdown(":violet[**Lte Bands Distribution**]")
|
| 58 |
+
lte_distribution_data_col, lte_distribution_plot_col = st.columns(2)
|
| 59 |
+
with lte_distribution_data_col:
|
| 60 |
+
st.write(SiteAnalysisData.lte_bands_distribution)
|
| 61 |
+
with lte_distribution_plot_col:
|
| 62 |
+
st.bar_chart(SiteAnalysisData.lte_bands_distribution, horizontal=True)
|
| 63 |
+
|
| 64 |
+
st.markdown("***")
|
| 65 |
+
st.markdown(":violet[**All Bands Distribution**]")
|
| 66 |
+
all_bands_distribution_data_col, all_bands_distribution_plot_col = st.columns(2)
|
| 67 |
+
with all_bands_distribution_data_col:
|
| 68 |
+
st.write(SiteAnalysisData.all_bands_distribution)
|
| 69 |
+
with all_bands_distribution_plot_col:
|
| 70 |
+
st.bar_chart(SiteAnalysisData.all_bands_distribution)
|
| 71 |
+
|
| 72 |
+
st.markdown("***")
|
| 73 |
+
st.markdown(":violet[**Number of Trx per Site Distribution**]")
|
| 74 |
+
(
|
| 75 |
+
number_of_trx_per_site_distribution_data_col,
|
| 76 |
+
number_of_trx_per_site_distribution_plot_col,
|
| 77 |
+
) = st.columns(2)
|
| 78 |
+
with number_of_trx_per_site_distribution_data_col:
|
| 79 |
+
st.write(SiteAnalysisData.number_of_trx_per_site_distribution)
|
| 80 |
+
with number_of_trx_per_site_distribution_plot_col:
|
| 81 |
+
st.bar_chart(SiteAnalysisData.number_of_trx_per_site_distribution)
|
| 82 |
+
####################### GSM ANALYTICS DATA #######################################
|
| 83 |
st.subheader(":blue[GSM ANALYTICS DATA]")
|
| 84 |
|
| 85 |
(
|
queries/process_site_db.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
| 1 |
import pandas as pd
|
| 2 |
|
| 3 |
-
from utils.utils_vars import UtilsVars
|
| 4 |
|
| 5 |
GSM_COLUMNS = [
|
| 6 |
"code",
|
| 7 |
"site_name",
|
| 8 |
"site_config_band",
|
|
|
|
| 9 |
"number_trx_per_site",
|
| 10 |
"Longitude",
|
| 11 |
"Latitude",
|
|
@@ -15,6 +16,7 @@ GSM_COLUMNS = [
|
|
| 15 |
WCDMA_COLUMNS = [
|
| 16 |
"code",
|
| 17 |
"site_name",
|
|
|
|
| 18 |
"site_config_band",
|
| 19 |
"Longitude",
|
| 20 |
"Latitude",
|
|
@@ -24,6 +26,15 @@ LTE_COLUMNS = [
|
|
| 24 |
"code",
|
| 25 |
"lnbts_name",
|
| 26 |
"site_config_band",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
"Longitude",
|
| 28 |
"Latitude",
|
| 29 |
"Hauteur",
|
|
@@ -81,33 +92,13 @@ def site_db():
|
|
| 81 |
################################# CODE DATAFRAME#############################
|
| 82 |
|
| 83 |
gsm_code_df: pd.DataFrame = (
|
| 84 |
-
gsm_df[
|
| 85 |
-
[
|
| 86 |
-
"code",
|
| 87 |
-
"Longitude",
|
| 88 |
-
"Latitude",
|
| 89 |
-
"Hauteur",
|
| 90 |
-
]
|
| 91 |
-
].copy()
|
| 92 |
-
if gsm_df is not None
|
| 93 |
-
else pd.DataFrame()
|
| 94 |
)
|
| 95 |
wcdma_code_df: pd.DataFrame = (
|
| 96 |
-
wcdma_df[
|
| 97 |
-
if wcdma_df is not None
|
| 98 |
-
else pd.DataFrame()
|
| 99 |
)
|
| 100 |
lte_code_df: pd.DataFrame = (
|
| 101 |
-
lte_df[
|
| 102 |
-
[
|
| 103 |
-
"code",
|
| 104 |
-
"Longitude",
|
| 105 |
-
"Latitude",
|
| 106 |
-
"Hauteur",
|
| 107 |
-
]
|
| 108 |
-
].copy()
|
| 109 |
-
if lte_df is not None
|
| 110 |
-
else pd.DataFrame()
|
| 111 |
)
|
| 112 |
|
| 113 |
code_df: pd.DataFrame = pd.concat(
|
|
@@ -150,6 +141,7 @@ def site_db():
|
|
| 150 |
[
|
| 151 |
"code",
|
| 152 |
"site_name",
|
|
|
|
| 153 |
"2G_Bands",
|
| 154 |
"3G_Bands",
|
| 155 |
"4G_Bands",
|
|
@@ -164,5 +156,27 @@ def site_db():
|
|
| 164 |
site_df.sort_values(by=["code"], inplace=True)
|
| 165 |
|
| 166 |
UtilsVars.all_db_dfs.append(site_df)
|
|
|
|
| 167 |
|
| 168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import pandas as pd
|
| 2 |
|
| 3 |
+
from utils.utils_vars import SiteAnalysisData, UtilsVars
|
| 4 |
|
| 5 |
GSM_COLUMNS = [
|
| 6 |
"code",
|
| 7 |
"site_name",
|
| 8 |
"site_config_band",
|
| 9 |
+
"Region",
|
| 10 |
"number_trx_per_site",
|
| 11 |
"Longitude",
|
| 12 |
"Latitude",
|
|
|
|
| 16 |
WCDMA_COLUMNS = [
|
| 17 |
"code",
|
| 18 |
"site_name",
|
| 19 |
+
"Region",
|
| 20 |
"site_config_band",
|
| 21 |
"Longitude",
|
| 22 |
"Latitude",
|
|
|
|
| 26 |
"code",
|
| 27 |
"lnbts_name",
|
| 28 |
"site_config_band",
|
| 29 |
+
"Region",
|
| 30 |
+
"Longitude",
|
| 31 |
+
"Latitude",
|
| 32 |
+
"Hauteur",
|
| 33 |
+
]
|
| 34 |
+
|
| 35 |
+
CODE_COLUMNS = [
|
| 36 |
+
"code",
|
| 37 |
+
"Region",
|
| 38 |
"Longitude",
|
| 39 |
"Latitude",
|
| 40 |
"Hauteur",
|
|
|
|
| 92 |
################################# CODE DATAFRAME#############################
|
| 93 |
|
| 94 |
gsm_code_df: pd.DataFrame = (
|
| 95 |
+
gsm_df[CODE_COLUMNS].copy() if gsm_df is not None else pd.DataFrame()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
)
|
| 97 |
wcdma_code_df: pd.DataFrame = (
|
| 98 |
+
wcdma_df[CODE_COLUMNS].copy() if wcdma_df is not None else pd.DataFrame()
|
|
|
|
|
|
|
| 99 |
)
|
| 100 |
lte_code_df: pd.DataFrame = (
|
| 101 |
+
lte_df[CODE_COLUMNS].copy() if lte_df is not None else pd.DataFrame()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
)
|
| 103 |
|
| 104 |
code_df: pd.DataFrame = pd.concat(
|
|
|
|
| 141 |
[
|
| 142 |
"code",
|
| 143 |
"site_name",
|
| 144 |
+
"Region",
|
| 145 |
"2G_Bands",
|
| 146 |
"3G_Bands",
|
| 147 |
"4G_Bands",
|
|
|
|
| 156 |
site_df.sort_values(by=["code"], inplace=True)
|
| 157 |
|
| 158 |
UtilsVars.all_db_dfs.append(site_df)
|
| 159 |
+
UtilsVars.all_db_dfs_names.append("SITE")
|
| 160 |
|
| 161 |
+
####################### SITE ANALYSIS ###################################################
|
| 162 |
+
|
| 163 |
+
SiteAnalysisData.total_number_of_site = len(site_df["code"].unique())
|
| 164 |
+
SiteAnalysisData.total_munber_of_gsm_site = site_df["2G_Bands"].notna().sum()
|
| 165 |
+
SiteAnalysisData.total_number_of_wcdma_site = site_df["3G_Bands"].notna().sum()
|
| 166 |
+
SiteAnalysisData.total_number_of_lte_site = site_df["4G_Bands"].notna().sum()
|
| 167 |
+
|
| 168 |
+
SiteAnalysisData.gsm_bands_distribution = site_df["2G_Bands"].value_counts(
|
| 169 |
+
ascending=True
|
| 170 |
+
)
|
| 171 |
+
SiteAnalysisData.wcdma_bands_distribution = site_df["3G_Bands"].value_counts(
|
| 172 |
+
ascending=True
|
| 173 |
+
)
|
| 174 |
+
SiteAnalysisData.lte_bands_distribution = site_df["4G_Bands"].value_counts(
|
| 175 |
+
ascending=True
|
| 176 |
+
)
|
| 177 |
+
SiteAnalysisData.all_bands_distribution = site_df["all_bands"].value_counts(
|
| 178 |
+
ascending=True
|
| 179 |
+
)
|
| 180 |
+
SiteAnalysisData.number_of_trx_per_site_distribution = site_df[
|
| 181 |
+
"number_trx_per_site"
|
| 182 |
+
].value_counts()
|
utils/utils_vars.py
CHANGED
|
@@ -180,3 +180,15 @@ class LteTddAnalysisData:
|
|
| 180 |
rootsequenceindex_distribution = pd.DataFrame()
|
| 181 |
lncel_administate_distribution = pd.DataFrame()
|
| 182 |
number_of_cell_per_tac = pd.DataFrame()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
rootsequenceindex_distribution = pd.DataFrame()
|
| 181 |
lncel_administate_distribution = pd.DataFrame()
|
| 182 |
number_of_cell_per_tac = pd.DataFrame()
|
| 183 |
+
|
| 184 |
+
|
| 185 |
+
class SiteAnalysisData:
|
| 186 |
+
total_number_of_site = 0
|
| 187 |
+
total_munber_of_gsm_site = 0
|
| 188 |
+
total_number_of_wcdma_site = 0
|
| 189 |
+
total_number_of_lte_site = 0
|
| 190 |
+
gsm_bands_distribution = pd.DataFrame()
|
| 191 |
+
wcdma_bands_distribution = pd.DataFrame()
|
| 192 |
+
lte_bands_distribution = pd.DataFrame()
|
| 193 |
+
all_bands_distribution = pd.DataFrame()
|
| 194 |
+
number_of_trx_per_site_distribution = pd.DataFrame()
|