Skip to content

Constant-rate escalation takes the end-of-month rule - #46

Merged
dylanjm merged 2 commits into
anchored-boundariesfrom
anchored-escalation
Oct 15, 2026
Merged

dylanjm merged 2 commits into
anchored-boundariesfrom
anchored-escalation

Conversation

@j-bryan

@j-bryan j-bryan commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Related to #38 (does not close it). Stacked on #45, in stack #51.

Constant-rate escalation can now choose the end-of-month rule. Before this, it always used the default from #45.

  • ConstantRateEscalation(..., end_of_month=True): new last dataclass field, so positional calls are unaffected. factor() passes it to elapsed_periods, so monthly and quarterly escalation compounds one full step at each boundary of the schedule anchored at reference_date. Yearly and daily escalation ignore it.
  • EscalationBuilder.constant_rate(..., end_of_month=True): keyword-only, passed through to the segment's policy.
  • IndexSeriesEscalation and CompositeEscalation don't take the flag. Index series step on their observed dates, and a composite takes the setting from each of its segments.
  • Tests (tests/unit/test_escalation.py): factor(add_periods(ref, k)) equals (1+r)**k for months and quarters under both settings. Apr 30 → May 31 is exactly (1+r) with the flag on and (1+r)**(1 + 1/31) with it off. Also tested: the default is True, year and day factors don't depend on the flag, and the builder passes it through.

Behavior changes

None beyond #45. True was already the effective default there; this PR only exposes the setting.

Not in this PR

Callers that build a ConstantRateEscalation internally (stream factories, the OPEX and revenue compilers, construction) still don't expose the flag. Construction is handled in #49, and the stream factories and builder in later PRs (see the plan in #38).

Testing

uv run ruff check, uv run ruff format --check, uv run mypy dcaf/, and uv run pytest pass (936 tests), and the Hypothesis properties also pass at 3,000 examples each.

🤖 Generated with Claude Code

j-bryan and others added 2 commits October 13, 2026 15:55
Co-Authored-By: Claude <noreply@anthropic.com>
…f_month

Co-Authored-By: Claude <noreply@anthropic.com>

@dylanjm dylanjm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Changes are good.

@dylanjm
dylanjm merged commit 95e30da into main Oct 15, 2026
1 check passed
@dylanjm
dylanjm deleted the anchored-escalation branch October 15, 2026 15:12
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