Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SOHViewer
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Public
PASSOFT
SOHViewer
Commits
f6c0cf2f
Commit
f6c0cf2f
authored
1 year ago
by
Lan Dam
Browse files
Options
Downloads
Patches
Plain Diff
report and skip if can't read a file in RT130
parent
a41506c6
No related branches found
No related tags found
1 merge request
!130
report and skip if can't read a file in RT130
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sohstationviewer/model/reftek/reftek.py
+17
-4
17 additions, 4 deletions
sohstationviewer/model/reftek/reftek.py
with
17 additions
and
4 deletions
sohstationviewer/model/reftek/reftek.py
+
17
−
4
View file @
f6c0cf2f
...
...
@@ -4,7 +4,7 @@ RT130 object to hold and process RefTek data
import
os
from
pathlib
import
Path
from
typing
import
Tuple
,
List
,
Union
import
traceback
import
numpy
as
np
from
sohstationviewer.model.reftek.from_rt2ms
import
(
...
...
@@ -89,8 +89,15 @@ class RT130(DataTypeModel):
path2file
=
Path
(
path
).
joinpath
(
file_name
)
if
not
validate_file
(
path2file
,
file_name
):
continue
if
not
self
.
read_reftek_130
(
path2file
):
read_text
(
path2file
,
file_name
,
self
.
log_data
[
'
TEXT
'
])
try
:
if
not
self
.
read_reftek_130
(
path2file
):
read_text
(
path2file
,
self
.
log_data
[
'
TEXT
'
])
except
Exception
:
fmt
=
traceback
.
format_exc
()
self
.
track_info
(
f
"
Skip file
{
path2file
}
can
'
t be read
"
f
"
due to error:
{
str
(
fmt
)
}
"
,
LogType
.
WARNING
)
count
+=
1
if
count
%
50
==
0
:
self
.
track_info
(
...
...
@@ -133,7 +140,13 @@ class RT130(DataTypeModel):
:param path2file: absolute path to file
"""
rt130
=
core
.
Reftek130
.
from_file
(
path2file
)
try
:
rt130
=
core
.
Reftek130
.
from_file
(
path2file
)
except
Exception
:
fmt
=
traceback
.
format_exc
()
self
.
track_info
(
f
"
Skip file
{
path2file
}
can
'
t be read
"
f
"
due to error:
{
str
(
fmt
)
}
"
,
LogType
.
WARNING
)
return
unique
,
counts
=
np
.
unique
(
rt130
.
_data
[
"
packet_type
"
],
return_counts
=
True
)
nbr_packet_type
=
dict
(
zip
(
unique
,
counts
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment