epoch_sample
Stable type · Prefetch and windows
Tier: stable · Kind: type · Topic: Prefetch and windows
| Python | Julia | Rust |
|---|---|---|
EpochSample | EpochSample | EpochSample |
Python
class EpochSample(Mapping)
EpochSample(epoch: int, time: _dt.datetime, samples: Dict[str, Sample])
EpochSample.__getitem__(key: str) -> Sample
EpochSample.__iter__() -> Iterator[str]
EpochSample.__len__() -> int
Every member’s Sample
for one epoch: ep["U"].data.
A read-only mapping keyed by member, plus epoch (the epoch index
k) and time (its start boundary B[k]).
Julia
struct EpochSample
EpochSample(epoch::Int64, time::Float64, samples::Dict{String, Sample})
EpochSample(epoch, time, samples)
EpochSample
What [take!](api:take!(::PrefetchGroup, ::Integer)) returns for one epoch: a
[Sample] per member, indexed by member key (ep["U"].data, ep["U"].anchor,
ep["U"].changed). epoch is the (1-based) epoch index and time its boundary
B[epoch]. Iterates as key => Sample pairs.
Rust
pub struct EpochSample<T> {
/* private fields */
}
impl<T> EpochSample<T> { pub fn epoch(&self) -> usize }
impl<T> EpochSample<T> { pub fn get(&self, key: &str) -> Option<&Sample<T>> }
impl<T> EpochSample<T> { pub fn iter(&self) -> impl Iterator<Item = (&str, &Sample<T>)> }
impl<T> EpochSample<T> { pub fn len(&self) -> usize }
impl<T> EpochSample<T> { pub fn is_empty(&self) -> bool }
impl<T> EpochSample<T> { pub fn into_samples(self) -> BTreeMap<String, Sample<T>> }
What PrefetchGroup::take returns: one Sample
per member key.