Add SS-solve model-run tests for NDC and Points System pension systems - #1194
Open
arihantlodha-cmd wants to merge 1 commit into
Open
Add SS-solve model-run tests for NDC and Points System pension systems#1194arihantlodha-cmd wants to merge 1 commit into
arihantlodha-cmd wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_contributiontest_SS_solve_points_systemEach mirrors
test_SS_solve_defined_benefitsexactly (same structure and assertions), using the same system-specific parameters already used intest_pension_amount_with_real_specifications. Each runs a full steady-state solve viarunner(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 ., andlinecheckclean.