Detrous/darksky

unexpected keyword argument 'units'

Closed this issue · 2 comments

"Get started" instructions no longer work (nor do my existing programs using this code):

root@e8bf857ed40c:/workspace/src/weather/weatherWHAT# pip3 install darksky_weather
root@e8bf857ed40c:/workspace/src/weather/weatherWHAT# python3
Python 3.7.4 (default, Aug 13 2019, 20:35:49)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.

from darksky.api import DarkSky, DarkSkyAsync
from darksky.types import languages, units, weather

API_KEY = 'xxxxxxxx'
darksky = DarkSky(API_KEY)
latitude = 42.3601
longitude = -71.0589
forecast = darksky.get_forecast(
... latitude, longitude,
... extend=False, # default False
... lang=languages.ENGLISH, # default ENGLISH
... units=units.AUTO, # default auto
... exclude=[weather.MINUTELY, weather.ALERTS], # default [],
... timezone='UTC' # default None - will be set by DarkSky API automatically
... )
Traceback (most recent call last):
File "", line 7, in
TypeError: get_forecast() got an unexpected keyword argument 'units'

I see that if I change the argument name in the above code to
value_units instead of units, it works.