You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: NEWS.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,6 @@
1
-
**05/14/2026:** Fixed two latent bugs in the paginated `waterdata` request loop (`_walk_pages` and `get_stats_data`). Previously, when `requests.Session.request(...)` itself raised mid-pagination (network error, timeout), the except block called `_error_body()` on the *prior page's* response, so the logged "error" described the wrong request and could itself crash on non-JSON bodies. Separately, no status-code check was performed on subsequent paginated responses, so a 5xx body that didn't include `numberReturned` was silently treated as an empty page — pagination quietly stopped and the user got truncated data with no error logged. The loop now status-checks each page like the initial request and reports the actual exception. The "best-effort" behavior (return whatever pages were collected) is preserved.
1
+
**05/17/2026:** The OGC `waterdata` getters (`get_daily`, `get_continuous`, `get_field_measurements`, and the rest of the multi-value-capable functions) now transparently chunk requests whose URLs would otherwise exceed the server's ~8 KB byte limit.
2
+
3
+
**05/16/2026:** Fixed silent truncation in the paginated `waterdata` request loops (`_walk_pages` and `get_stats_data`). Mid-pagination failures (HTTP 429, 5xx, network error) were previously swallowed — pagination would quietly stop and the function would return whatever rows it had collected, leaving callers with truncated DataFrames they had no way to detect. The loops now status-check every page like the initial request and raise `RuntimeError` on any failure, with the upstream exception chained as `__cause__` and a short menu of recovery actions (wait and retry, reduce the request, or obtain an API token) in the message. **Behavior change**: callers that previously consumed partial DataFrames on transient upstream blips will now see an exception; retry the call (possibly with a smaller `limit` or narrower query).
2
4
3
5
**05/07/2026:** Bumped the declared minimum Python version from **3.8** to **3.9** (`pyproject.toml`'s `requires-python` and the ruff target). This brings the manifest in line with what was already being tested — CI's matrix has long covered only 3.9, 3.13, and 3.14, the `waterdata` test module already skipped itself on Python < 3.10, and several modules already use 3.9-only stdlib (e.g. `zoneinfo`). Users on 3.8 will no longer be able to install the package; please upgrade.
4
6
@@ -36,4 +38,4 @@
36
38
37
39
**03/01/2024:** USGS data availability and format have changed on Water Quality Portal (WQP). Since March 2024, data obtained from WQP legacy profiles will not include new USGS data or recent updates to existing data. All USGS data (up to and beyond March 2024) are available using the new WQP beta services. You can access the beta services by setting `legacy=False` in the functions in the `wqp` module.
38
40
39
-
To view the status of changes in data availability and code functionality, visit: https://doi-usgs.github.io/dataRetrieval/articles/Status.html
41
+
To view the status of changes in data availability and code functionality, visit: https://doi-usgs.github.io/dataRetrieval/articles/Status.html
**02/24/2026** The `get_gwlevels`, `get_discharge_measurements` functions in the `nwis` module are defunct and have been replaced with the `get_field_measurements` function in the `waterdata` module. The `get_pmcodes` function in the `nwis` module has been replaced with the `get_reference_table(collection='parameter_code)` function. Finally, the `get_water_use` function in the `nwis` module is defunct with no current replacement.
10
-
11
-
:mega:**01/16/2026:**`dataretrieval` now features the `waterdata` module,
12
-
which provides access to USGS's modernized [Water Data
13
-
APIs](https://api.waterdata.usgs.gov/). The Water Data API endpoints include
14
-
daily values, instantaneous values, field measurements, time series metadata, statistics,
15
-
and discrete water quality data from the [Samples database](https://waterdata.usgs.gov/download-samples/#dataProfile=site). This new module replaces the `nwis` module, which provides access to the legacy [NWIS
16
-
Water Services](https://waterservices.usgs.gov/). Take a look at the new [`waterdata` module demo notebook](demos/WaterData_demo.ipynb), which walks through an extended example using a majority of the available `waterdata` functions.
17
-
18
-
Check out the [NEWS](NEWS.md) file for all updates and announcements.
19
-
20
-
**Important:** Users of the Water Data APIs are strongly encouraged to obtain an
21
-
API key for higher rate limits and greater access to USGS data. [Register for
22
-
an API key](https://api.waterdata.usgs.gov/signup/) and set it as an
23
-
environment variable:
24
-
25
-
```python
26
-
import os
27
-
os.environ["API_USGS_PAT"] ="your_api_key_here"
28
-
```
29
-
30
7
## What is dataretrieval?
31
8
32
9
`dataretrieval` simplifies the process of loading hydrologic data into Python.
@@ -36,6 +13,8 @@ U.S. Geological Survey (USGS) hydrology data types available on the Web, as well
36
13
as data from the Water Quality Portal (WQP) and Network Linked Data Index
37
14
(NLDI).
38
15
16
+
Check the [NEWS](NEWS.md) for all updates and announcements.
17
+
39
18
## Installation
40
19
41
20
Install dataretrieval using pip:
@@ -44,13 +23,13 @@ Install dataretrieval using pip:
44
23
pip install dataretrieval
45
24
```
46
25
47
-
Or using conda:
26
+
Or conda:
48
27
49
28
```bash
50
29
conda install -c conda-forge dataretrieval
51
30
```
52
31
53
-
To install the "main" branch directly from GitHub, use:
print(f"Found {len(df)} stream monitoring locations in Maryland")
105
93
```
106
-
Finally, retrieving continuous (a.k.a. "instantaneous") data
107
-
for one location. We *strongly advise* breaking up continuous data requests into smaller time periods and collections to avoid timeouts and other issues:
94
+
Finally, retrieve continuous (a.k.a. "instantaneous") data for one location.
95
+
We *strongly advise* breaking continuous data requests into smaller time
96
+
windows to avoid timeouts and other issues:
108
97
109
98
```python
110
99
# Get continuous data for a single monitoring location and water year
0 commit comments