Skip to content

Weather method fail when downloading All sites  #6

@fermumen

Description

@fermumen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions