Skip to content

Commit

Permalink
fix weather api wind parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
mpiannucci committed May 9, 2021
1 parent 4510894 commit 53d622b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup

setup(name='surfpy',
version='0.97.0',
version='0.97.1',
description='Wave and weather tools written in pure python',
url='https://github.com/mpiannucci/surfpy',
author='Matthew Iannucci',
Expand Down
6 changes: 3 additions & 3 deletions surfpy/weatherapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def parse_weather_forecast(forecast_data: dict) -> List[BuoyData]:
buoy_data_point.air_temperature = int(period['temperature'])
buoy_data_point.short_forecast = period['shortForecast']
buoy_data_point.wind_speed = int(period['windSpeed'].split(' ')[0])
buoy_data_point.wind_direction = period['windDirection']
buoy_data_point.wind_compass_direction = units.direction_to_degree(buoy_data_point.wind_direction)
buoy_data_point.wind_compass_direction = period['windDirection']
buoy_data_point.wind_direction = units.direction_to_degree(buoy_data_point.wind_compass_direction)
buoy_data.append(buoy_data_point)

return buoy_data
Expand All @@ -77,4 +77,4 @@ def fetch_hourly_forecast_from_metadata(meta: dict) -> List[BuoyData]:
return []

raw_hourly = WeatherApi.hourly_forecast(meta['gridId'], meta['gridX'], meta['gridY'])
return WeatherApi.parse_weather_forecast(raw_hourly)
return WeatherApi.parse_weather_forecast(raw_hourly)

0 comments on commit 53d622b

Please sign in to comment.