Coder Social home page Coder Social logo

sludgedesk / metoffer Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 10.0 36 KB

A simple Python wrapper for the API provided by the British Met Office known as DataPoint with additional tools for handling the returned data.

License: GNU General Public License v3.0

Python 100.00%
api-wrapper datapoint meteorology metoffice python weather

metoffer's People

Contributors

domdfcoding avatar pecnut avatar sludgedesk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

metoffer's Issues

pip install doesn't work any more

Since the update, "pip install"ing doesn't appear to work: The MetOffer-2.0.dist-info folder appears in site-packages, but the metoffer.py file doesn't.

Trouble installing metoffer

I am using windows and I cannot install the "metoffer". Do you have any suggestions?
I am getting this "No module named 'metoffer". I have tried pip install metoffer but it doesn't work for me.

Pythagoras' theorem wrongly implemented

The brackets are misplaced in Pythagoras' theorem in distance_to_coords:

The function distance_to_coords says

def distance_to_coords(self, lat_a, lon_a):
        self.distance = (abs(self.lat - lat_a) ** 2) + (abs(self.lon - lon_a) ** 2) ** .5

but of course should be

def distance_to_coords(self, lat_a, lon_a):
        self.distance = ((self.lat - lat_a) ** 2 + (self.lon - lon_a) ** 2) ** .5

Currently it's working out "a^2 + โˆšb^2" instead of "โˆš(a^2 + b^2)"

(I've also removed the abs commands which are of course not needed)

Weather method fail when downloading All sites

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.