@@ -304,7 +304,7 @@ def get_nearest_forecast_site(self, latitude, longitude):
304304 float (longitude ),
305305 float (latitude ))
306306
307- if ((distance == None ) or (new_distance < distance )):
307+ if ((distance is None ) or (new_distance < distance )):
308308 distance = new_distance
309309 nearest = site
310310
@@ -325,15 +325,15 @@ def get_forecast_for_site(self, site_id, frequency="daily"):
325325 A frequency of "3hourly" will return 8 timesteps:
326326 0, 180, 360 ... 1260 (minutes since midnight UTC)
327327 """
328- data = self .__call_api (site_id , {"res" :frequency })
328+ data = self .__call_api (site_id , {"res" : frequency })
329329 params = data ['SiteRep' ]['Wx' ]['Param' ]
330- forecast = Forecast ()
330+ forecast = Forecast (frequency = frequency )
331331
332332 # If the 'Location' key is missing, there is no data for the site,
333333 # raise an error.
334334 if 'Location' not in data ['SiteRep' ]['DV' ]:
335335 err_string = ('DataPoint has not returned any data for the'
336- 'requested site.' )
336+ 'requested site.' )
337337 raise APIException (err_string )
338338
339339 # Check if the other keys we need are in the data returned from the
@@ -456,7 +456,6 @@ def get_forecast_for_site(self, site_id, frequency="daily"):
456456
457457 return forecast
458458
459-
460459 def get_observation_sites (self ):
461460 """
462461 This function returns a list of Site objects for which observations are available.
@@ -528,7 +527,7 @@ def get_observations_for_site(self, site_id, frequency='hourly'):
528527 Returns hourly observations for the previous 24 hours
529528 """
530529
531- data = self .__call_api (site_id ,{"res" :frequency }, OBSERVATION_URL )
530+ data = self .__call_api (site_id ,{"res" : frequency }, OBSERVATION_URL )
532531
533532 params = data ['SiteRep' ]['Wx' ]['Param' ]
534533 observation = Observation ()
0 commit comments