Skip to content

Commit 3e2a6cb

Browse files
MImmesbergerclaude
andcommitted
Fix docs notebook: per-fg unit on the child-count threshold
The 'tax deduction only for families with at least two children' example compares `familie__anzahl_kinder_fg` (a count at the Familiengemeinschaft level) against a threshold parameter. Under GEP 10 a comparison requires both operands in the same unit, so the threshold must be declared `PERSON_COUNT.PER_FG`, not plain `PERSON_COUNT`. Without this the docs build fails with a UnitConsistencyError while executing the notebook. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 749c417 commit 3e2a6cb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

docs/how_to_guides/modifications_of_policy_environments.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,8 +1010,11 @@
10101010
"# Step 2: Create a new parameter `min_anzahl_kinder_für_kinderfreibetrag`\n",
10111011
"from gettsim.tt import ScalarParam, TTSIMUnit\n",
10121012
"\n",
1013+
"# The threshold is compared against `familie__anzahl_kinder_fg`, a child count at the\n",
1014+
"# Familiengemeinschaft level, so it carries the same per-fg unit (GEP 10): a comparison\n",
1015+
"# is only meaningful between operands in identical units.\n",
10131016
"min_anzahl_kinder_für_kinderfreibetrag = ScalarParam(\n",
1014-
" value=2, unit=TTSIMUnit.PERSON_COUNT\n",
1017+
" value=2, unit=TTSIMUnit.PERSON_COUNT.PER_FG\n",
10151018
")\n",
10161019
"\n",
10171020
"# Step 3: Create a new `PolicyFunction` that modifies the tax deduction for children\n",

0 commit comments

Comments
 (0)