Skip to content

Commit

Permalink
Implement universal 15-hours free childcare
Browse files Browse the repository at this point in the history
  • Loading branch information
vahid-ahmadi committed Jan 17, 2025
1 parent 789f676 commit cd3ff72
Show file tree
Hide file tree
Showing 7 changed files with 160 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: Maximum age for universal free childcare eligibility (3 and 4 year olds)
metadata:
unit: year
period: year
label: Maximum age for universal free childcare
reference:
- title: Childcare and early education
href: https://www.gov.uk/help-with-childcare-costs/free-childcare-and-education-for-3-to-4-year-olds?step-by-step-nav=f237ec8e-e82c-4ffa-8fba-2a88a739783b
- title: Parliamentary Research Briefing - Childcare
href: https://researchbriefings.files.parliament.uk/documents/CBP-8054/CBP-8054.pdf.#:~:text=All%20three%20and%20four%2Dyear%2Dolds%20in%20England%20are%20eligible,and%20applies%20irrespective%20of%20income.
values:
2015-01-01: 5
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: Minimum age for universal free childcare eligibility (3 and 4 year olds)
metadata:
unit: year
period: year
label: Minimum age for universal free childcare
reference:
- title: Childcare and early education
href: https://www.gov.uk/help-with-childcare-costs/free-childcare-and-education-for-3-to-4-year-olds?step-by-step-nav=f237ec8e-e82c-4ffa-8fba-2a88a739783b
- title: Parliamentary Research Briefing - Childcare
href: https://researchbriefings.files.parliament.uk/documents/CBP-8054/CBP-8054.pdf.#:~:text=All%20three%20and%20four%2Dyear%2Dolds%20in%20England%20are%20eligible,and%20applies%20irrespective%20of%20income.
values:
2015-01-01: 3
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: Number of universal free childcare hours provided per year for 3-4 year olds
metadata:
unit: hour
period: year
label: Annual universal free childcare hours
reference:
- title: Childcare and early education
href: https://www.gov.uk/help-with-childcare-costs/free-childcare-and-education-for-3-to-4-year-olds?step-by-step-nav=f237ec8e-e82c-4ffa-8fba-2a88a739783b
- title: Parliamentary Research Briefing - Childcare
href: https://researchbriefings.files.parliament.uk/documents/CBP-8054/CBP-8054.pdf.#:~:text=All%20three%20and%20four%2Dyear%2Dolds%20in%20England%20are%20eligible,and%20applies%20irrespective%20of%20income.
values:
2015-01-01: 570
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
- name: Eligible 3
period: 2025
input:
age: 3
is_child: true
output:
universal_free_childcare_eligibility: true


- name: Eligible 4
period: 2025
input:
age: 4
is_child: true
output:
universal_free_childcare_eligibility: true


- name: non Eligible 5
period: 2025
input:
age: 5
is_child: true
output:
universal_free_childcare_eligibility: false


- name: non Eligible 3
period: 2025
input:
age: 3
is_child: false
output:
universal_free_childcare_eligibility: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- name: Eligible child gets full hours
period: 2025
input:
universal_free_childcare_eligibility: true
output:
universal_free_childcare_hours: 570

- name: Non eligible child
period: 2025
input:
universal_free_childcare_eligibility: false
output:
universal_free_childcare_hours: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
from policyengine_uk.model_api import *


class universal_free_childcare_eligibility(Variable):
value_type = bool
entity = BenUnit
label = "Universal free childcare eligibility"
documentation = "Whether the benefit unit has any children eligible for universal free childcare (all 3-4 year olds)"
definition_period = YEAR

def formula(benunit, period, parameters):
"""
Calculate eligibility for universal free childcare.
All 3 and 4 year olds are eligible, regardless of parent's circumstances.
Args:
benunit: The benefit unit
period: The time period
parameters: Policy parameters
Returns:
bool: Whether the benefit unit has any eligible children
"""
# Get parameters
p = parameters(
period
).gov.dwp.childcare_subsidies.universal_free_childcare.age

# Get ages of all members in the benefit unit
age = benunit.members("age", period)

# Check if they are children
is_child = benunit.members("is_child", period)

# Check if age is within eligible range using parameters
is_eligible_age = (age >= p.min_age) & (age < p.max_age)

# Child must be within age range and officially counted as a child
has_eligible_child = benunit.any(is_child & is_eligible_age)

return has_eligible_child.astype(bool)
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from policyengine_uk.model_api import *


class universal_free_childcare_hours(Variable):
value_type = float
entity = BenUnit
label = "Universal free childcare hours per year"
documentation = (
"Number of free childcare hours per year the benefit unit is entitled to "
"under the universal offer for 3-4 year olds"
)
definition_period = YEAR
unit = "hour"

def formula(benunit, period, parameters):
"""
Calculate number of free hours the benefit unit is entitled to.
Args:
benunit: The benefit unit
period: The time period
parameters: Policy parameters
Returns:
float: Number of free childcare hours per year
"""
# Get eligibility status
is_eligible = benunit("universal_free_childcare_eligibility", period)

# Use hours directly from parameters file
hours = parameters(
period
).gov.dwp.childcare_subsidies.universal_free_childcare.hours_per_year_universal_free_childcare

# Return hours if eligible, 0 if not
return where(is_eligible, hours, 0)

0 comments on commit cd3ff72

Please sign in to comment.