follow-up(statistics): P3 cleanups from #89 review (periods and daily series) #96
Labels
No labels
blocked
bug
enhancement
high-priority
low-priority
needs-info
needs-triage
ready-for-agent
ready-for-human
referenced
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gabogg/hikcentral#96
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-ups from the pass-2 review of #89 (comment on #89). All P3; the P2s were fixed in
ca30e17before merge.Standards
get_statistics_daily_series_asyncstill runs several queries per day (flow, calibration log, schedule, peak, open-window counts, average). Quality is now one range read (ca30e17); the rest could be batched too. A 62-day range still costs a few hundred queries.granularity.statistics_period_end,previous_statistics_periodandlatest_closed_statistics_period(app/services/analytics_service.py) each switch on granularity; one per-granularity strategy map would keep them together.daily_reset_timedefault repeated.cfg.get("daily_reset_time", "04:00")appears in several statistics methods;occupancy_manager.get_daily_reset_time_async()already exists.get_counted_day_flow_asyncreturns(int, int, bool)andget_counted_cycle_quality_range_asyncreturnslist[dict[str, Any]]read by string key. Use aNamedTuple/TypedDict. Thecycles: list[tuple[str, float, float]]argument is an anonymous triple that must be passed sorted.Spec
excluded_days, butDailyStatisticshas no per-dayexcludedflag, so the deck can't show which day was excluded (not required by #84).gap_estimated_days > 0on the picker, a day withis_holiday: true,occupancy_definition_cutover_aton the daily series, and the historical trusted-multiplier path (the fixture usesis_trusted=0and IN-only events). The dwell check is onlyis not None.🤖 Generated with Claude Code
The per-day
excludedflag moved to #106 (needed by the deck's quality marker). The rest stays here.🤖 Generated with Claude Code
gabogg referenced this issue2026-09-28 00:11:46 +00:00
Resolved by #167 (merged 2026-10-02,
103157c). Every item is done except per-day peak and average Riemann integration, which is tracked in #203. Third-pass leftovers are tracked in #219.