Skip to content

Add SS-solve model-run tests for NDC and Points System pension systems - #1194

Open
arihantlodha-cmd wants to merge 1 commit into
PSLmodels:masterfrom
arihantlodha-cmd:db-pension-time-varying
Open

Add SS-solve model-run tests for NDC and Points System pension systems#1194
arihantlodha-cmd wants to merge 1 commit into
PSLmodels:masterfrom
arihantlodha-cmd:db-pension-time-varying

Conversation

@arihantlodha-cmd

Copy link
Copy Markdown

Addresses part of #1014 (model-run tests for each pension system).

Following the merge of #1167 (which made the Defined Benefits system solve the steady state and transition path), Issue #1014 lists remaining work. Per @marcelolafleur's summary there, one of those items is TPI/SS-level model-run tests for each pension system — #1167 added a steady-state solve test for Defined Benefits only (test_SS_solve_defined_benefits), and its docstring notes the "analogous NDC and Points System runs should be added."

This PR adds those two missing steady-state solve tests:

  • test_SS_solve_notional_defined_contribution
  • test_SS_solve_points_system

Each mirrors test_SS_solve_defined_benefits exactly (same structure and assertions), using the same system-specific parameters already used in test_pension_amount_with_real_specifications. Each runs a full steady-state solve via runner(p, time_path=False) and asserts that aggregate pension outlays are positive and a sensible fraction of GDP. Both are marked @pytest.mark.local, consistent with the DB test.

Scope note: I deliberately kept this to test coverage and did not touch the pension formulas. The other open items in #1014 — time-varying retirement age and earnings profiles in the DB/NDC/PS formulas, and pre-time-path histories — are areas @marcelolafleur is actively working on (and OG-BRA depends on), so I didn't want to conflict with that. TPI-level run tests are a natural follow-up once the time-varying transition-path handling lands.

Testing

  • pytest tests/test_pensions.py -m local -k SS_solve — all three pension-system SS solves pass (DB, NDC, Points System).
  • ruff format --check ., ruff check ., and linecheck clean.

Partially addresses PSLmodels#1014. PR PSLmodels#1167 added a steady-state solve test for the
Defined Benefits system only; its docstring notes the analogous NDC and
Points System runs should be added. This adds those two tests, mirroring
test_SS_solve_defined_benefits with the same structure and assertions and the
system-specific parameters already used elsewhere in the module. Confirms all
three pension systems solve the steady state with positive pension outlays.

Scoped to test coverage only; the remaining time-varying retirement age and
earnings items in PSLmodels#1014 are left to the active work in that area.
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.

1 participant