Skip to content

Conversation

@ashenfad
Copy link
Owner

@ashenfad ashenfad commented Jan 1, 2026

No description provided.

@ashenfad ashenfad requested a review from Copilot January 1, 2026 06:48
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a group_by parameter to the metrics functions (total_duration, count_intervals, coverage_ratio) that enables cyclic histogram aggregation, such as aggregating metrics by hour-of-day or day-of-week across multiple time periods.

  • Introduces GroupBy type and validation logic for period/group_by combinations
  • Implements _grouped_agg helper function to aggregate metrics by cyclic keys
  • Adds comprehensive test coverage for the new grouping functionality

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
calgebra/metrics.py Core implementation of group_by functionality including validation, key extraction, grouped aggregation logic, and updates to metric functions
tests/test_metrics_groupby.py Comprehensive test suite covering validation, grouping behavior, and edge cases for all three metrics
docs/API.md Documentation of the new group_by feature with valid combinations table and usage examples
calgebra/docs/API.md Duplicate documentation file (identical to docs/API.md)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ashenfad ashenfad merged commit 123e835 into main Jan 1, 2026
5 checks passed
@ashenfad ashenfad deleted the group-by branch January 1, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants