Skip to content

Conversation

@vahid-ahmadi
Copy link
Collaborator

@vahid-ahmadi vahid-ahmadi commented Jul 15, 2025

Fixes #1234 and #1230

  • We added a conditional check to properly access baseline parameters via person.simulation.baseline.tax_benefit_system.get_parameters_at_instant() when a simulation baseline exists, otherwise fall back to current parameters.
  • Added an early return optimisation that compares baseline and reform parameters (rates, thresholds, pension exemptions) and immediately returns 0 if they're identical.
  • We added 10 test cases covering various baseline scenarios to ensure the variable consistently returns zero when no policy changes exist.

@vahid-ahmadi vahid-ahmadi self-assigned this Jul 15, 2025
@nikhilwoodruff
Copy link
Collaborator

@PolicyEngine fix merge conflicts, wait to check for gh ci to finish, so i can sign off?

@policyengine
Copy link
Contributor

policyengine bot commented Dec 8, 2025

Done! Merge conflicts resolved and all CI checks passed ✅

Changes:

  • Merged latest master into this branch
  • Resolved conflict in employer_ni_fixed_employer_cost_change.py:
    • Kept early return when baseline is None (from master)
    • Used correct .parameters(period) method for baseline access
    • Retained max_() function and parameter equality optimization from PR
    • Clean inline conditionals for pen_con_subtracted variables

Ready for your sign-off!

Resolved conflicts in employer_ni_fixed_employer_cost_change.py by:
- Keeping the early return when baseline is None from master
- Using the correct .parameters(period) method for baseline
- Retaining the max_() function and early return optimization from PR
- Keeping clean inline conditionals for pen_con_subtracted variables

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

Co-Authored-By: Claude <noreply@anthropic.com>
@nwoodruff-co nwoodruff-co merged commit 86eef62 into master Dec 9, 2025
2 checks passed
@nwoodruff-co nwoodruff-co deleted the fix-employer-ni-baseline-issue branch December 9, 2025 08:44
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.

Reintroduce and debug employer_NI_fixed_employer_cost_change variable

5 participants