-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add command line interface #55
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a look on the changes. Thanks for your effort to implement the client function. Please take a look at my comments, mostly covering some small things I've noticed.
DWDOrigColumns.UPM.value: DWDColumns.UPM.value, | ||
DWDOrigColumns.TXK.value: DWDColumns.TXK.value, | ||
DWDOrigColumns.TNK.value: DWDColumns.TNK.value, | ||
DWDOrigColumns.TGK.value: DWDColumns.TGK.value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! Can you take care of the other parameters (1_minute, 10_minutes,...) as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! Maybe we can discuss the direction where this should go within #54 a bit more (I would also like to ask @wetterfrosch to join us there) and I will do that with a later contribution? I just wanted to give you an idea about that and to have at least something of value for the first steps into the CLI thing.
When diving back in here, I would like to add meaningful column names for all resolutions. However, there are some issues to resolve before, like #58 and a different one for ingesting hourly data I will add through a different PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's ok for me until we get the feature for every data at some later point. Would you mind adding on option to keep the original names? This way there'd still be an option to get the "original" data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind adding on option to keep the original names?
I've added an option humanize_column_names
to the collect_dwd_data
method as outlined within #54 (comment).
649a705
to
2d2cd77
Compare
Dear Benjamin, thanks for your suggestions, I've adjusted the PR accordingly at some spots. Please let me know whether this needs more work for the initial merge. Also, please note that this is currently heading towards the Cheers, |
Please redirect the PR to master, as it as of now includes all the recent changes! |
I don't know what is going on here, but these adjustments made it work for me on Python 3.8.0
Hi Benjamin,
I have just done so. However, I recognized that the specific feature to acquire data across the {historical,recent} data sets like outlined through
does not work based on the current master branch. Saying that, I am 100% sure it worked on top of the Currently, invoking that command croaks with
I've just investigated a few commits from the named branch and found 0f1faa7 to be probably the one which is missing in order to make PeriodType sortable. With kind regards, |
Re-added on behalf of you through #62. When using that,
works flawlessly again. |
8bd1f39
to
d2ebabb
Compare
This avoids poisoning STDOUT with log messages which really should go to STDERR. In turn, this makes room for real output on STDOUT originating from the upcoming CLI module.
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.
This adds an entrypoint program "dwd" which can be used to explore the features of this library on the command line.
Thanks for merging this! |
Dear Benjamin and Daniel,
as outlined within #50, we wanted to start bringing the features of this library to the command line similar to what users have been accustomed with dwdweather2.
Thanks again for the ongoing efforts you are putting into this library. Being able to acquire data across historical+recent data sets using the new
DWDStationRequest.collect_data()
method without having to assemble them manually in any way is really powerful.While we haven't tested any other combinations of parameters other than those listed within the examples section of
dwd --help
yet, you might want to merge these updates right away when pulling in thestationdata-request-definition
branch to master. Saying that, there might well be some fixups required in this matter to remedy quirks with more parameter combinations.Cheers,
Andreas.