Skip to content

Commit 451e5b1

Browse files
vahid-ahmadiclaude
andcommitted
feat: add in_effect parameter check to base scottish_child_payment variable
Enable parametric SCP baby bonus by checking gov.contrib.scotland.scottish_child_payment.in_effect in the base variable. When in_effect=True, children under 1 receive £40/week total instead of the standard rate. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 052b91e commit 451e5b1

1 file changed

Lines changed: 24 additions & 5 deletions

File tree

policyengine_uk/variables/gov/social_security_scotland/scottish_child_payment.py

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,10 @@ def formula(benunit, period, parameters):
3434

3535
# Count eligible children in the benefit unit
3636
is_eligible_child = benunit.members("is_scp_eligible_child", period)
37-
eligible_children = benunit.sum(is_eligible_child)
3837

39-
# Count children under 6 and 6+ for takeup rate calculation
38+
# Get ages for baby bonus calculation
4039
age = benunit.members("age", period)
4140
is_child = benunit.members("is_child", period)
42-
children_under_6 = benunit.sum(is_child & (age < 6))
4341
children_6_and_over = benunit.sum(is_child & (age >= 6) & (age < 16))
4442

4543
# Check if receiving a qualifying benefit
@@ -79,8 +77,29 @@ def formula(benunit, period, parameters):
7977
| receives_pension_credit
8078
)
8179

82-
# Calculate annual payment
83-
annual_amount = eligible_children * weekly_amount * WEEKS_IN_YEAR
80+
# Check if SCP Premium for under-ones is enabled (parametric reform)
81+
# This allows enabling via parameter_changes without structural reform
82+
baby_bonus_in_effect = parameters(
83+
period
84+
).gov.contrib.scotland.scottish_child_payment.in_effect
85+
86+
# SCP Premium for under-ones: Fixed £40/week total for babies under 1
87+
# Policy: Children under 1 get £40/week, children 1+ get standard rate
88+
# Source: Scottish Budget 2026-27
89+
PREMIUM_RATE_UNDER_ONE = 40.0 # £40/week fixed total
90+
91+
# Calculate per-child weekly amount based on age (if reform is active)
92+
per_child_weekly = where(
93+
baby_bonus_in_effect & (age < 1),
94+
PREMIUM_RATE_UNDER_ONE, # £40/week for under-1s (TOTAL, not bonus)
95+
weekly_amount, # Standard SCP rate for 1+ or when reform inactive
96+
)
97+
98+
# Calculate total weekly payment for all eligible children
99+
total_weekly = benunit.sum(per_child_weekly * is_eligible_child)
100+
101+
# Convert to annual amount
102+
annual_amount = total_weekly * WEEKS_IN_YEAR
84103

85104
# Apply age-specific take-up rates in microsimulation
86105
# 97% for families with only children under 6

0 commit comments

Comments
 (0)