-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use meaningful column names, starting with daily climate summary data
From "column_name_mapping.py" and "column_names_enumeration.py", we are seeing the intention to map meteorological short identifiers to more meaningful English long names. This complements the current implementation by providing appropriate mappings for daily climate summary data (kl) and also adds an appropriate test case for that. While being on it, we discovered that "_parse_dwd_data" as well as "collect_dwd_data" somehow wouldn't actually account for column names to be propagated, so we adjusted some spots on data frame handling. Trivia: - The test case has been marked as "remote" to be able to tell unit tests based on fixtures and full integration tests apart. - When massaging the data frame after parsing data from CSV, the "EOR" column gets dropped right away as it actually has no real value on downstream processing.
- Loading branch information
Showing
6 changed files
with
106 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[pytest] | ||
|
||
markers = | ||
remote: Tests accessing the internet. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import pytest | ||
|
||
from python_dwd import collect_dwd_data | ||
from python_dwd.enumerations.parameter_enumeration import Parameter | ||
from python_dwd.enumerations.period_type_enumeration import PeriodType | ||
from python_dwd.enumerations.time_resolution_enumeration import TimeResolution | ||
|
||
|
||
@pytest.mark.remote | ||
def test_fetch_and_parse_dwd_data(): | ||
data = collect_dwd_data( | ||
station_ids=[1048], | ||
parameter=Parameter.CLIMATE_SUMMARY, | ||
time_resolution=TimeResolution.DAILY, | ||
period_type=PeriodType.RECENT, | ||
) | ||
|
||
assert list(data.columns.values) == [ | ||
'STATION_ID', | ||
'DATE', | ||
'QN_3', | ||
'WIND_GUST_MAX', | ||
'WIND_VELOCITY', | ||
'QN_4', | ||
'PRECIPITATION_HEIGHT', | ||
'PRECIPITATION_FORM', | ||
'SUNSHINE_DURATION', | ||
'SNOW_DEPTH', | ||
'CLOUD_COVER', | ||
'VAPOR_PRESSURE', | ||
'PRESSURE', | ||
'TEMPERATURE', | ||
'HUMIDITY', | ||
'TEMPERATURE_MAX_200', | ||
'TEMPERATURE_MIN_200', | ||
'TEMPERATURE_MIN_005', | ||
] |