Skip to content

Make NDC pension growth-rate settings parameters so the system can run - #1190

Open
marcelolafleur wants to merge 2 commits into
PSLmodels:masterfrom
marcelolafleur:fix/ndc-growth-rate-params
Open

Make NDC pension growth-rate settings parameters so the system can run#1190
marcelolafleur wants to merge 2 commits into
PSLmodels:masterfrom
marcelolafleur:fix/ndc-growth-rate-params

Conversation

@marcelolafleur

@marcelolafleur marcelolafleur commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Fixes #1169. Follow-up to #1167, which fixed the other two non-US pension systems.

The notional defined contribution pension system crashes as soon as you try to use it. Its growth-rate settings were never added to the parameters file, so the model stops with an error before computing anything. Behind that error sat two smaller bugs of the same kind: the growth-rate functions expect time paths but get single numbers in the steady state, and the benefit formula reads mortality rates from an attribute that only the unit tests ever set.

Changes:

  • The growth-rate settings are now real parameters. The options are the interest rate, current GDP growth, or long-run GDP growth. The default is long-run GDP growth, which is what the code already fell back to, so existing runs are unchanged.
  • The points system's growth-rate setting is added as a parameter too, since it has the same problem waiting.
  • The growth-rate functions now work in both the steady state and on the transition path.
  • The benefit formula uses the model's own mortality rates when the test-only attribute is missing.
  • The NDC system is added to the test that runs each pension system on a real parameters object. The contribution rate must be set above its default of zero, or the pension is zero everywhere.

Tested: pension and parameter test suites pass, ruff clean. Bumps to 0.19.0 with a changelog entry.

cc @rickecon @jdebacker

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 72.71%. Comparing base (b9b33ac) to head (79ef188).

Files with missing lines Patch % Lines
ogcore/pensions.py 87.50% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1190      +/-   ##
==========================================
+ Coverage   72.66%   72.71%   +0.04%     
==========================================
  Files          22       22              
  Lines        5726     5725       -1     
==========================================
+ Hits         4161     4163       +2     
+ Misses       1565     1562       -3     
Flag Coverage Δ
unittests 72.71% <88.88%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
ogcore/__init__.py 100.00% <100.00%> (ø)
ogcore/pensions.py 68.16% <87.50%> (+0.85%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

NDC pension system cannot run: growth-rate settings are not parameters

2 participants