Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MLAir
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
esde
machine-learning
MLAir
Commits
45c07a95
Commit
45c07a95
authored
4 years ago
by
Felix Kleinert
Browse files
Options
Downloads
Patches
Plain Diff
include error traceback
parent
186f32f3
No related branches found
No related tags found
1 merge request
!259
Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler"
Pipeline
#63939
passed
4 years ago
Stage: test
Stage: docs
Stage: pages
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mlair/run_modules/pre_processing.py
+14
-2
14 additions, 2 deletions
mlair/run_modules/pre_processing.py
with
14 additions
and
2 deletions
mlair/run_modules/pre_processing.py
+
14
−
2
View file @
45c07a95
...
...
@@ -9,6 +9,7 @@ from typing import Tuple
import
multiprocessing
import
requests
import
psutil
import
traceback
import
numpy
as
np
import
pandas
as
pd
...
...
@@ -79,7 +80,10 @@ class PreProcessing(RunEnvironment):
logging
.
debug
(
f
"
Number of training stations:
{
n_train
}
"
)
logging
.
debug
(
f
"
Number of val stations:
{
n_val
}
"
)
logging
.
debug
(
f
"
Number of test stations:
{
n_test
}
"
)
self
.
create_latex_report
()
try
:
self
.
create_latex_report
()
except
Exception
as
e
:
logging
.
warning
(
f
"
Can
'
t create latex report:
{
e
}
"
)
def
create_latex_report
(
self
):
"""
...
...
@@ -336,6 +340,14 @@ def f_proc(data_handler, station, name_affix, store, **kwargs):
try
:
res
=
data_handler
.
build
(
station
,
name_affix
=
name_affix
,
store_processed_data
=
store
,
**
kwargs
)
except
(
AttributeError
,
EmptyQueryResult
,
KeyError
,
requests
.
ConnectionError
,
ValueError
)
as
e
:
logging
.
info
(
f
"
remove station
{
station
}
because it raised an error:
{
e
}
"
)
formatted_lines
=
traceback
.
format_exc
().
splitlines
()
logging
.
info
(
f
"
remove station
{
station
}
because it raised an error:
{
e
}
->
{
'
|
'
.
join
(
f_inspect_error
(
formatted_lines
))
}
"
)
res
=
None
return
res
,
station
def
f_inspect_error
(
formatted
):
for
i
in
range
(
len
(
formatted
)
-
1
,
-
1
,
-
1
):
if
"
mlair/mlair
"
not
in
formatted
[
i
]:
return
formatted
[
i
-
3
:
i
]
return
formatted
[
-
3
:
0
]
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