Skip to content

Explore on-the-fly fiscal year parameter conversion #1436

@MaxGhenis

Description

@MaxGhenis

Context

PR #1435 fixes the fiscal year parameter conversion range by extending it from 2015-2025 to 2015-2040. This is a simple fix but requires pre-computing values for all 26 years at startup.

Proposed Enhancement

Explore converting fiscal year parameters on-the-fly rather than pre-computing them. This would:

  1. Remove the year range limit entirely - No need to extend the range for future projections
  2. Potentially improve startup time - No pre-computation needed for all years
  3. Simplify the code - Just convert January 1 queries to April 30 dynamically

Attempted Implementation

An initial attempt at this approach was made in PR #1434 by:

  • Adding convert_instant_to_fiscal_year() function
  • Overriding get_parameters_at_instant() in CountryTaxBenefitSystem
  • Making convert_to_fiscal_year_parameters() a no-op

However, this broke 24 existing tests because it changed parameter lookup behavior for ALL dates, not just annual queries.

PR #1434 contains the work-in-progress on-the-fly implementation - it can be used as a starting point.

Investigation Needed

  • Understand why the on-the-fly approach broke existing tests
  • Determine if on-the-fly conversion can be safely implemented
  • Consider performance implications
  • Evaluate backward compatibility concerns

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions