Skip to content
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

Merged
merged 16 commits into from Feb 23, 2021
Merged

2021 wohngeld reform #256

merged 16 commits into from Feb 23, 2021

Conversation

Eric-Sommer
Copy link
Collaborator

@Eric-Sommer Eric-Sommer commented Dec 21, 2020

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).
grafik

@Eric-Sommer Eric-Sommer marked this pull request as draft December 21, 2020 20:30
@codecov
Copy link

codecov bot commented Dec 21, 2020

Codecov Report

Merging #256 (7a2be6b) into master (14d766a) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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              
Impacted Files Coverage Δ
gettsim/policy_environment.py 100.00% <100.00%> (ø)
gettsim/tests/test_wohngeld.py 100.00% <100.00%> (ø)
gettsim/transfers/wohngeld.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 14d766a...6b870e2. Read the comment docs.

@Eric-Sommer Eric-Sommer changed the title WIP: 2021 wohngeld reform 2021 wohngeld reform Dec 21, 2020
@hmgaudecker
Copy link
Collaborator

Thanks -- so how much is missing here? Thinking about releasing the 2021 version.

@Eric-Sommer
Copy link
Collaborator Author

Eric-Sommer commented Jan 23, 2021

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.

@Eric-Sommer
Copy link
Collaborator Author

Eric-Sommer commented Jan 23, 2021

Should be fine now. Rent considered after the reform is aligned with external sources (e.g. this one).

@Eric-Sommer Eric-Sommer marked this pull request as ready for review January 23, 2021 21:47
@@ -489,7 +489,7 @@ def wohngeld_miete_ab_2009(
return wg_miete


def wohngeld_max_miete_ab_2021(
def wohngeld_miete_ab_2021(
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

Copy link
Collaborator

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

Copy link
Collaborator

@hmgaudecker hmgaudecker left a 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.

@mjbloemer
Copy link
Collaborator

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.

@hmgaudecker
Copy link
Collaborator

Great, feel free to merge and we will tackle the tests in a separate PR.

@Eric-Sommer Eric-Sommer merged commit 1685e7b into master Feb 23, 2021
@Eric-Sommer Eric-Sommer deleted the wg_2021 branch February 23, 2021 00:30
@Eric-Sommer Eric-Sommer mentioned this pull request Apr 11, 2021
6 tasks
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.

None yet

3 participants