Skip to content

Gemischte Bedarfsgemeinschaften#1164

Merged
MImmesberger merged 50 commits into
gsia-rewritefrom
bg-gemischt
Jun 4, 2026
Merged

Gemischte Bedarfsgemeinschaften#1164
MImmesberger merged 50 commits into
gsia-rewritefrom
bg-gemischt

Conversation

@MImmesberger
Copy link
Copy Markdown
Member

@MImmesberger MImmesberger commented Mar 25, 2026

What problem do you want to solve?

Closes #1157 and #1146

Note: Some of the regression tests changed their expected outputs. I carefully checked each of them; and all of them perform better now. Main reason is that people are not eligible anymore after implementing the real eligibility check.

ToDo

  • Update GSiA tests to 2025 using calculator
  • Remove condition in Wohngeld

(This should be merged before #1156 before parts of this are already in there)

MImmesberger and others added 18 commits March 21, 2026 17:22
The SGB XII benefit unit (§ 27 Abs. 2) includes the couple plus their minor
unmarried children (< 18) in the same household, not just the couple as in
SGB II's Einstandsgemeinschaft. This adds sg_id and switches Grundsicherung
im Alter from _eg to _sg aggregation.

Changes:
- Add sg_id group creation function with sgb_xii_sg_id_formula (age < 18)
- Add SG aggregation functions in familie.py (ist_kind_in_sozialhilfegemeinschaft,
  anzahl_kinder_sg, anzahl_erwachsene_sg, anzahl_personen_sg)
- Rename _eg → _sg throughout grundsicherung/im_alter namespace
- Fix vermögensfreibetrag bug: was using _fg counts, now uses _sg counts
- Move p_id_einstandspartner to familie namespace (shared across SGB II/XII)
- Collapse date-split fg_id/eg_id functions into single functions
- Remove unused EG child/adult functions from familie.py
- Update documentation (hh_concepts.md, AGENTS.md)
- Skip hh_id_25 test (needs recomputation with SG grouping)

Closes #1147
Supersedes #738

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
commit 8983f95
Author: Marvin Immesberger <immesberger@posteo.de>
Date:   Tue Mar 24 17:09:20 2026 +0100

    Add regression test.

commit 2674c22
Author: Marvin Immesberger <immesberger@posteo.de>
Date:   Tue Mar 24 17:02:03 2026 +0100

    Add test for Musterberechnung.

commit 1df9140
Author: Marvin Immesberger <immesberger@posteo.de>
Date:   Tue Mar 24 16:48:06 2026 +0100

    Bedarfsanteilmethode
@MImmesberger MImmesberger changed the title Bg gemischt Gemischte Bedarfsgemeinschaften Mar 25, 2026
@MImmesberger MImmesberger marked this pull request as draft March 25, 2026 06:46
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@MImmesberger MImmesberger marked this pull request as ready for review March 25, 2026 20:52
Copy link
Copy Markdown
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, very nice!

My main wish would be to go through the tests and maybe the architecture. We now add lots of things, which should be fairly easy to calculate endogenously. Would prefer if we had less of that.

Comment thread docs/tt_explanations/gemischte_bedarfsgemeinschaften.md Outdated
Comment thread docs/tt_explanations/gemischte_bedarfsgemeinschaften.md Outdated
Comment thread src/gettsim/germany/arbeitslosengeld_2/arbeitslosengeld_2.py Outdated
betrag_m:
- 860.6
- 73.4
hat_regelaltersgrenze_erreicht:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why needed? Should be clear from birth dates?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently computed from the input alter_monate because we don't have float ages as a node right now (the reason I added hat_regelaltersgrenze_erreicht was to reduce test complexity). But I went with your suggestion because this is a proper test, not a regression test).

This just speaks in favor of fixing #211 soon. Dangerous to have some things depend on alter and some on alter_monate.

hmgaudecker and others added 7 commits May 25, 2026 08:41
…terms

- Rename gemischte_bedarfsgemeinschaften.md to
  gemischte_bedarfsgemeinschaften_and_mischhaushalte.md; explain the two
  concepts up front
- Present Grundsicherung bei Erwerbsminderung (§41 Abs. 3 SGB XII) as the
  second route into a gemischte BG; note that GETTSIM only implements the
  Grundsicherung im Alter case so far (#1145)
- Use German terms (gemischte Bedarfsgemeinschaften) instead of 'mixed BGs'
  in docstrings and docs

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Not needed with PEP 649 deferred evaluation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Compute hat_regelaltersgrenze_erreicht endogenously from the primitive
alter_monate (age must be an input until #211 provides an evaluation
date inside the DAG). Only touches test cases modified in this PR.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Files with non-ASCII paths were misclassified as not part of the PR
when scoping the previous sweep (gh pr diff quotes such paths).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ests

- Remove the provided grundsicherung__im_alter__überschusseinkommen_m_eg
  column from ALG2 and Bürgergeld test cases; provide the primitives
  schwerbehindert_grad_g and (2021+) grundrentenzeiten_monate instead
- Split einkommen_m at 2007: no function demands the Elterngeld column
  before Elterngeld existed
- Pre-2011 test cases provide erwerbseinkommen_m and
  mehrbedarf_bei_schwerbehinderungsgrad_g as data with a TODO referencing
  #685 (Grundsicherung im Alter broken pre-2011)
- Vorrangprüfungen test cases keep the zero-valued Überschusseinkommen
  input: computing it endogenously there would require ~30 additional
  unrelated input columns (pension, tax, Elterngeld machinery)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Erziehungsgeld was anrechnungsfrei (§8 Abs. 1 BErzGG), so it is
correctly absent from einkommen_m before 2007.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@MImmesberger MImmesberger merged commit 0f931f4 into gsia-rewrite Jun 4, 2026
13 of 14 checks passed
@MImmesberger MImmesberger deleted the bg-gemischt branch June 4, 2026 15:36
MImmesberger added a commit that referenced this pull request Jun 4, 2026
Content of gsia-rewrite tip (squash-merge of PR #1164, bg-gemischt) is
tree-identical to the bg-gemischt branch tip already merged in the
previous commit, so this merge only records the history.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants