Skip to content
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

Library usage example is wrong #15

Closed
Lukas-Kullmann opened this issue Sep 30, 2019 · 3 comments
Closed

Library usage example is wrong #15

Lukas-Kullmann opened this issue Sep 30, 2019 · 3 comments

Comments

@Lukas-Kullmann
Copy link

The library usage example is wrong. It lacks the required parameter resolution is missing and the hour parameter of query was renamed.
It should be the following:

from datetime import datetime
from dwdweather import DwdWeather

# Create client object.
- dw = DwdWeather()
+ DW = DwdWeather(resolution="hourly") 

# Find closest station to position.
closest = dw.nearest_station(lon=7.0, lat=51.0)

# The hour you're interested in.
# The example is 2014-03-22 12:00 (UTC).
query_hour = datetime(2014, 3, 22, 12)

- result = dw.query(station_id=closest["station_id"], hour=query_hour) 
+ result = dw.query(closest["station_id"], query_hour)
print(result)

Took me several hours to figure that out. :/

@amotl amotl closed this as completed in 6c68d14 Sep 30, 2019
@amotl
Copy link
Member

amotl commented Sep 30, 2019

Dear Lukas,

thanks for writing in and sorry for the hassle. We just fixed the usage example within README.rst.

With kind regards,
Andreas.

@Lukas-Kullmann
Copy link
Author

That was fast, thank you! 🙂

@amotl
Copy link
Member

amotl commented Oct 1, 2019

Thanks again for bringing that up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants