Skip to content

Fix leap-day cadence and fractional cadence rounding - #671

Draft
MaxGhenis wants to merge 2 commits into
masterfrom
uprate-cadence-rounding
Draft

MaxGhenis wants to merge 2 commits into
masterfrom
uprate-cadence-rounding

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Agent-written for Max, by a Codex cloud task for Max Ghenis; no person has reviewed it yet.

Changes

  • Find the latest February 29 when an annual cadence ends on leap day, even if the index has newer observations. test_cadence_uses_latest_leap_day covers a later observation and the eight-year gap across 2100.
  • Divide cadence amounts by fractional intervals using exact decimal values. test_flat_index_cadence_rounds_to_exact_cents[aligned-downwards] checks that a flat index preserves 0.29.
  • Tell authors who write a bare integer rounding interval to use a float or a mapping. test_chained_rounding_interval_forms covers the guidance and both valid forms.
  • Multiply cadence intervals before converting to the projected scalar type. test_flat_index_cadence_rounds_to_exact_cents covers the downward and upward bounds, nearest rounding, and an exact half that rounds to even.

Chained projections without cadence still return float artifacts after rounding: a flat index with downward 0.01 rounding on 0.7 gives 0.7000000000000001. The chained reference property compares exact float representations, so this change leaves that path as it is.

Open PRs #667, #669 and #670 also edit uprate_parameters.py and test_uprating.py.

Checks

  • All 11 new regression cases passed.
  • The parameter and period suite passed all 701 tests.
  • The full suite passed 4,333 tests, with four skips and three expected failures.
  • Ruff formatting and lint checks passed.

🤖 Generated with Claude Code

MaxGhenis and others added 2 commits November 30, 2026 12:05
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>

This branch has not been deployed

No deployments
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.

1 participant