Commit 6b1151f7 authored by Paul Graydon's avatar Paul Graydon

wendelin_telecom_base: Improve KPI calculation error handling

parent 71d02c8d
......@@ -7,13 +7,18 @@ def load_measurements(alogm):
try:
measurement = alogm.read()
while measurement is not None:
try:
mlog.append(measurement)
except AssertionError:
# Invalid measurement: simply skip it
pass
measurement = alogm.read()
finally:
alogm.close()
return mlog
def calc_periods(mlog, tperiod):
try:
t = mlog.data()[0]['X.Tstart']
for measurement in mlog.data()[1:]:
t_ = measurement['X.Tstart']
......@@ -21,6 +26,9 @@ def calc_periods(mlog, tperiod):
calc = kpi.Calc(mlog, t, t + tperiod)
t = calc.tau_hi
yield calc
except IndexError:
# No data to read: exit
return
def getOrsKpiValues(data):
fxlog = io.StringIO(data)
......
......@@ -37,12 +37,7 @@ for array in out_array:
if array['variation'] == 'e_utran':
e_utran_data_array = array['Data Array']
try:
vt, v_initial_epsb_estab_sr, v_added_epsb_estab_sr, evt, v_ip_throughput_qci = context.Base_getOrsKpiValues(log_data)
except AssertionError:
# If some data is invalid: ignore data chunk and move on rather than crashing
progress_indicator.setIntOffsetIndex(end)
return
vt, v_initial_epsb_estab_sr, v_added_epsb_estab_sr, evt, v_ip_throughput_qci = context.Base_getOrsKpiValues(log_data)
e_rab_dtype = np.dtype([
('vt', 'float'),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment