Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin-telecom
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Paul Graydon
wendelin-telecom
Commits
e07f9119
Commit
e07f9119
authored
Apr 14, 2023
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ors_wendelin: load chunk data to calculate kpi
parent
6d8555e2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
10 deletions
+23
-10
bt5/ors_wendelin/PathTemplateItem/portal_callables/DataAnalysisLine_calculateKPI.py
...ateItem/portal_callables/DataAnalysisLine_calculateKPI.py
+23
-10
No files found.
bt5/ors_wendelin/PathTemplateItem/portal_callables/DataAnalysisLine_calculateKPI.py
View file @
e07f9119
import
numpy
as
np
import
numpy
as
np
from
DateTime
import
DateTime
progress_indicator
=
in_stream
[
"Progress Indicator"
]
progress_indicator
=
in_stream
[
"Progress Indicator"
]
in_data_stream
=
in_stream
[
"Data Stream"
]
in_data_stream
=
in_stream
[
"Data Stream"
]
start
=
progress_indicator
.
getIntOffsetIndex
()
start
=
progress_indicator
.
getIntOffsetIndex
()
end
=
in_data_stream
.
getSize
()
total_size
=
in_data_stream
.
getSize
()
if
start
>=
end
:
if
start
>=
total_size
:
return
return
chunk_size
=
1024
*
1024
if
start
+
chunk_size
>
total_size
:
end
=
total_size
else
:
end
=
start
+
chunk_size
chunk_data
=
""
.
join
(
in_data_stream
.
readChunkList
(
start
,
end
))
# last one maybe a not valide json
split_chunk_data
=
chunk_data
.
splitlines
()
if
len
(
split_chunk_data
)
<
2
:
return
chunk_data
=
'
\
n
'
.
join
(
split_chunk_data
[:
-
1
])
end
=
start
+
len
(
chunk_data
)
+
1
chunk_data
=
chunk_data
.
decode
(
'utf8'
)
e_rab_data_array
=
None
e_rab_data_array
=
None
e_utran_data_array
=
None
e_utran_data_array
=
None
...
@@ -17,8 +34,7 @@ for array in out_array:
...
@@ -17,8 +34,7 @@ for array in out_array:
if
array
[
'variation'
]
==
'e_utran'
:
if
array
[
'variation'
]
==
'e_utran'
:
e_utran_data_array
=
array
[
'Data Array'
]
e_utran_data_array
=
array
[
'Data Array'
]
data
=
in_data_stream
.
getData
().
decode
(
'utf8'
)
vt
,
vInititialEPSBEstabSR
,
vAddedEPSBEstabSR
,
evt
,
vIPThp_qci
=
context
.
Base_getORSKPIValue
(
chunk_data
)
vt
,
vInititialEPSBEstabSR
,
vAddedEPSBEstabSR
,
evt
,
vIPThp_qci
=
context
.
Base_getORSKPIValue
(
data
)
e_rab_dtype
=
np
.
dtype
([
e_rab_dtype
=
np
.
dtype
([
(
'vt'
,
'float'
),
(
'vt'
,
'float'
),
...
@@ -37,15 +53,13 @@ e_utran_dtype =np.dtype([
...
@@ -37,15 +53,13 @@ e_utran_dtype =np.dtype([
])
])
e_rab_array
=
e_rab_data_array
.
getArray
()
e_rab_array
=
e_rab_data_array
.
getArray
()
#XXXXXXXXXX initialise every time because of kpi calculation
if
not
e_rab_array
:
if
not
e_rab_array
or
True
:
e_rab_array
=
e_rab_data_array
.
initArray
(
shape
=
(
0
,),
dtype
=
e_rab_dtype
)
e_rab_array
=
e_rab_data_array
.
initArray
(
shape
=
(
0
,),
dtype
=
e_rab_dtype
)
e_rab_array_data
=
[]
e_rab_array_data
=
[]
e_utran_array
=
e_utran_data_array
.
getArray
()
e_utran_array
=
e_utran_data_array
.
getArray
()
#XXXXXXXXXX initialise every time because of kpi calculation
if
not
e_utran_array
:
if
not
e_utran_array
or
True
:
e_utran_array
=
e_utran_data_array
.
initArray
(
shape
=
(
0
,),
dtype
=
e_utran_dtype
)
e_utran_array
=
e_utran_data_array
.
initArray
(
shape
=
(
0
,),
dtype
=
e_utran_dtype
)
e_utran_array_data
=
[]
e_utran_array_data
=
[]
...
@@ -63,7 +77,6 @@ if e_utran_array_data:
...
@@ -63,7 +77,6 @@ if e_utran_array_data:
e_utran_array_data
=
np
.
ndarray
((
len
(
e_utran_array_data
),
),
e_utran_dtype
,
np
.
array
(
e_utran_array_data
))
e_utran_array_data
=
np
.
ndarray
((
len
(
e_utran_array_data
),
),
e_utran_dtype
,
np
.
array
(
e_utran_array_data
))
e_utran_array
.
append
(
e_utran_array_data
)
e_utran_array
.
append
(
e_utran_array_data
)
progress_indicator
.
setIntOffsetIndex
(
end
)
progress_indicator
.
setIntOffsetIndex
(
end
)
return
return
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment