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:
- Remove the year range limit entirely - No need to extend the range for future projections
- Potentially improve startup time - No pre-computation needed for all years
- 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
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:
Attempted Implementation
An initial attempt at this approach was made in PR #1434 by:
convert_instant_to_fiscal_year()functionget_parameters_at_instant()inCountryTaxBenefitSystemconvert_to_fiscal_year_parameters()a no-opHowever, 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
References