Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

33 changes: 27 additions & 6 deletions policyengine_uk/parameters/gov/ons/population.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,34 @@ values:
2020-01-01: 67_100_000
2021-01-01: 67_400_000
2022-01-01: 67_600_000
2023-01-01: 67_800_000
2024-01-01: 68_100_000
2025-01-01: 68_300_000
2026-01-01: 68_500_000
2027-01-01: 68_700_000
# Projections:
2023-01-01: 68_500_000
2024-01-01: 69_200_000
2025-01-01: 69_900_000
2026-01-01: 70_400_000
2027-01-01: 70_900_000
2028-01-01: 71_200_000
2029-01-01: 71_500_000
2030-01-01: 71_900_000
2031-01-01: 72_200_000
2032-01-01: 72_500_000
2033-01-01: 72_800_000
2034-01-01: 73_100_000
2035-01-01: 73_400_000
2036-01-01: 73_700_000
2037-01-01: 74_000_000
2038-01-01: 74_300_000
2039-01-01: 74_500_000
2040-01-01: 74_800_000
2041-01-01: 75_100_000
2042-01-01: 75_300_000
2043-01-01: 75_600_000
2044-01-01: 75_800_000
2045-01-01: 76_100_000
2046-01-01: 76_300_000
2047-01-01: 76_600_000
metadata:
unit: household
reference:
- title: National population projections (2020-based interim) | ONS | Figure 1
href: https://www.ons.gov.uk/peoplepopulationandcommunity/populationandmigration/populationprojections/bulletins/nationalpopulationprojections/2020basedinterim
href: https://www.ons.gov.uk/peoplepopulationandcommunity/populationandmigration/populationprojections/bulletins/nationalpopulationprojections/2022based
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- name: Eligible for 30 hours - All conditions met
period: 2025
absolute_error_margin: 1
input:
people:
child1:
Expand All @@ -9,10 +10,11 @@
members: [child1]
extended_childcare_entitlement_eligible: true
output:
extended_childcare_entitlement: 6_703.2 # Matches expected calculation
extended_childcare_entitlement: 6_872.3

- name: Eligible for 15 hours - All first conditions met
period: 2025
absolute_error_margin: 1
input:
people:
child1:
Expand All @@ -22,10 +24,11 @@
members: [child1]
extended_childcare_entitlement_eligible: true
output:
extended_childcare_entitlement: 4_719.6 # Matches expected calculation
extended_childcare_entitlement: 4_838.7

- name: Not eligible (one condition not met)
period: 2025
absolute_error_margin: 1
input:
people:
child1:
Expand All @@ -39,6 +42,7 @@

- name: Eligible for mixed hours - Family with multiple children
period: 2025
absolute_error_margin: 1
input:
people:
child1:
Expand All @@ -50,10 +54,11 @@
members: [child1, child2]
extended_childcare_entitlement_eligible: true
output:
extended_childcare_entitlement: 11_422.8 # Matches expected calculation
extended_childcare_entitlement: 11_711.1

- name: Not eligible - Family with multiple children but conditions not met
period: 2025
absolute_error_margin: 1
input:
people:
child1:
Expand All @@ -69,6 +74,7 @@

- name: Eligible with one working parent and one disabled parent
period: 2025
absolute_error_margin: 1
input:
people:
child1:
Expand All @@ -83,10 +89,11 @@
family_type: COUPLE_WITH_CHILDREN
extended_childcare_entitlement_eligible: true
output:
extended_childcare_entitlement: 18_126.0 # Matches expected calculation
extended_childcare_entitlement: 18_583.5

- name: No expenses for zero hours
period: 2025
absolute_error_margin: 1
input:
people:
child1:
Expand All @@ -96,4 +103,4 @@
members: [child1]
extended_childcare_entitlement_eligible: false
output:
extended_childcare_entitlement: 0 # Not eligible
extended_childcare_entitlement: 0 # Not eligible
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
- name: Eligible - Lives in England with all conditions met
period: 2025
input:
households:
household1:
members: [parent1, parent2, child1]
country: ENGLAND
people:
parent1:
is_child: false
extended_childcare_entitlement_meets_income_requirements: true
extended_childcare_entitlement_work_condition: true
parent2:
is_child: false
extended_childcare_entitlement_meets_income_requirements: true
extended_childcare_entitlement_work_condition: false
child1:
is_child: true
extended_childcare_entitlement_work_condition: false
benunits:
benunit1:
members: [parent1, parent2, child1]
output:
extended_childcare_entitlement_eligible: true

