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

Weather method fail when downloading All sites #6

Open
fermumen opened this issue Oct 21, 2021 · 0 comments
Open

Weather method fail when downloading All sites #6

fermumen opened this issue Oct 21, 2021 · 0 comments

Comments

@fermumen
Copy link

fermumen commented Oct 21, 2021

When downloading all sites in observations the resulting data is a list of sites.

M = metoffer.MetOffer(APIkey)
x = M.loc_observations(request = metoffer.ALL) # same as using 'all'
y = metoffer.Weather(x)
>> TypeError: list indices must be integers or slices, not str

This bit of code on the init method is failing because Location is a list of dictionaries.

returned_data["SiteRep"]["DV"]["Location"]["i"]
>> Error
returned_data["SiteRep"]["DV"]["Location"][0]["i"]
>> Works
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

1 participant