Closed davidpirogov closed 2 years ago
Haaaa good catch! A classic human error ;-)
@davidpirogov would you feel like directly proposing a pull request for this? If so, please also include a unit-test to "fix the fix"
Thanks!!
@csparpa done!
Closed with #390
Fairly straightforward bug that fails in locations greater than plus-minus 90 degrees longitudinal, such as Melbourne, Australia (place id 2158177, 'lon': 144.9633, 'lat': -37.814)
The offending code is in the lines below: https://github.com/csparpa/pyowm/blob/0474b61cc67fa3c95f9e572b96d3248031828fce/pyowm/airpollutionapi30/airstatus.py#L91-L92
Simple fix to swap the dictionary keys so that the
lat
variable refers tofloat(the_dict['coord']['lat'])
and that thelon
variable refers tofloat(the_dict['coord']['lon'])