Introduce Einsatzgemeinschaft (eg) group for SGB XII#1159
Merged
MImmesberger merged 17 commits intogsia-rewritefrom Mar 26, 2026
Merged
Introduce Einsatzgemeinschaft (eg) group for SGB XII#1159MImmesberger merged 17 commits intogsia-rewritefrom
MImmesberger merged 17 commits intogsia-rewritefrom
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>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Collaborator
Author
|
The failing docs build is related to GETTSIM personas. Let's fix this later before merging into main when we have settled on the naming. |
hmgaudecker
reviewed
Mar 24, 2026
Documentation build overview
Show files changed (6 files in total): 📝 6 modified | ➕ 0 added | ➖ 0 deleted
|
hmgaudecker
approved these changes
Mar 26, 2026
src/gettsim/germany/ids.py
Outdated
| p_id_einstandspartner, | ||
|
|
||
| # Sort all arrays according to p_id to make the id equal location in array | ||
| sorting = xnp.argsort(p_id) |
Collaborator
There was a problem hiding this comment.
Is this necessary? I thought we guaranteed that via the process of setting our internal p_id, but I might misremember.
Collaborator
Author
There was a problem hiding this comment.
You're right, we don't need that anymore. Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
eg_id(Einsatzgemeinschaft) group for SGB XII, which includes the couple plus their minor unmarried children (< 18) in the same household (§ 27 Abs. 2 SGB XII)_bgto_egaggregation, fixing incorrect benefit computation for households with minor childrenvermögensfreibetragbug: was using_fg(Familiengemeinschaft) counts instead of the correct group-level countsp_id_lebenspartner(formerlyp_id_einstandspartner) fromarbeitslosengeld_2/bürgergeldnamespaces tofamilie(shared across SGB II and SGB XII), collapsing date-splitfg_idfunction into single functionsEinstandspartner→Lebenspartner(p_id_einstandspartner→p_id_lebenspartner)Test plan
pixi run tyandpixi run ty-jaxpasspixi run prek run --all-filespassespixi run -e py314-jax tests -n 7— 1285 passed, 528 skippedeg_idvalues for various household compositionsskip_hh_id_25.yaml(parent + child) needs expected values recomputed with EG grouping — follow-up neededCloses #1147
Supersedes #738
Related to #696
🤖 Generated with Claude Code