follow-up(statistics): P3 cleanups from #110 review (Closed Days) #111
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#111
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 #110 (Closed Days). All P3; the partial P2 (live schedule path duplicating the precedence rule) and the missing
reference_business_dayson the closed summary were fixed before merge.Standards
calendarrequired onget_statistics_period_quality_async: every caller passes it, so the load fallback is dead code (the baseline's optional parameter is justified).ScheduleCalendar/is_open_by_scheduleout ofoccupancy_service.pyinto a small pure module next toCycleBounds(app/facility_time.pyor a sibling), and make it a@dataclass(frozen=True)instead of aNamedTuplewith behaviour (thecalendar or await …fallback only works because a 2-tuple is truthy).ScheduleCalendar.exceptionsis keyed by ISO strings and holds raw DB rows; key bydateand keep only what classification needs.tests/test_statistics_closed_days.py:date(2026, 9, 7), the4 * … + 2 * …day counts,timedelta(days=2),(1, 2, 3).test_statistics_closed_days.py, alsotest_statistics_baselines.pyon master): userecord_calibration_log_async."ScheduleCalendar"return annotation inoccupancy_service.py.Spec
usual_weekdaycomparison carriessource_datesbut noreference_business_days; the API README now scopes the field to period comparisons. Decide whether it should belen(source_dates)or stay absent.limitcounting fully closed periods is not asserted on its own.🤖 Generated with Claude Code