Repository navigation
With Codex 5.6 - rate limits, and backoff, user cache instead of requesting all details upfront, best estimation of paging chunk size - #16
Conversation
- pybomwater/bom_water.py:60
- BomWater now accepts rate-limit, timeout, retry, and sample-size settings.
- Uses a persistent requests.Session with a versioned User-Agent.
- Adds request throttling, timeouts, exponential backoff, Retry-After support, and retries for HTTP 429/5xx.
- Cache lookup now prefers the user cache, then falls back to bundled package cache files.
- Cache initialization downloads only whichever files are missing.
- Chunk-size estimation now samples short time windows across the requested range, extrapolates their counts, and falls back to the previous feature-sampling approach on errors.
- values_count() now counts measurements across all observation blocks rather than only the first.
- pybomwater/cache/waterML_GetCapabilities.json
- New untracked, valid JSON capabilities cache, approximately 195 KB.
- Intended to allow startup without downloading capabilities immediately.
- pyproject.toml:8 and setup.py:41
- Package cache/*.json files in both wheels and source distributions.
### Test changes
- test/test_core.py:113
- Adds tests for bounded sampling windows, long-range sampling, counting multiple observation blocks, and sample-based chunk sizing.
- pytest.ini
- Registers a live_bom pytest marker.
- test/conftest.py
- Marks known live BoM integration tests and skips them by default.
- They run only when PYBOMWATER_RUN_LIVE=1.
- README.md:35
- Documents how to run the live integration tests.
|
@fre171csiro as discussed this is a local branch now and implements progressively load testing and notebook tests (all of which are passing) |
|
A deterministic comparison uses 40 stations, daily Water Course Discharge,
The warm query therefore downloads 753,048 fewer bytes, a 4.38% reduction. Cold construction has a much larger effect. On an empty user cache, This feature branch also changes how transient load is handled. In the fixed
Production defaults space requests by at least one second and retry connection Fallback behaviour further limits unnecessary API access:
Overall, thisfeature branch should place less byte and peak-response load on |
|
I have checked out your branch locally and successfully ran the all tests, also checked out the notebook repo and updated the dependencies to use your pybomwater branch. Ran all notebooks with success! Nothing that I think you have done already. Thank you for this Ben, great to have your contribution and I am sure it will improve the usability, smoothing out the issues with requests to the BoM api |
Improves on and replaces fork pull request #15
pybomwater/bom_water.py:60 - BomWater now accepts rate-limit, timeout, retry, and sample-size settings. - Uses a persistent requests.Session with a versioned User-Agent. - Adds request throttling, timeouts, exponential backoff, Retry-After support, and retries for HTTP 429/5xx. - Cache lookup now prefers the user cache, then falls back to bundled package cache files. - Cache initialization downloads only whichever files are missing. - Chunk-size estimation now samples short time windows across the requested range, extrapolates their counts, and falls back to the previous feature-sampling approach on errors. - values_count() now counts measurements across all observation blocks rather than only the first.
pybomwater/cache/waterML_GetCapabilities.json
New untracked, valid JSON capabilities cache, approximately 195 KB.
Intended to allow startup without downloading capabilities immediately.
pyproject.toml:8 and setup.py:41 - Package cache/*.json files in both wheels and source distributions.
Test changes
test/test_core.py:113
Adds tests for bounded sampling windows, long-range sampling, counting multiple observation blocks, and sample-based chunk sizing.
pytest.ini - Registers a live_bom pytest marker.
test/conftest.py
Marks known live BoM integration tests and skips them by default.
They run only when PYBOMWATER_RUN_LIVE=1.
README.md:35 - Documents how to run the live integration tests.
Tests are included for progressive load testing up to 20 years across 40 gauges and optionally running notebooks