Repository navigation
Pins GenerationStream.group_by(period=) totals for a multi-month entry - #58
Merged
Merged
Conversation
…h entry (#35) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dylanjm
approved these changes
Oct 27, 2026
dylanjm
left a comment
Collaborator
There was a problem hiding this comment.
New test nailing down group-by logic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#35 reported that
GenerationStream.group_by(period=)gave wrong period totals for entries spanning several periods. #42 (ef15517) already fixed this: it splits entries at calendar boundaries with_calendar_pieces, the same allocationto_revenueuses. This PR adds no library code. It adds a test that pins the fixed behavior with hand-computed values.The test takes the issue's own case, one entry over
[2027-01-01, 2027-08-01), and groups it by"month". It asserts:to_revenue(1.0)gives the same amount for each month.The expected values are literals, with no reimplemented oracle. Uneven multi-year proration is already pinned by the
group_bydocstring doctest (2030–2032), so there is no separate"year"test.GenerationStreamis being removed in the v1.0 primitives rework, so no further API is planned for it.Result changes
None. Tests only.
Closes #35
🤖 Generated with Claude Code