Gemischte Bedarfsgemeinschaften#1164
Conversation
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
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
hmgaudecker
left a comment
There was a problem hiding this comment.
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.
| betrag_m: | ||
| - 860.6 | ||
| - 73.4 | ||
| hat_regelaltersgrenze_erreicht: |
There was a problem hiding this comment.
Why needed? Should be clear from birth dates?
There was a problem hiding this comment.
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.
…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>
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.
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
(This should be merged before #1156 before parts of this are already in there)