csparpa / pyowm

A Python wrapper around the OpenWeatherMap web API
https://pyowm.readthedocs.io
MIT License
791 stars 175 forks source link

Docs pages need updated #336

Closed Twoody closed 4 years ago

Twoody commented 4 years ago

See: https://pyowm.readthedocs.io/en/latest/v3/air-pollution-api-usage-examples.html#querying-co-index

The code reads:

owm = OWM('apikey')

# Get latest CO Index on geocoordinates
coi = owm.coindex_around_coords(lat, lon)

, but it should read:

owm = OWM('apikey')
airpollution = owm.airpollution_manager()

# Get latest CO Index on geocoordinates
coi = owm.coindex_around_coords(lat, lon)

I'm unsure if other instances of this exist, but feel like something similar to the weather in the cookbook would be a good idea to show that an airpollution class exists, too.

EDIT: Another piece of code that doesn't work, but is referenced: timeutils.yesterday()

Twoody commented 4 years ago

To further this, a comment explaining lat and lon are needed as floats, would be nice too. Geopy returns the latitude and longitude via strings when calling raw, so I suspect most people will just enter those. Even better, a working example of actual latitude and longitude floats, true and tested, would be spectacular.

Twoody commented 4 years ago

If I can get pointed to the docs, I would be happy to put in some PRs.

csparpa commented 4 years ago

Hi @Twoody thanks a lot for pointing this out. Yes, the docs are still in "transition" mode as I've basically not touched much of the v2 codebase when working on v3 but forgot to update docs in many parts, therefore your effort is super-precious! you can find the docs in this folder, feel free to update any typos/errors you might encounter: https://www.github.com/csparpa/pyowm/tree/master/sphinx%2Fv3