Default hourly() to poll_interval=1 and forward additional_kw to retrieve - #12
aklocker42 wants to merge 2 commits into
Conversation
…ieve hourly/monthly/yearly accepted `additional_kw...` but never forwarded it, so poll_interval, max_wait and verbose could not be overridden. Forward it, and default hourly() to poll_interval=1 (matching CDSAPI.jl's 1 s polling) since hourly requests are small; monthly/yearly keep 10. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
| max_wait = 3600, | ||
| poll_interval = 10, | ||
| verbose = true) | ||
| merge((; max_wait = 3600, poll_interval = 10, verbose = true), additional_kw)...) |
There was a problem hiding this comment.
this says poll_interval=10. Does that mean that the new poll interval being passed in is not respected? not sure I understand
There was a problem hiding this comment.
The 10 was only a default: it was merged under additional_kw, so a caller's poll_interval did override it. That was hard to see, so in a905053 it's now an explicit poll_interval=10 keyword on monthly and yearly, forwarded to retrieve, the same way hourly does it. The existing plumbing test covers both the default and the override.
There was a problem hiding this comment.
why would we have a different poll interval for hourly vs monthly/yearly?
There was a problem hiding this comment.
ok the description above says something
There was a problem hiding this comment.
retrieve backs off from 1 s toward the poll_interval ceiling. hourly requests are single-variable and usually finish within about a minute, so with the old ceiling of 10 the client could sit on an already-finished job for several seconds before the next poll — lowering the ceiling to 1 catches completion sooner, at the cost of a few extra HTTP status checks.
monthly/yearly requests bundle a full month/year of hourly data in one CDS job, so they queue and process for much longer. Polling every 1 s there would only add HTTP calls while the job is still running, without shortening the wait meaningfully — so I kept the 10 s ceiling. That's what "shorter interval only adds status calls" meant in the PR description; I reworded it there, it wasn't clear.
Replaces the `merge(...)` of defaults with `additional_kw` by a `poll_interval = 10` keyword forwarded to `retrieve`, matching `hourly`, and fixes the continuation-line alignment of the `retrieve` calls. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@aklocker42 what does this mean? |
|
|
|
I still don't understand. Isn't the total size of the fetched data determined by both the bbox and the time interval? The time interval alone does not determine the size of data fetched. |
|
You're right, that was imprecise — bbox affects data volume too, and |
Summary
hourly,monthlyandyearlyacceptedadditional_kw...but never forwarded it toretrieve, sopoll_interval,max_waitandverbosecould not be overridden. It is now forwarded.hourly()gets an explicitpoll_interval=1keyword (documented). This matches CDSAPI.jl, which polls every 1 s.monthly()andyearly()get an explicitpoll_interval=10keyword (documented), so their default is visible in the signature. This is unchanged, untested legacy behavior, not a size-based argument — we only benchmarked single-variablehourly()requests (table below);monthly()/yearly()atpoll_interval=1may well perform just as well, we just haven't measured it. Remaining kwargs (max_wait,verbose) are forwarded toretrieve.Why
Relates to #4 (CDSAPI.jl vs this package). Hourly requests are small and usually finish within a minute.
retrievebacks off from 1 s up topoll_interval, so with the old ceiling of 10 the client could sit on a finished job for several seconds before noticing.Paired timings against CDSAPI.jl are dominated by CDS queue time, with the same request ranging from 13.9 s to 101.9 s. The effect is real but hard to see statistically:
poll_interval=10vs 1The earlier runs at the old default of 10 were slower than CDSAPI.jl: 40.6 s vs 23.2 s and 48.9 s vs 23.2 s.
Tests
retrieveand checks the defaults and overrides reach it forhourly(1),monthly(10) andyearly(10).retrieveinside the module, so that testset has to stay last inruntests.jl.Pkg.test(): 36 of 36 pass, including the live ERA5 download test.🤖 Generated with Claude Code