DavMelchi commited on
Commit
3632bfd
·
1 Parent(s): c005a67

add gsm capacity docs

Browse files
Files changed (2) hide show
  1. app.py +4 -0
  2. documentations/gsm_capacity_docs.py +154 -0
app.py CHANGED
@@ -150,6 +150,10 @@ if check_password():
150
  st.Page(
151
  "documentations/core_dump_doc.py", title="📗Dump core Documentation"
152
  ),
 
 
 
 
153
  ],
154
  }
155
 
 
150
  st.Page(
151
  "documentations/core_dump_doc.py", title="📗Dump core Documentation"
152
  ),
153
+ st.Page(
154
+ "documentations/gsm_capacity_docs.py",
155
+ title="📘GSM Capacity Documentation",
156
+ ),
157
  ],
158
  }
159
 
documentations/gsm_capacity_docs.py ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ st.markdown(
4
+ """
5
+ # GSM Capacity Analysis Documentation
6
+
7
+ """
8
+ """
9
+ This documentation provides a technical and practical reference for the GSM Capacity Analysis application, detailing input/output columns, processing workflow, and key metrics as implemented in:
10
+ - apps/kpi_analysis/gsm_capacity.py
11
+ - process_kpi/process_gsm_capacity.py
12
+ - utils/kpi_analysis_utils.py
13
+
14
+ ---
15
+
16
+ ## 1. Input Files and Expected Columns
17
+
18
+ ### a. Dump File (XLSB)
19
+ - Contains network configuration and hardware data.
20
+ - Parsed columns (see `GSM_COLUMNS`, `TRX_COLUMNS` in `process_gsm_capacity.py`):
21
+ - ID_BTS, site_name, name, BSC, BCF, BTS, code, Region, adminState, frequencyBandInUse, amrSegLoadDepTchRateLower, amrSegLoadDepTchRateUpper, dedicatedGPRScapacity, defaultGPRScapacity, cellId, band, site_config_band, trxRfPower, BCCH, number_trx_per_cell, number_trx_per_bcf, TRX_TCH, MAL_TCH
22
+ - TRX-related: number_tch_per_cell, number_sd_per_cell, number_bcch_per_cell, number_ccch_per_cell, number_cbc_per_cell, number_total_channels_per_cell, number_signals_per_cell
23
+
24
+ ### b. Daily KPI Report (CSV)
25
+ - Columns (see `KPI_COLUMNS`):
26
+ - date, BTS_name, TCH_availability_ratio, 2G_Carried_Traffic, TCH_call_blocking, TCH_ABIS_FAIL_CALL_c001084, SDCCH_real_blocking
27
+
28
+ ### c. Busy Hour (BH) KPI Report (CSV)
29
+ - Same structure as Daily KPI, focused on peak hour data.
30
+
31
+ ---
32
+
33
+ ## 2. Output Columns and Their Meaning
34
+
35
+ ### a. Busy Hour (BH) Analysis Output (`BH_COLUMNS_FOR_CAPACITY`):
36
+ - Max_Traffic BH: Maximum traffic during busy hour in the analysis window
37
+ - Avg_Traffic BH: Average traffic during busy hour
38
+ - max_tch_call_blocking_bh: Max TCH call blocking during BH
39
+ - avg_tch_call_blocking_bh: Average TCH call blocking during BH
40
+ - number_of_days_with_tch_blocking_exceeded_bh: Days with TCH blocking above threshold
41
+ - max_sdcch_real_blocking_bh: Max SDCCH blocking during BH
42
+ - avg_sdcch_real_blocking_bh: Average SDCCH blocking during BH
43
+ - number_of_days_with_sdcch_blocking_exceeded_bh: Days with SDCCH blocking above threshold
44
+ - tch_call_blocking_bh_comment: Comments on TCH blocking
45
+ - sdcch_real_blocking_bh_comment: Comments on SDCCH blocking
46
+
47
+ ### b. Daily KPI Analysis Output (`DAILY_COLUMNS_FOR_CAPACITY`):
48
+ - Average_cell_availability: Mean cell availability over period
49
+ - number_of_days_exceeding_threshold: Days exceeding availability threshold
50
+ - availability_comment: Comments on availability
51
+ - avg_tch_abis_fail_daily: Average TCH ABIS fails per day
52
+ - max_tch_abis_fail_daily: Max TCH ABIS fails per day
53
+ - number_of_days_with_tch_abis_fail_exceeded_daily: Days with TCH ABIS fails above threshold
54
+ - tch_abis_fail_daily_comment: Comments on TCH ABIS fails
55
+
56
+ ### c. GSM Database Output (from dump parsing):
57
+ - All columns from GSM_COLUMNS and TRX_COLUMNS
58
+ - hf_rate_coef: Coefficient mapped from amrSegLoadDepTchRateLower
59
+ - GPRS: Calculated as (dedicatedGPRScapacity * number_tch_per_cell) / 100
60
+ - TCH Actual HR%: number_tch_per_cell * hf_rate_coef
61
+ - Offered Traffic BH: Mapped from TCH Actual HR% using ErlangB table
62
+
63
+ ---
64
+
65
+ ## 3. Processing Workflow
66
+
67
+ 1. **Validation**: Checks file format, data completeness, and consistency.
68
+ 2. **Parsing**: Extracts relevant columns and normalizes data.
69
+ 3. **Analysis**:
70
+ - **Busy Hour Analysis**: Computes traffic and blocking metrics for peak hours.
71
+ - **Daily Analysis**: Tracks availability, blocking, and failure metrics per day.
72
+ - **Capacity Estimation**: Uses traffic and configuration data to estimate TRX/channel requirements.
73
+ 4. **Comments Generation**: Flags and annotates cells/sites where metrics exceed thresholds.
74
+ 5. **Reporting**: Combines results into DataFrames for export/visualization.
75
+
76
+ ---
77
+
78
+ ## 4. Utility Functions (from `kpi_analysis_utils.py`)
79
+
80
+ - `create_dfs_per_kpi(df, ...)`: Pivots and prepares KPI-specific DataFrames.
81
+ - `cell_availability_analysis(df, days, threshold)`: Analyzes and comments on cell availability.
82
+ - `analyze_tch_abis_fails`, `analyze_tch_call_blocking`, `analyze_sdcch_call_blocking`: Analyze blocking/failure metrics and flag threshold exceedances.
83
+ - `combine_comments(df, ...)`: Combines multiple comment columns into one.
84
+
85
+ ---
86
+
87
+ ## 5. Example Usage
88
+
89
+ ```python
90
+ from process_kpi.process_gsm_capacity import analyze_gsm_data
91
+
92
+ # Example call
93
+ results = analyze_gsm_data(
94
+ dump_path, daily_report_path, bh_report_path,
95
+ number_of_kpi_days=7, number_of_threshold_days=3,
96
+ availability_threshold=95, tch_abis_fails_threshold=10,
97
+ sdcch_blocking_threshold=0.5, tch_blocking_threshold=0.5,
98
+ max_traffic_threshold=80,
99
+ )
100
+ # results: [gsm_db_df, daily_kpi_df, bh_kpi_df]
101
+ ```
102
+
103
+ ---
104
+
105
+ ## 6. Column Reference Table (Expanded)
106
+
107
+ | Column Name | Description |
108
+ |---------------------------------------------|------------------------------------------------------------------|
109
+ | number_trx_per_cell | Number of TRXs (transceivers) configured per cell. Extracted from network dump. |
110
+ | number_trx_per_bcf | Number of TRXs per BCF (Base Control Function). From dump. |
111
+ | number_tch_per_cell | Number of Traffic Channels (TCH) per cell. Calculated from config.|
112
+ | number_sd_per_cell | Number of Standalone Dedicated Control Channels per cell. From config.|
113
+ | number_bcch_per_cell | Number of Broadcast Control Channels per cell. From config. |
114
+ | number_ccch_per_cell | Number of Common Control Channels per cell. From config. |
115
+ | number_cbc_per_cell | Number of Cell Broadcast Channels per cell. From config. |
116
+ | number_total_channels_per_cell | Total channels (sum of all logical channels) per cell. |
117
+ | number_signals_per_cell | Total signaling channels per cell. From config. |
118
+ | hf_rate_coef | Half-rate coefficient mapped from `amrSegLoadDepTchRateLower` using a lookup table (see `GsmAnalysis.hf_rate_coef`). |
119
+ | GPRS | Calculated as `(dedicatedGPRScapacity * number_tch_per_cell) / 100`. Represents estimated GPRS capacity. |
120
+ | TCH Actual HR% | Calculated as `number_tch_per_cell * hf_rate_coef`. Represents the effective TCHs considering half-rate usage. |
121
+ | Offered Traffic BH | Estimated offered traffic (in Erlangs) during busy hour, mapped from `TCH Actual HR%` using ErlangB table (`GsmAnalysis.erlangB_table`). |
122
+ | Max_Traffic BH | Maximum traffic observed during busy hour in the analysis window. Computed from BH KPI data. |
123
+ | Avg_Traffic BH | Average traffic during busy hour over the analysis period. |
124
+ | max_tch_call_blocking_bh | Maximum TCH call blocking ratio during busy hour. |
125
+ | avg_tch_call_blocking_bh | Average TCH call blocking ratio during busy hour. |
126
+ | number_of_days_with_tch_blocking_exceeded_bh | Number of days TCH call blocking exceeded the set threshold during BH. |
127
+ | max_sdcch_real_blocking_bh | Maximum SDCCH real blocking ratio during busy hour. |
128
+ | avg_sdcch_real_blocking_bh | Average SDCCH real blocking ratio during busy hour. |
129
+ | number_of_days_with_sdcch_blocking_exceeded_bh | Number of days SDCCH blocking exceeded threshold during BH. |
130
+ | tch_call_blocking_bh_comment | Generated comment if TCH blocking exceeds threshold in BH. |
131
+ | sdcch_real_blocking_bh_comment | Generated comment if SDCCH blocking exceeds threshold in BH. |
132
+ | Average_cell_availability | Mean cell availability over the analysis period. |
133
+ | number_of_days_exceeding_threshold | Number of days cell/site availability fell below threshold. |
134
+ | availability_comment | Generated comment on site/cell availability status. |
135
+ | avg_tch_abis_fail_daily | Average daily TCH ABIS fails. |
136
+ | max_tch_abis_fail_daily | Maximum daily TCH ABIS fails. |
137
+ | number_of_days_with_tch_abis_fail_exceeded_daily | Number of days TCH ABIS fails exceeded threshold. |
138
+ | tch_abis_fail_daily_comment | Generated comment if TCH ABIS fails exceed threshold. |
139
+ | TCH UTILIZATION (@Max Traffic) | TCH utilization at maximum observed traffic. Calculated as (Max_Traffic BH / TCH Actual HR%) * 100%. |
140
+ | Tch utilization comments | Comments generated based on TCH utilization (e.g., if utilization is high or exceeds limits). |
141
+ | BH Congestion status | Status flag/comment if congestion detected during busy hour (based on blocking/utilization thresholds). |
142
+ | ErlabngB_value | Value from Erlang B table for required channels and blocking probability. Used for dimensioning. |
143
+ | Target FR CHs | Calculated target number of Full Rate channels needed. |
144
+ | Target HR CHs | Calculated target number of Half Rate channels needed. |
145
+ | Target TCHs | Total target Traffic Channels (FR + HR) required for desired performance. |
146
+ | Target TRXs | Target number of TRXs required, based on channel requirements and configuration. |
147
+ | Numberof required TRXs | Final computed number of TRXs required to meet traffic and blocking targets. |
148
+ | operational_comment | Generated operational comment based on analysis (e.g., upgrade needed, OK, etc.). |
149
+ | Final comment | Final summary comment combining all relevant flags, operational status, and recommendations. |
150
+
151
+ ---
152
+
153
+ """
154
+ )