sample_at
Stable function · Prefetch and windows
Tier: stable · Kind: function · Topic: Prefetch and windows
| Python | Julia | Rust |
|---|---|---|
| not exported | sample_at | not exported |
Python
Python does not export this function.
Julia
sample_at(p::Provider, t::Real)
sample_at(p::Provider)
sample_at(p::Provider, t::Real) -> NativeDataset
sample_at(p::Provider) -> NativeDataset
The dataset refresh(p, t) returns — data variables AND coordinates, with the same
snap-down to the cadence anchor, the same file-local record, the same
records_per_sample = 2 bracket and the same end-of-data rules — and it raises
what refresh(p, t) raises (spec/prefetch.md §1). It depends on t only through
the anchor t snaps to, so two times in one cadence interval give equal samples.
The no-argument form is a [CONST] provider’s [materialize](p).
It is safe to call from several threads at once on one provider, which is what
[PrefetchGroup] does. In the Python and Rust tracks sample_at is new because
their refresh updates a decoded-file buffer; the Julia [Provider] holds no
buffer at all (immutable, decoding per sample with its records pushdown), so
here it is the same function as [materialize], under the name the cross-track
contract gives it. The shared state it does touch is thread-safe: the cache takes
a per-blob lock to fill a miss, and every NetCDF-C access is serialised by one
process-wide lock.
Rust
Rust does not export this function.