PSLmodels / OG-Core

An overlapping generations model framework for evaluating fiscal policies.
https://pslmodels.github.io/OG-Core/
Creative Commons Zero v1.0 Universal
66 stars 114 forks source link

Add additional pension systems #946

Closed jdebacker closed 2 months ago

jdebacker commented 3 months ago

This PR adds 3 additional pension systems (in additional the default US Social Security system):

  1. A defined benefits system
  2. A notional defined contribution system
  3. A points system
jdebacker commented 2 months ago

@rickecon I'm running the full suite of tests locally tonight. If those pass, I believe this PR is ready to merge.

jdebacker commented 2 months ago

With the latest commits, I only have 4 test failures locally:

FAILED tests/test_txfunc.py::test_txfunc_est[DEP] - assert False
FAILED tests/test_txfunc.py::test_txfunc_est[GS] - assert False
FAILED tests/test_txfunc.py::test_tax_func_loop - assert False
FAILED tests/test_txfunc.py::test_tax_func_estimate - assert False

These are expected as we know the optimizer for the tax function estimation returns difference results with difference version of Python/SciPy.

codecov-commenter commented 2 months ago

Codecov Report

Attention: Patch coverage is 68.19788% with 90 lines in your changes missing coverage. Please review.

Project coverage is 71.40%. Comparing base (dc0860a) to head (f3b21f2).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/946/graphs/tree.svg?width=650&height=150&src=pr&token=98mQCVhspd&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels)](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/946?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) ```diff @@ Coverage Diff @@ ## master #946 +/- ## ========================================== - Coverage 71.97% 71.40% -0.57% ========================================== Files 19 20 +1 Lines 4732 4949 +217 ========================================== + Hits 3406 3534 +128 - Misses 1326 1415 +89 ``` | [Flag](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/946/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/946/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | `71.40% <68.19%> (-0.57%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/946?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | Coverage Δ | | |---|---|---| | [ogcore/SS.py](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/946?src=pr&el=tree&filepath=ogcore%2FSS.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#diff-b2djb3JlL1NTLnB5) | `71.98% <100.00%> (ø)` | | | [ogcore/\_\_init\_\_.py](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/946?src=pr&el=tree&filepath=ogcore%2F__init__.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#diff-b2djb3JlL19faW5pdF9fLnB5) | `100.00% <100.00%> (ø)` | | | [ogcore/aggregates.py](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/946?src=pr&el=tree&filepath=ogcore%2Faggregates.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#diff-b2djb3JlL2FnZ3JlZ2F0ZXMucHk=) | `100.00% <100.00%> (ø)` | | | [ogcore/constants.py](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/946?src=pr&el=tree&filepath=ogcore%2Fconstants.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#diff-b2djb3JlL2NvbnN0YW50cy5weQ==) | `100.00% <ø> (ø)` | | | [ogcore/demographics.py](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/946?src=pr&el=tree&filepath=ogcore%2Fdemographics.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#diff-b2djb3JlL2RlbW9ncmFwaGljcy5weQ==) | `56.58% <ø> (-0.39%)` | :arrow_down: | | [ogcore/tax.py](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/946?src=pr&el=tree&filepath=ogcore%2Ftax.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#diff-b2djb3JlL3RheC5weQ==) | `100.00% <100.00%> (+0.54%)` | :arrow_up: | | [ogcore/pensions.py](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/946?src=pr&el=tree&filepath=ogcore%2Fpensions.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#diff-b2djb3JlL3BlbnNpb25zLnB5) | `67.03% <67.03%> (ø)` | |
rickecon commented 2 months ago

@jdebacker. I reviewed this PR and everything looks good. I just submitted a PR to your branch that updates the version number of OG-Core in setup.py and in ogcore/__init__.py and adds numba to setup.py and requirements.txt. As soon as you make a decision on that PR, we can merge this.

jdebacker commented 2 months ago

@rickecon I just merged your PR. Thanks for thinking of those housekeeping items.