fix(data): remove MinMaxPyramid::reduce, repoint its two test callers
The pyramid's public query surface is the bucket-grained trio (reduce_buckets/sum_buckets/sumsq_buckets); reduce() was the one non-*_buckets query and silently over-covered non-aligned ranges, which is exactly the misuse the exactness split exists to prevent. Exact range queries stay on Series. - delete the declaration, its doc paragraph and the definition; no helper became dead (fold_range/cover_buckets/ceil_to_bucket are all still used by the *_buckets queries) - pyramid_clear_and_rebuild: complete bucket 0 and assert its extrema via reduce_buckets(0, kBucket) -- a pyramid has no exact sub-bucket query - stream_series_acquire_publishes_snapshot: s.pyramid().reduce(0, 100) -> s.reduce(0, 100), keeping the == 99.0 assertion
This commit is contained in:
1 parent
d9909f2115
commit
5f1a4991e2
4 files changed
+8
-19
No files matched your search
@@ -103,7 +103,13 @@ PLOT_TEST(pyramid_clear_and_rebuild) {
|
||||
PLOT_CHECK(p.level_count() <= 1);
|
||||
p.append(7.0f);
|
||||
PLOT_CHECK(p.size() == 1);
|
||||
PLOT_CHECK_NEAR(p.reduce(0, 1).max, 7.0, 1e-6);
|
||||
// A pyramid can only answer exactly for whole buckets, so complete the first
|
||||
// bucket and ask the bucket-grained query for its extrema.
|
||||
for (u32 i = 1; i < kBucket; ++i) p.append(1.0f);
|
||||
PLOT_CHECK(p.size() == kBucket);
|
||||
PLOT_CHECK(p.level(0).size() == 1);
|
||||
PLOT_CHECK_NEAR(p.reduce_buckets(0, kBucket).max, 7.0, 1e-6);
|
||||
PLOT_CHECK_NEAR(p.reduce_buckets(0, kBucket).min, 1.0, 1e-6);
|
||||
}
|
||||
|
||||
PLOT_TEST(pyramid_cover_cost_is_logarithmic_for_unaligned_starts) {
|
||||
|
||||
Reference in new issue
Block a user