Skip to content

Commit

Permalink
Add warning message to WQP functions and README (#132)
Browse files Browse the repository at this point in the history
Add warning about legacy WQP profiles
---------

Co-authored-by: Timothy Hodson <34148978+thodson-usgs@users.noreply.github.com>
  • Loading branch information
ehinman and thodson-usgs authored Jan 30, 2024
1 parent 0296432 commit fb6521a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# dataretrieval: Download hydrologic data

:warning: USGS data availability and format are changing on Water Quality Portal (WQP). Beginning in February 2024 data obtained from WQP legacy profiles will not include new USGS data or recent updates to existing data.
To view the status of changes in data availability and code functionality, visit: https://doi-usgs.github.io/dataRetrieval/articles/Status.html

## What is dataretrieval?
`dataretrieval` was created to simplify the process of loading hydrologic data into the Python environment.
Like the original R version [`dataRetrieval`](https://github.com/DOI-USGS/dataRetrieval),
Expand Down
32 changes: 32 additions & 0 deletions dataretrieval/wqp.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ def get_results(ssl_check=True, **kwargs):
>>> df, md = dataretrieval.wqp.get_results(bBox='-92.8,44.2,-88.9,46.0')
"""
_warn_v3_profiles_outage()

kwargs = _alter_kwargs(kwargs)
response = query(wqp_url('Result'), kwargs, delimiter=';', ssl_check=ssl_check)

Expand Down Expand Up @@ -117,6 +119,8 @@ def what_sites(ssl_check=True, **kwargs):
... )
"""
_warn_v3_profiles_outage()

kwargs = _alter_kwargs(kwargs)

url = wqp_url('Station')
Expand Down Expand Up @@ -153,6 +157,8 @@ def what_organizations(ssl_check=True, **kwargs):
>>> df, md = dataretrieval.wqp.what_organizations()
"""
_warn_v3_profiles_outage()

kwargs = _alter_kwargs(kwargs)

url = wqp_url('Organization')
Expand Down Expand Up @@ -189,6 +195,8 @@ def what_projects(ssl_check=True, **kwargs):
>>> df, md = dataretrieval.wqp.what_projects(huc='19')
"""
_warn_v3_profiles_outage()

kwargs = _alter_kwargs(kwargs)

url = wqp_url('Project')
Expand Down Expand Up @@ -228,6 +236,8 @@ def what_activities(ssl_check=True, **kwargs):
... )
"""
_warn_v3_profiles_outage()

kwargs = _alter_kwargs(kwargs)

url = wqp_url('Activity')
Expand Down Expand Up @@ -271,6 +281,8 @@ def what_detection_limits(ssl_check=True, **kwargs):
... )
"""
_warn_v3_profiles_outage()

kwargs = _alter_kwargs(kwargs)

url = wqp_url('ResultDetectionQuantitationLimit')
Expand Down Expand Up @@ -307,6 +319,8 @@ def what_habitat_metrics(ssl_check=True, **kwargs):
>>> df, md = dataretrieval.wqp.what_habitat_metrics(statecode='US:44')
"""
_warn_v3_profiles_outage()

kwargs = _alter_kwargs(kwargs)

url = wqp_url('BiologicalMetric')
Expand Down Expand Up @@ -346,6 +360,8 @@ def what_project_weights(ssl_check=True, **kwargs):
... )
"""
_warn_v3_profiles_outage()

kwargs = _alter_kwargs(kwargs)

url = wqp_url('ProjectMonitoringLocationWeighting')
Expand Down Expand Up @@ -385,6 +401,8 @@ def what_activity_metrics(ssl_check=True, **kwargs):
... )
"""
_warn_v3_profiles_outage()

kwargs = _alter_kwargs(kwargs)

url = wqp_url('ActivityMetric')
Expand Down Expand Up @@ -468,3 +486,17 @@ def _alter_kwargs(kwargs):
kwargs['mimeType'] = 'csv'

return kwargs

def _warn_v3_profiles_outage():
"""Private function for warning message about WQX 3.0 profiles
"""

warnings.warn(('NEWS: USGS discrete water quality data availability '
'and format are changing. Beginning in February 2024 '
'the data obtained from legacy profiles will not '
'include new USGS data or recent updates to existing '
'data. To view the status of changes in data '
'availability and code functionality, visit: '
'https://doi-usgs.github.io/dataRetrieval/articles/Status.html. '
'If you have additional questions about these changes, '
'email CompTools@usgs.gov.'))

0 comments on commit fb6521a

Please sign in to comment.