statistics: should scheduled closures make a period partial and suppress comparisons? #100

Closed
opened 2026-09-25 12:14:47 +00:00 by gabogg · 1 comment
Owner

Split out of the pass-2 review of #92. Needs a product decision: the implementing agent chose the rule, not the maintainer.

Question

#92 suppresses change_percent (reason PARTIAL_PERIOD) whenever the current or reference period is partial, meaning covered_days < business_days. Suppressing is honest: the reference sum is a raw total, so the two sides can't be compared.

However, a scheduled-closed day (holiday marked "Cerrado") has no counted events, so it makes the whole week or month partial. As a result:

  • every month that contains a closure loses its previous-period and last-year comparisons;
  • so does the following month, because its reference period is now partial.

Options

  1. Leave scheduled-closed days out of business_days, so a closure doesn't make a period partial.
  2. Compare daily averages over covered days instead of raw totals, and only suppress below a coverage threshold.
  3. Keep the current rule and document it.

Code: analytics_service.py (statistics_visitor_comparison_async, entrances comparisons, PeriodQuality.partial).

🤖 Generated with Claude Code

Split out of the pass-2 review of #92. **Needs a product decision**: the implementing agent chose the rule, not the maintainer. ## Question #92 suppresses `change_percent` (reason `PARTIAL_PERIOD`) whenever the current or reference period is partial, meaning `covered_days < business_days`. Suppressing is honest: the reference sum is a raw total, so the two sides can't be compared. However, a **scheduled-closed day** (holiday marked "Cerrado") has no counted events, so it makes the whole week or month partial. As a result: - every month that contains a closure loses its previous-period and last-year comparisons; - so does the following month, because its reference period is now partial. ## Options 1. Leave scheduled-closed days out of `business_days`, so a closure doesn't make a period partial. 2. Compare daily averages over covered days instead of raw totals, and only suppress below a coverage threshold. 3. Keep the current rule and document it. Code: `analytics_service.py` (`statistics_visitor_comparison_async`, entrances comparisons, `PeriodQuality.partial`). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

Resolved in the 2026-09-25 grilling session: see #103 (Closed Days are not business days) and #104 (daily-average comparison above a configurable coverage threshold). Closing.

🤖 Generated with Claude Code

Resolved in the 2026-09-25 grilling session: see #103 (Closed Days are not business days) and #104 (daily-average comparison above a configurable coverage threshold). Closing. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gabogg/hikcentral#100
No description provided.