-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Erwerbsminderungsrente #577
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, I left some comments that we can discuss later :-).
Added check for Grundrentenzuschlag Added erwerbsm_rente_m to default targets Zugangsfaktor for Erwerbsminderungsrente is now calculated on a monthly basis Adjusted test for new calculation method
This will be a very large PR. It would be helpful to move things that affect other dimensions than Erwerbsminderungsrente to separate PRs. E.g. if we need to differentiate the stock of points earned by geographic region, we should do so in two stock variables, not one stock, one share. Doing so will affect all pension payments (I suppose) and issues related to that can be discussed without reference to Erwerbsminderungsrente. |
Sorry for the late response. You are right, the differentiation between EPs should be discussed on another PR. I removed the last commit |
…echnungszeitsgrenze between 2001 and 2003
…bsminderunsgrente
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #577 +/- ##
==========================================
+ Coverage 91.25% 91.39% +0.14%
==========================================
Files 49 50 +1
Lines 3315 3369 +54
==========================================
+ Hits 3025 3079 +54
Misses 290 290 ☔ View full report in Codecov by Sentry. |
…OEP-RV data in order to fuel final test and hopefully close PR soon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are getting close!
return out | ||
|
||
|
||
def langj_versicherte_wartezeit( # noqa: PLR0913 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def langj_versicherte_wartezeit( # noqa: PLR0913 | |
def _erwerbsm_rente_langj_versicherte_wartezeit( # noqa: PLR0913 |
For now we'll need to be explicit about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should become five test cases.
Please give them names that check what is being tested. E.g. voll_erwerbsgemindert_birthyear_1940
.
(The hh_id-stuff is only there for legacy reasons, i.e. the bulk conversion of csv-files)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah okay good to know. I was always wondering about that "naming convention".
Is there already some kind of script/tool for splitting those yaml files up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had one for csv -> yaml, but I am not sure whether it is helpful here. @lars-reimann would know.
Otherwise, I'd just read them into a DataFrame and write out again row-by-row.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conversion script is available here. It was not designed with reusability in mind, but rather to run it once on the old CSV test data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot. I finally used that script here. Maybe we can add it to the gettsim-code-for-picking repo so people can reuse it.
I think all suggestions are implemented now @hmgaudecker . The only problem left is that the function name 'erwerbsm_rente_langj_versicherte_wartezeit' is too long but i dont know how to shorten it without losing precision. |
Even too long if you add an underscore upfront? |
I was not aware of that feature. Now it works👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few quick comments, gotta stop now. Rest looks good at a glance, too, though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful, thanks a lot! Just a couple of small changes left, nothing substantial.
...gettsim_tests/test_data/erwerbsm_rente/2001/teilw_erwerbsgemindert_birthyear_1980_claim.yaml
Outdated
Show resolved
Hide resolved
updates: - [github.com/lyz-code/yamlfix: 1.15.0 → 1.16.0](lyz-code/yamlfix@1.15.0...1.16.0) - [github.com/astral-sh/ruff-pre-commit: v0.1.5 → v0.1.6](astral-sh/ruff-pre-commit@v0.1.5...v0.1.6) - [github.com/nbQA-dev/nbQA: 1.7.0 → 1.7.1](nbQA-dev/nbQA@1.7.0...1.7.1) - [github.com/pre-commit/mirrors-mypy: v1.7.0 → v1.7.1](pre-commit/mirrors-mypy@v1.7.0...v1.7.1)
Implementation of pension for reduced earning capacity (Erwerbsminderungsrente) as addition to the pension system already existing in gettsim.
The special feature of the pension for reduced earning capacity are the additional earning points. Average earning points per year are calculated for every individual and attributed for the time between retirement and an allocation age limit (Zurechnungszeitsgrenze). There are also special rules for (Zugangsfaktor) and (Rentenfaktor) both relevant for the calculation of the total pension claim.
Three new input variables are introduced.
voll_erwerbsgemind
: Unable to provide more than 3 hours of market labor per day.teilw_erwerbsgemind
: Able to provide at least 3 but no more than 6 hours of market labor per day.