66
77from __future__ import annotations
88
9- from typing import TYPE_CHECKING , Literal , get_args
10-
11- import pandas as pd
129import warnings
10+ from typing import TYPE_CHECKING
1311
1412from dataretrieval .utils import BaseMetadata
1513
1614if TYPE_CHECKING :
1715 from typing import Optional , Tuple , Union
18- from dataretrieval . waterdata import SERVICES , PROFILES
16+
1917 from pandas import DataFrame
2018
19+ from dataretrieval .waterdata import PROFILES , SERVICES
20+
21+
2122def get_usgs_samples (
2223 ssl_check : bool = True ,
2324 service : SERVICES = "results" ,
@@ -111,7 +112,7 @@ def get_usgs_samples(
111112 A user supplied characteristic name describing one or more results.
112113 boundingBox: list of four floats, optional
113114 Filters on the the associated monitoring location's point location
114- by checking if it is located within the specified geographic area.
115+ by checking if it is located within the specified geographic area.
115116 The logic is inclusive, i.e. it will include locations that overlap
116117 with the edge of the bounding box. Values are separated by commas,
117118 expressed in decimal degrees, NAD83, and longitudes west of Greenwich
@@ -120,7 +121,7 @@ def get_usgs_samples(
120121 - Western-most longitude
121122 - Southern-most latitude
122123 - Eastern-most longitude
123- - Northern-most longitude
124+ - Northern-most longitude
124125 Example: [-92.8,44.2,-88.9,46.0]
125126 countryFips : string or list of strings, optional
126127 Example: "US" (United States)
@@ -143,7 +144,7 @@ def get_usgs_samples(
143144 usgsPCode : string or list of strings, optional
144145 5-digit number used in the US Geological Survey computerized
145146 data system, National Water Information System (NWIS), to
146- uniquely identify a specific constituent. Check the
147+ uniquely identify a specific constituent. Check the
147148 `characteristic_lookup()` function in this module for all possible
148149 inputs.
149150 Example: "00060" (Discharge, cubic feet per second)
@@ -173,7 +174,7 @@ def get_usgs_samples(
173174 recordIdentifierUserSupplied : string or list of strings, optional
174175 Internal AQS record identifier that returns 1 entry. Only available
175176 for the "results" service.
176-
177+
177178 Returns
178179 -------
179180 df : ``pandas.DataFrame``
@@ -187,8 +188,8 @@ def get_usgs_samples(
187188
188189 >>> # Get PFAS results within a bounding box
189190 >>> df, md = dataretrieval.samples.get_usgs_samples(
190- ... boundingBox=[-90.2,42.6,-88.7,43.2],
191- ... characteristicGroup="Organics, PFAS"
191+ ... boundingBox=[-90.2, 42.6, -88.7, 43.2],
192+ ... characteristicGroup="Organics, PFAS",
192193 ... )
193194
194195 >>> # Get all activities for the Commonwealth of Virginia over a date range
@@ -197,22 +198,31 @@ def get_usgs_samples(
197198 ... profile="sampact",
198199 ... activityStartDateLower="2023-10-01",
199200 ... activityStartDateUpper="2024-01-01",
200- ... stateFips="US:51")
201+ ... stateFips="US:51",
202+ ... )
201203
202204 >>> # Get all pH samples for two sites in Utah
203205 >>> df, md = dataretrieval.samples.get_usgs_samples(
204- ... monitoringLocationIdentifier=['USGS-393147111462301', 'USGS-393343111454101'],
205- ... usgsPCode='00400')
206+ ... monitoringLocationIdentifier=[
207+ ... "USGS-393147111462301",
208+ ... "USGS-393343111454101",
209+ ... ],
210+ ... usgsPCode="00400",
211+ ... )
206212
207213 """
208214
209215 warnings .warn (
210- "`get_usgs_samples` is deprecated and will be removed. Use `waterdata.get_samples` instead." ,
216+ (
217+ "`get_usgs_samples` is deprecated and will be removed. "
218+ "Use `waterdata.get_samples` instead."
219+ ),
211220 DeprecationWarning ,
212221 stacklevel = 2 ,
213222 )
214223
215224 from dataretrieval .waterdata import get_samples
225+
216226 result = get_samples (
217227 ssl_check = ssl_check ,
218228 service = service ,
@@ -242,5 +252,3 @@ def get_usgs_samples(
242252 )
243253
244254 return result
245-
246-
0 commit comments