- name: Not eligible - Lives in Scotland with all other conditions met
period: 2025
input:
households:
household1:
members: [parent1, parent2, child1]
country: SCOTLAND
people:
parent1:
is_child: false
extended_childcare_entitlement_meets_income_requirements: true
extended_childcare_entitlement_work_condition: true
parent2:
is_child: false
extended_childcare_entitlement_meets_income_requirements: true
extended_childcare_entitlement_work_condition: false
child1:
is_child: true
extended_childcare_entitlement_work_condition: false
benunits:
benunit1:
members: [parent1, parent2, child1]
output:
extended_childcare_entitlement_eligible: false

- name: Not eligible - Lives in England but income condition not met
period: 2025
input:
households:
household1:
members: [parent1, parent2, child1]
country: ENGLAND
people:
parent1:
is_child: false
extended_childcare_entitlement_meets_income_requirements: false
extended_childcare_entitlement_work_condition: true
parent2:
is_child: false
extended_childcare_entitlement_meets_income_requirements: true
extended_childcare_entitlement_work_condition: false
child1:
is_child: true
extended_childcare_entitlement_work_condition: false
benunits:
benunit1:
members: [parent1, parent2, child1]
output:
extended_childcare_entitlement_eligible: false

- name: Not eligible - Lives in England but work condition not met
period: 2025
input:
households:
household1:
members: [parent1, parent2, child1]
country: ENGLAND
people:
parent1:
is_child: false
extended_childcare_entitlement_meets_income_requirements: true
extended_childcare_entitlement_work_condition: false
parent2:
is_child: false
extended_childcare_entitlement_meets_income_requirements: true
extended_childcare_entitlement_work_condition: false
child1:
is_child: true
extended_childcare_entitlement_work_condition: false
benunits:
benunit1:
members: [parent1, parent2, child1]
output:
extended_childcare_entitlement_eligible: false

- name: Eligible - Single parent in England meeting all conditions
period: 2025
input:
households:
household1:
members: [parent1, child1]
country: ENGLAND
people:
parent1:
is_child: false
extended_childcare_entitlement_meets_income_requirements: true
extended_childcare_entitlement_work_condition: true
child1:
is_child: true
extended_childcare_entitlement_work_condition: false
benunits:
benunit1:
members: [parent1, child1]
output:
extended_childcare_entitlement_eligible: true

- name: Not eligible - Lives in Wales with all other conditions met
period: 2025
input:
households:
household1:
members: [parent1, child1]
country: WALES
people:
parent1:
is_child: false
extended_childcare_entitlement_meets_income_requirements: true
extended_childcare_entitlement_work_condition: true
child1:
is_child: true
extended_childcare_entitlement_work_condition: false
benunits:
benunit1:
members: [parent1, child1]
output:
extended_childcare_entitlement_eligible: false
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,22 @@ class extended_childcare_entitlement(Variable):
defined_for = "extended_childcare_entitlement_eligible"

def formula(benunit, period, parameters):

# Get parameters
p = parameters(period).gov.dfe.extended_childcare_entitlement
p = parameters(period).gov.dfe
age = benunit.members("age", period)

# Compute weekly hours directly inside this function
weekly_hours_per_child = p.hours.calc(age)
weekly_hours_per_child = p.extended_childcare_entitlement.hours.calc(
age
)

# Compute subsidy per child
subsidy_per_child = weekly_hours_per_child * p.expense_rate.calc(age)
# Compute weekly subsidy per child
weekly_subsidy_per_child = (
weekly_hours_per_child * p.childcare_funding_rate.calc(age)
)

# Compute total annual expenses
return benunit.sum(subsidy_per_child) * p.weeks_per_year
return (
benunit.sum(weekly_subsidy_per_child)
* p.extended_childcare_entitlement.weeks_per_year
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
class extended_childcare_entitlement_eligible(Variable):
value_type = bool
entity = BenUnit
label = "Eligiblity for extended childcare entitlement"
label = "eligibility for extended childcare entitlement"
definition_period = YEAR

def formula(benunit, period, parameters):
# Check if household is in England
country = benunit.household("country", period)
countries = country.possible_values
in_england = country == countries.ENGLAND

# Check income condition - must be true for all family members (except children)
person = benunit.members
person_meets_income_condition = person(
Expand All @@ -22,4 +27,4 @@ def formula(benunit, period, parameters):
> 0
)

return meets_income_condition & work_eligible
return in_england & meets_income_condition & work_eligible
1 change: 1 addition & 0 deletions policyengine_uk/variables/gov/gov_spending.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ class gov_spending(Variable):
"education_budget_change",
"other_public_spending_budget_change",
"tax_free_childcare",
"extended_childcare_entitlement",
"universal_childcare_entitlement",
]