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

Rounding of Taxes and Transfers #659

Merged
merged 15 commits into from
Nov 16, 2023
Merged

Rounding of Taxes and Transfers #659

merged 15 commits into from
Nov 16, 2023

Conversation

MImmesberger
Copy link
Collaborator

@MImmesberger MImmesberger commented Oct 13, 2023

Closes #88

Todo

  • Wohngeld in steps of 5€.
  • Income deduction from Kinderzuschlag in steps of 10€ until 07/2019.
  • Vorsorgeaufwendungen are rounded up.
  • Income tax is rounded down.
  • Unterhaltsvorschuss is rounded up.

@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (d2c717d) 90.96% compared to head (d4b8091) 91.01%.

Files Patch % Lines
src/_gettsim/interface.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #659      +/-   ##
==========================================
+ Coverage   90.96%   91.01%   +0.05%     
==========================================
  Files          48       48              
  Lines        3131     3140       +9     
==========================================
+ Hits         2848     2858      +10     
+ Misses        283      282       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MImmesberger
Copy link
Collaborator Author

The PR is ready for review.

  1. I couldn't find the legal basis for Wohngeld being payed out in 5€ steps, so I did not implement it. See discussion in Rounding is missing for several taxes / transfers #88
  2. The rounding of zu versteuerndes Einkommen includes an additive part (e.g. round down to a number divisible by 54 and then add 18€). A summary is here. Because this wasn't possible with the current machinery, I added an "add" key to the rounding specification that adds a float after the rounding step.

@hmgaudecker
Copy link
Collaborator

I couldn't find the legal basis for Wohngeld being payed out in 5€ steps, so I did not implement it. See discussion in

Yes, let's leave it at the nearest Euro!

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.

Very sweet! I think I would get rid of the case distinction for the add parameter (and rename it), just requiring that it is zero if not used.

src/_gettsim/interface.py Outdated Show resolved Hide resolved
src/_gettsim/parameters/eink_st.yaml Show resolved Hide resolved
src/_gettsim/parameters/unterhaltsvors.yaml Outdated Show resolved Hide resolved
src/_gettsim_tests/test_rounding.py Outdated Show resolved Hide resolved
src/_gettsim_tests/test_rounding.py Outdated Show resolved Hide resolved
@MImmesberger
Copy link
Collaborator Author

Thank you for the comments! I hope I addressed all your concerns.

@MImmesberger
Copy link
Collaborator Author

Sorry, I still have trouble interpreting codecov outputs:

From the output I figured that _add_rounding_to_one_function is not properly covered by a test (only implicitly because it is used in the wrapper _add_rounding_to_functions which is tested). But testing directly via test_rounding_callable doesn't help.

Maybe @lars-reimann knows whats going on?

@hmgaudecker
Copy link
Collaborator

Oh, codecov happens to be off every now and then. If you are sure it is being run, that's fine!

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 great, just one tiny comment left.

src/_gettsim/parameters/eink_st.yaml Show resolved Hide resolved
@hmgaudecker hmgaudecker merged commit adeefb7 into main Nov 16, 2023
5 of 6 checks passed
@hmgaudecker hmgaudecker deleted the rounding-taxes-transfers branch November 16, 2023 12:54
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.

Rounding is missing for several taxes / transfers
2 participants