Skip to content

Conversation

@MaxGhenis
Copy link
Collaborator

Summary

  • Extends the fiscal year parameter conversion range from 2015-2025 to 2015-2040
  • Fixes issue where policies changing on April 6 (UK fiscal year start) were not reflected in annual simulations for years 2026+
  • Adds test coverage for fiscal year parameter handling

Problem

The convert_to_fiscal_year_parameters() function in policyengine_uk/utils/parameters.py used range(2015, 2026), which only covered years 2015-2025. This caused policies that change on April 6 (UK fiscal year start) to not be reflected in simulations for 2026+.

Example: The two-child limit repeal on April 6, 2026 was returning:

  • param("2026") → 2 (WRONG - should be infinity)
  • param("2026-04-30") → infinity (correct)

Solution

Extended the range to range(2015, 2041) to cover long-term projections through 2040.

Test plan

  • Added test_fiscal_year_parameters.py with tests for:
    • Two-child limit repeal behavior across fiscal years 2025, 2026, 2027
    • Fiscal year boundary behavior (January 2026 vs December 2025)
    • Year coverage from 2025-2040
  • Verified tests FAIL under master (2026 returns 2)
  • Verified tests PASS with fix (2026 returns infinity)
  • Ran make format

🤖 Generated with Claude Code

The fiscal year conversion in convert_to_fiscal_year_parameters() only
covered years 2015-2025 (range(2015, 2026)). This caused policies that
change on April 6 (UK fiscal year start) to not be reflected in annual
simulations for 2026+.

For example, the two-child limit repeal on April 6, 2026 was returning
the pre-repeal value (2) for param("2026") instead of the post-repeal
value (infinity).

This fix extends the range to 2015-2040 to cover long-term projections.

Also adds test coverage for:
- Two-child limit repeal behavior across fiscal years
- Fiscal year boundary behavior
- Year coverage from 2025-2040

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@MaxGhenis MaxGhenis merged commit 855401c into master Dec 3, 2025
2 checks passed
@MaxGhenis MaxGhenis deleted the fix-fiscal-year-range-2041 branch December 3, 2025 16:16
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