From fb6521a1b5e27f511158b34c57aaf85bf4ab752d Mon Sep 17 00:00:00 2001 From: Elise Hinman <121896266+ehinman@users.noreply.github.com> Date: Mon, 29 Jan 2024 22:38:13 -0600 Subject: [PATCH] Add warning message to WQP functions and README (#132) Add warning about legacy WQP profiles --------- Co-authored-by: Timothy Hodson <34148978+thodson-usgs@users.noreply.github.com> --- README.md | 3 +++ dataretrieval/wqp.py | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/README.md b/README.md index a202649..8a5a733 100644 --- a/README.md +++ b/README.md @@ -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), diff --git a/dataretrieval/wqp.py b/dataretrieval/wqp.py index bd7d318..a352ef8 100644 --- a/dataretrieval/wqp.py +++ b/dataretrieval/wqp.py @@ -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) @@ -117,6 +119,8 @@ def what_sites(ssl_check=True, **kwargs): ... ) """ + _warn_v3_profiles_outage() + kwargs = _alter_kwargs(kwargs) url = wqp_url('Station') @@ -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') @@ -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') @@ -228,6 +236,8 @@ def what_activities(ssl_check=True, **kwargs): ... ) """ + _warn_v3_profiles_outage() + kwargs = _alter_kwargs(kwargs) url = wqp_url('Activity') @@ -271,6 +281,8 @@ def what_detection_limits(ssl_check=True, **kwargs): ... ) """ + _warn_v3_profiles_outage() + kwargs = _alter_kwargs(kwargs) url = wqp_url('ResultDetectionQuantitationLimit') @@ -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') @@ -346,6 +360,8 @@ def what_project_weights(ssl_check=True, **kwargs): ... ) """ + _warn_v3_profiles_outage() + kwargs = _alter_kwargs(kwargs) url = wqp_url('ProjectMonitoringLocationWeighting') @@ -385,6 +401,8 @@ def what_activity_metrics(ssl_check=True, **kwargs): ... ) """ + _warn_v3_profiles_outage() + kwargs = _alter_kwargs(kwargs) url = wqp_url('ActivityMetric') @@ -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.'))