Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
muma
TM
Commits
02b6f053
Commit
02b6f053
authored
7 years ago
by
Luca Scarabello
Browse files
Options
Downloads
Patches
Plain Diff
Improved failed template loading
parent
9b408e47
No related branches found
Branches containing commit
Tags
v0.6.3
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mpi/template_manager.py
+1
-0
1 addition, 0 deletions
mpi/template_manager.py
mpi/template_matching.py
+4
-16
4 additions, 16 deletions
mpi/template_matching.py
with
5 additions
and
16 deletions
mpi/template_manager.py
+
1
−
0
View file @
02b6f053
...
...
@@ -37,4 +37,5 @@ class TemplateManager(SequentialLoader):
def
set_unloadable
(
self
,
template
):
self
.
remove
(
template
)
del
self
.
map
[
template
]
This diff is collapsed.
Click to expand it.
mpi/template_matching.py
+
4
−
16
View file @
02b6f053
...
...
@@ -195,16 +195,6 @@ class TemplateMatching(object):
elif
os
.
path
.
isfile
(
errorchunks_file
):
os
.
remove
(
errorchunks_file
)
errortemplates_file
=
os
.
path
.
join
(
self
.
config
.
directory
,
'
errorTemplates.dat
'
)
if
self
.
failed_templates
:
def
failed_templates_to_row
(
template
):
return
{
'
Template
'
:
template
}
columns
=
[(
'
Template
'
,
0
)]
tmio
.
save_iter_to_file
(
self
.
failed_templates
,
errortemplates_file
,
failed_templates_to_row
,
columns
)
elif
os
.
path
.
isfile
(
errortemplates_file
):
os
.
remove
(
errortemplates_file
)
def
__user_info
(
self
):
"""
Inform user of the current status
...
...
@@ -280,11 +270,6 @@ class TemplateMatching(object):
# Stop the execution if we had problem loading templates
if
self
.
failed_templates
:
ftemplate
=
self
.
failed_templates
[
0
]
start
,
shift
,
mag
=
self
.
template_mngr
.
get_template
(
ftemplate
)
self
.
logger
.
error
(
"
Error: couldn
'
t load template for time
'
%s
'
. To continue either
"
"
delete/comment the event from catalog to exclude it or fix the
"
"
waveform archive so that the template can be loaded.
"
%
(
start
))
break
# We have finished, save last time
...
...
@@ -307,10 +292,13 @@ class TemplateMatching(object):
for
l
in
self
.
m_template_ldr
.
get_completed
():
template
,
error
=
self
.
m_template_ldr
.
get_data
(
l
)
if
error
:
start
,
shift
,
mag
=
self
.
template_mngr
.
get_template
(
template
)
self
.
logger
.
error
(
"
Error: couldn
'
t load template for time
'
%s
'
. To continue either
"
"
delete/comment the event from catalog to exclude it or fix the
"
"
waveform archive so that the template can be loaded.
"
%
(
start
))
self
.
template_mngr
.
set_unloadable
(
template
)
self
.
scanner_mngr
.
remove_template
(
template
)
# useful when continuing previous run
self
.
failed_templates
.
append
(
template
)
self
.
logger
.
warning
(
'
(Error) Loading template %d
'
%
(
template
)
)
else
:
self
.
template_mngr
.
set_loaded
(
template
)
self
.
scanner_mngr
.
add_template_to_process
(
template
)
...
...
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