Skip to content

Add earnings cap to NDC and DB systems - #1282

Merged
rickecon merged 5 commits into
PSLmodels:masterfrom
jdebacker:pension_earn_cap
Nov 16, 2026
Merged

rickecon merged 5 commits into
PSLmodels:masterfrom
jdebacker:pension_earn_cap

Conversation

@jdebacker

Copy link
Copy Markdown
Member

In PR #1273, they hybrid DB/NDC system was added to the pension regimes modeled in OG-Core. This regime has two thresholds: one to determine the earnings above which contributions went to the NDC system (factor1_db_ndc_hybrid) and another to determine the maximum earnings from which contributions to the NDC system would be made (factor2_db_ndc_hybrid).

This PR modified the DB and NDC functions so that thresholds can be set determining the range or earnings that are contributed to these systems (without having the hybrid DB/NDC system).

@codecov-commenter

codecov-commenter commented Nov 14, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.51163% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.81%. Comparing base (f95bf15) to head (5dd780b).

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1282      +/-   ##
==========================================
+ Coverage   79.68%   79.81%   +0.13%     
==========================================
  Files          24       24              
  Lines        6762     6811      +49     
==========================================
+ Hits         5388     5436      +48     
- Misses       1374     1375       +1     
Flag Coverage Δ
unittests 79.81% <96.51%> (+0.13%) ⬆️

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/parameters.py 90.64% <100.00%> (+0.83%) ⬆️
ogcore/pensions.py 73.21% <93.47%> (+0.72%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jdebacker

Copy link
Copy Markdown
Member Author

All local tests passing:

uv run python -m pytest
============================= test session starts ==============================
platform darwin -- Python 3.12.12, pytest-9.2.0, pluggy-1.7.0
rootdir: /Users/jason.debacker/repos/OG-Core
configfile: pyproject.toml
testpaths: tests
plugins: platformdirs-4.14.5, cov-7.1.0, xdist-3.8.0
collected 894 items

tests/test_SS.py ..............................................          [  5%]
tests/test_TPI.py ...................................................... [ 11%]
......                                                                   [ 11%]
tests/test_aggregates.py .............................................   [ 16%]
tests/test_basic.py ....                                                 [ 17%]
tests/test_constants.py .                                                [ 17%]
tests/test_demographics.py ............................................. [ 22%]
.............                                                            [ 23%]
tests/test_elliptical_u_est.py .......                                   [ 24%]
tests/test_execute.py .                                                  [ 24%]
tests/test_firm.py ..................................................... [ 30%]
................                                                         [ 32%]
tests/test_fiscal.py .................................                   [ 36%]
tests/test_household.py ................................................ [ 41%]
.....                                                                    [ 42%]
tests/test_optional_pygam.py ...s                                        [ 42%]
tests/test_output_plots.py ............................................. [ 47%]
.....                                                                    [ 48%]
tests/test_output_tables.py ......................                       [ 50%]
tests/test_parameter_plots.py .......................................... [ 55%]
.................................................................        [ 62%]
tests/test_parameter_tables.py .......                                   [ 63%]
tests/test_parameters.py ............................................... [ 68%]
..                                                                       [ 68%]
tests/test_pensions.py ................................................. [ 74%]
.....................................................                    [ 80%]
tests/test_population_accounting.py ..                                   [ 80%]
tests/test_run_example.py ..                                             [ 80%]
tests/test_run_ogcore.py .                                               [ 80%]
tests/test_tax.py .....................................                  [ 85%]
tests/test_txfunc.py ..................................s.                [ 89%]
tests/test_user_inputs.py .........                                      [ 90%]
tests/test_utils.py .................................................... [ 95%]
.....................................                                    [100%]
========== 892 passed, 2 skipped, 186 warnings in 9298.00s (2:34:57) ===========

@jdebacker
jdebacker marked this pull request as ready for review November 16, 2026 13:19
@jdebacker
jdebacker requested a review from rickecon November 16, 2026 13:19
@rickecon

Copy link
Copy Markdown
Member

@jdebacker. This looks good. Will merge as soon as tests pass.

@rickecon
rickecon merged commit 9b8a3b4 into PSLmodels:master Nov 16, 2026
8 checks passed
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.

3 participants