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
43dbbb95
Commit
43dbbb95
authored
5 years ago
by
lukas leufen
Browse files
Options
Downloads
Patches
Plain Diff
fixed test
parent
77e6b8da
No related branches found
No related tags found
3 merge requests
!90
WIP: new release update
,
!89
Resolve "release branch / CI on gpu"
,
!61
Resolve "REFAC: clean-up bootstrap workflow"
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/run_modules/pre_processing.py
+2
-1
2 additions, 1 deletion
src/run_modules/pre_processing.py
test/test_modules/test_pre_processing.py
+5
-3
5 additions, 3 deletions
test/test_modules/test_pre_processing.py
with
7 additions
and
4 deletions
src/run_modules/pre_processing.py
+
2
−
1
View file @
43dbbb95
...
...
@@ -125,11 +125,12 @@ class PreProcessing(RunEnvironment):
:param kwargs: positional parameters for the DataGenerator class (e.g. `start`, `interpolate_method`,
`window_lead_time`).
:param all_stations: All stations to check.
:param name: name to display in the logging info message
:return: Corrected list containing only valid station IDs.
"""
t_outer
=
TimeTracking
()
t_inner
=
TimeTracking
(
start
=
False
)
logging
.
info
(
f
"
check valid stations started
{
'
(%s)
'
%
name
if
name
else
name
}
"
)
logging
.
info
(
f
"
check valid stations started
{
'
(%s)
'
%
name
if
name
else
''
}
"
)
valid_stations
=
[]
# all required arguments of the DataGenerator can be found in args, positional arguments in args and kwargs
...
...
This diff is collapsed.
Click to expand it.
test/test_modules/test_pre_processing.py
+
5
−
3
View file @
43dbbb95
...
...
@@ -81,16 +81,18 @@ class TestPreProcessing:
data_store
.
get
(
"
generator
"
,
"
general
"
)
assert
data_store
.
get
(
"
stations
"
,
"
general.awesome
"
)
==
[
'
DEBW107
'
,
'
DEBY081
'
,
'
DEBW013
'
,
'
DEBW076
'
,
'
DEBW087
'
]
def
test_check_valid_stations
(
self
,
caplog
,
obj_with_exp_setup
):
@pytest.mark.parametrize
(
"
name
"
,
(
None
,
"
tester
"
))
def
test_check_valid_stations
(
self
,
caplog
,
obj_with_exp_setup
,
name
):
pre
=
obj_with_exp_setup
caplog
.
set_level
(
logging
.
INFO
)
args
=
pre
.
data_store
.
create_args_dict
(
DEFAULT_ARGS_LIST
)
kwargs
=
pre
.
data_store
.
create_args_dict
(
DEFAULT_KWARGS_LIST
)
stations
=
pre
.
data_store
.
get
(
"
stations
"
,
"
general
"
)
valid_stations
=
pre
.
check_valid_stations
(
args
,
kwargs
,
stations
)
valid_stations
=
pre
.
check_valid_stations
(
args
,
kwargs
,
stations
,
name
=
name
)
assert
len
(
valid_stations
)
<
len
(
stations
)
assert
valid_stations
==
stations
[:
-
1
]
assert
caplog
.
record_tuples
[
0
]
==
(
'
root
'
,
20
,
'
check valid stations started
'
)
expected
=
'
check valid stations started (tester)
'
if
name
else
'
check valid stations started
'
assert
caplog
.
record_tuples
[
0
]
==
(
'
root
'
,
20
,
expected
)
assert
caplog
.
record_tuples
[
-
1
]
==
(
'
root
'
,
20
,
PyTestRegex
(
r
'
run for \d+:\d+:\d+ \(hh:mm:ss\) to check 6
'
r
'
station\(s\). Found 5/6 valid stations.
'
))
...
...
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