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
2021 wohngeld reform #256
2021 wohngeld reform #256
Conversation
Codecov Report
@@ Coverage Diff @@
## master #256 +/- ##
==========================================
+ Coverage 91.78% 91.80% +0.02%
==========================================
Files 65 65
Lines 2434 2440 +6
==========================================
+ Hits 2234 2240 +6
Misses 200 200
Continue to review full report at Codecov.
|
Thanks -- so how much is missing here? Thinking about releasing the 2021 version. |
For starters, the code does not run atm. I also discussed privately with @mjbloemer on how we think the reform actually works. We'd certainly need an additional test here. I'll have a look at it later tonight. |
Should be fine now. Rent considered after the reform is aligned with external sources (e.g. this one). |
# Conflicts: # gettsim/policy_environment.py
@@ -489,7 +489,7 @@ def wohngeld_miete_ab_2009( | |||
return wg_miete | |||
|
|||
|
|||
def wohngeld_max_miete_ab_2021( | |||
def wohngeld_miete_ab_2021( |
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.
Docstring still says 2009.
Why are there no tests for this set of functions? Seems reasonable easy that an error would slip in...
Given that the PR starts with that calculator, taking a couple of those examples including extreme ones / corner cases (hh_size in {5, 6, 13}) and making test cases out of them would seem like the natural place to start.
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.
Docstring is corrected.
There are two tests for 2021. The one I describe above and test_increasing_hh_size()
is extended for 2021. To me, this confirms that the logic of the 2021 reform is captured correctly as it does differs only in the maximum value for the considered rent. Extreme cases (hh_size > 12) are an issue that would affect all wohngeld calculations and would deserve an own PR in my view. @mjbloemer has played around with wohngeld calculations and very large households.
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.
Okay, I was just surprised that the renaming of the function did not lead
to renaming anywhere in the tests.
In the long run, it would be good to also test functions like this
directly, but no prerequisite for merging this IMO.
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.
Testing each function directly will also make it easier to catch side-effects, see #272
# Conflicts: # CHANGES.rst # gettsim/parameters/wohngeld.yaml
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.
Looks good to me from the code side, thanks!
However, @mjbloemer, it would be great if you could have a quick look at the parameters.
parameters (heating cost) are fine. You could add the heating cost parameters for 2009 and 2010 which followed the same rule. I have not looked at the calculations/structure. |
Great, feel free to merge and we will tackle the tests in a separate PR. |
Implements a wohngeld/housing benefit reform becoming effective 01/2021. Before, only rent exluding heating costs (Kaltmiete) were considered for the housing benefit. From 2021, heating costs are considered via a lump sum amount depending on household size.
The reform is tested and confirmed with smart-rechner.de. gettsim returns €283.60, which is the last step before rounding to full euros (see #88).