From f9cbe93fa10f62ba0ee0a8ca2bbbdab33e2376c9 Mon Sep 17 00:00:00 2001 From: Dominik Werder Date: Wed, 11 Dec 2024 16:58:56 +0100 Subject: [PATCH] Support to fix rounding for user output --- src/timebin.rs | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/src/timebin.rs b/src/timebin.rs index 9fa3b86..93fee48 100644 --- a/src/timebin.rs +++ b/src/timebin.rs @@ -12,37 +12,22 @@ use netpod::TsNano; use std::fmt; use std::ops::Range; -// TODO can probably be removed. -pub trait TimeBins { - fn ts_min(&self) -> Option; - fn ts_max(&self) -> Option; - fn ts_min_max(&self) -> Option<(u64, u64)>; -} - // TODO remove pub trait TimeBinnerTy: fmt::Debug + Send + Unpin { type Input: fmt::Debug; type Output: fmt::Debug; - fn ingest(&mut self, item: &mut Self::Input); - fn set_range_complete(&mut self); - fn bins_ready_count(&self) -> usize; - fn bins_ready(&mut self) -> Option; - /// If there is a bin in progress with non-zero count, push it to the result set. /// With push_empty == true, a bin in progress is pushed even if it contains no counts. fn push_in_progress(&mut self, push_empty: bool); - /// Implies `Self::push_in_progress` but in addition, pushes a zero-count bin if the call /// to `push_in_progress` did not change the result count, as long as edges are left. /// The next call to `Self::bins_ready_count` must return one higher count than before. fn cycle(&mut self); - fn empty(&self) -> Option; - fn append_empty_until_end(&mut self); } @@ -57,8 +42,6 @@ pub trait TimeBinnableTy: fmt::Debug + WithLen + Send + Sized { ) -> Self::TimeBinner; } -// #[derive(Debug, ThisError)] -// #[cstm(name = "Binninggg")] pub enum BinningggError { Dyn(Box), TypeMismatch { have: String, expect: String }, @@ -106,6 +89,7 @@ pub trait BinningggContainerEventsDyn: fn eq(&self, rhs: &dyn BinningggContainerEventsDyn) -> bool; fn as_mergeable_dyn_mut(&mut self) -> &mut dyn MergeableDyn; fn as_collectable_dyn_mut(&mut self) -> &mut dyn CollectableDyn; + fn to_f32_for_binning_v01(&self) -> Box; } pub trait BinningggContainerBinsDyn: @@ -125,6 +109,7 @@ pub trait BinningggContainerBinsDyn: range: BinnedRange, ) -> Box; fn boxed_into_collectable_box(self: Box) -> Box; + fn fix_numerics(&mut self); } pub type BinsBoxed = Box;