Skip to content

Commit

Permalink
check services
Browse files Browse the repository at this point in the history
  • Loading branch information
ehinman committed Aug 20, 2024
1 parent 41b3270 commit c5839c1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dataretrieval/wqp.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
'narrowResult']
activity_profiles_legacy = ['activityAll']
services_wqx3 = ['Result', 'Station', 'Activity']
services_legacy = ['Organization', 'Project',
services_legacy = ['Result', 'Station', 'Activity',
'Organization', 'Project',
'ProjectMonitoringLocationWeighting',
'ActivityMetric',
'ResultDetectionQuantitationLimit',
Expand Down Expand Up @@ -507,11 +508,15 @@ def what_activity_metrics(ssl_check=True, **kwargs):

def wqp_url(service):
"""Construct the WQP URL for a given service."""
if service not in services_legacy:
raise TypeError('Legacy service not recognized')
base_url = 'https://www.waterqualitydata.us/data/'
return f'{base_url}{service}/Search?'

def wqx3_url(service):
"""Construct the WQP URL for a given WQX 3.0 service."""
if service not in services_wqx3:
raise TypeError('WQX3 service not recognized')
base_url = 'https://www.waterqualitydata.us/wqx3/'
return f'{base_url}{service}/search?'

Expand Down

0 comments on commit c5839c1

Please sign in to comment.