Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Universal childcare entitlement #1010

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description: The Department for Education converts childcare hours into expenses for universal childcare entitlement at this rate.
metadata:
type: single_amount
threshold_unit: year
amount_unit: currency-GBP
label: universal childcare entitlement hourly rates
reference:
- title: House of Commons Library
href: https://commonslibrary.parliament.uk/research-briefings/cbp-8052/
values:
2015-01-01: 5.88
Copy link
Collaborator

Choose a reason for hiding this comment

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

What about other ages?

The national average hourly funding rates for local authorities in 2024/25 are:

Three and four-year-olds: £5.88 per hour. The rate has fallen by 3% in real terms (when adjusted for inflation) since 2017/18 (in 2024/25 prices).
Two-year-olds: £8.28 per hour. The rate has increased by 21% in real terms since 2017/18 and by 35% since 2023/24.
Children under two: £11.22 per hour.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
description: The Department for Education provides universal childcare entitlement in England, specifying the eligible age range and number of hours per year.
metadata:
type: single_amount
threshold_unit: year
amount_unit: hour
label: universal childcare entitlement hours
reference:
- title: Childcare (Early Years Provision Free of Charge) (Extended Entitlement) Regulations 2016 - Regulation 35(3)
vahid-ahmadi marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you point more specifically? 570 is is in 35(1), i see the third birthday in (3) but not (quickly scanning) the compulsory school age part

href: https://www.legislation.gov.uk/uksi/2016/1257/part/4/made
- title: Education Act 1996 - Section 8 (Compulsory School Age)
href: https://www.legislation.gov.uk/ukpga/1996/56/section/8
# In England, children are eligible for universal childcare entitlement from age 3 until they reach compulsory school age, which is defined as the start of the term after their fifth birthday.
brackets:
- threshold:
2015-01-01: 0
amount:
2015-01-01: 0
- threshold:
2015-01-01: 3
amount:
2015-01-01: 570
- threshold:
2015-01-01: 5
amount:
2015-01-01: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
- name: Child under 3 isn't eligible
period: 2024
input:
people:
child:
age: 2
benunits:
benunit:
members: ["child"]
output:
universal_childcare_entitlement: [0]

- name: Child aged 3 is eligible
period: 2024
input:
people:
child:
age: 3
universal_childcare_entitlement_hours: 570
benunits:
benunit:
members: ["child"]
output:
universal_childcare_entitlement: [3351.60]

- name: Child aged 4 is eligible
period: 2024
input:
people:
child:
age: 4
universal_childcare_entitlement_hours: 570
benunits:
benunit:
members: ["child"]
output:
universal_childcare_entitlement: [3351.60]

- name: Multiple children different ages, some eligible
period: 2024
input:
people:
parent:
age: 35
child1:
age: 2
child2:
age: 3
universal_childcare_entitlement_hours: 570
child3:
age: 4
universal_childcare_entitlement_hours: 570
child4:
age: 5
benunits:
benunit:
members: ["parent", "child1", "child2", "child3", "child4"]
output:
universal_childcare_entitlement: [0, 0, 3351.60, 3351.60, 0]

- name: Family with twins - both eligible for full entitlement
vahid-ahmadi marked this conversation as resolved.
Show resolved Hide resolved
period: 2024
input:
people:
parent:
age: 35
twin1:
age: 3
universal_childcare_entitlement_hours: 570
twin2:
age: 3
universal_childcare_entitlement_hours: 570
benunits:
benunit:
members: ["parent", "twin1", "twin2"]
output:
universal_childcare_entitlement: [0, 3351.60, 3351.60]
Copy link
Collaborator

Choose a reason for hiding this comment

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

since these are person-level variables that don't depend on attributes of other household members, please simplify the unit tests to operate at the person level. some of these could still provide value as integration tests though

Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
- name: Child under 3 - no entitlement
period: 2024
input:
people:
child:
age: 2
benunits:
benunit:
members: ["child"]
output:
universal_childcare_entitlement_hours: [0]

- name: Child aged 3 - full entitlement
period: 2024
input:
people:
child:
age: 3
benunits:
benunit:
members: ["child"]
output:
universal_childcare_entitlement_hours: [570]

- name: Child aged 4 - full entitlement
period: 2024
input:
people:
child:
age: 4
benunits:
benunit:
members: ["child"]
output:
universal_childcare_entitlement_hours: [570]

- name: Child aged 5 - no entitlement
period: 2024
input:
people:
child:
age: 5
benunits:
benunit:
members: ["child"]
output:
universal_childcare_entitlement_hours: [0]

- name: Family with multiple children - mixed entitlement
period: 2024
input:
people:
parent:
age: 35
child1:
age: 2
child2:
age: 3
child3:
age: 4
child4:
age: 5
benunits:
benunit:
members: ["parent", "child1", "child2", "child3", "child4"]
output:
universal_childcare_entitlement_hours: [0, 0, 570, 570, 0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from policyengine_uk.model_api import *


class universal_childcare_entitlement(Variable):
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we limit to england?

value_type = float
entity = Person
label = "universal childcare entitlement amount per year"
definition_period = YEAR
unit = "currency-GBP"

def formula(person, period, parameters):
# Get the hours entitled for this child
hours = person("universal_childcare_entitlement_hours", period)

# Get the funding rate from parameters
p = parameters(period).gov.dwp.universal_childcare_entitlement
rate = p.funding_rate
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use p. directly to indicate it's a parameter

Suggested change
rate = p.funding_rate
return hours * p.funding_rate

return hours * rate
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from policyengine_uk.model_api import *


class universal_childcare_entitlement_hours(Variable):
value_type = float
entity = Person
label = "universal childcare entitlement hours per year"
definition_period = YEAR
unit = "hour"

def formula(person, period, parameters):
# Get parameters with the correct path
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# Get parameters with the correct path

p = parameters(period).gov.dwp.universal_childcare_entitlement

# Calculate hours based on age using the brackets structure
age = person("age", period)
return p.hours.calc(age)
1 change: 1 addition & 0 deletions policyengine_uk/variables/household/income/benefit.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class household_benefits(Variable):
"other_public_spending_budget_change",
"tax_free_childcare",
"extended_childcare_entitlement",
"universal_childcare_entitlement",
]

def formula(household, period, parameters):
Expand Down