Skip to content

Commit

Permalink
Airnow bug (#805)
Browse files Browse the repository at this point in the history
* ENH: Bug fix for set_xrng

* BUG: Bug fix for airnow API call
  • Loading branch information
AdamTheisen authored Feb 28, 2024
1 parent 8594886 commit 065c642
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions act/discovery/airnow.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_airnow_forecast(token, date, zipcode=None, latlon=None, distance=25):
"""

# default beginning of the query url
query_url = 'https://airnowapi.org/aq/forecast/'
query_url = 'https://www.airnowapi.org/aq/forecast/'

# checking is either a zipcode or latlon coordinate is defined
# if neither is defined then error is raised
Expand All @@ -47,7 +47,7 @@ def get_airnow_forecast(token, date, zipcode=None, latlon=None, distance=25):

if zipcode:
url = query_url + (
'zipcode/?'
'zipCode/?'
+ 'format=text/csv'
+ '&zipCode='
+ str(zipcode)
Expand Down Expand Up @@ -75,6 +75,7 @@ def get_airnow_forecast(token, date, zipcode=None, latlon=None, distance=25):
+ str(token)
)

print(url)
df = pd.read_csv(url)

# converting to xarray dataset object
Expand Down

0 comments on commit 065c642

Please sign in to comment.