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
abde47b8
Commit
abde47b8
authored
5 years ago
by
lukas leufen
Browse files
Options
Downloads
Patches
Plain Diff
added test for helper function to_list
parent
20d2d659
No related branches found
No related tags found
2 merge requests
!9
new version v0.2.0
,
!8
data generator
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/join.py
+2
-2
2 additions, 2 deletions
src/join.py
test/test_helpers.py
+11
-0
11 additions, 0 deletions
test/test_helpers.py
with
13 additions
and
2 deletions
src/join.py
+
2
−
2
View file @
abde47b8
...
...
@@ -8,6 +8,7 @@ import logging
import
pandas
as
pd
import
datetime
as
dt
from
typing
import
Iterator
,
Union
,
List
from
src
import
helpers
join_url_base
=
'
https://join.fz-juelich.de/services/rest/surfacedata/
'
logging
.
basicConfig
(
level
=
logging
.
INFO
)
...
...
@@ -24,8 +25,7 @@ def download_join(station_name: Union[str, List[str]], statvar: dict) -> [pd.Dat
- meta - pandas df with all meta information
"""
# make sure station_name parameter is a list
if
not
isinstance
(
station_name
,
list
):
station_name
=
[
station_name
]
station_name
=
helpers
.
to_list
(
station_name
)
# load series information
opts
=
{
'
base
'
:
join_url_base
,
'
service
'
:
'
series
'
,
'
station_id
'
:
station_name
[
0
]}
...
...
This diff is collapsed.
Click to expand it.
test/test_helpers.py
0 → 100644
+
11
−
0
View file @
abde47b8
import
pytest
from
src.helpers
import
to_list
class
TestToList
:
def
test_to_list
(
self
):
assert
to_list
(
'
a
'
)
==
[
'
a
'
]
assert
to_list
(
'
abcd
'
)
==
[
'
abcd
'
]
assert
to_list
([
1
,
2
,
3
])
==
[
1
,
2
,
3
]
assert
to_list
([
45
])
==
[
45
]
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