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

Extended childcare entitlement #1007

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open

Extended childcare entitlement #1007

wants to merge 45 commits into from

Conversation

vahid-ahmadi
Copy link
Collaborator

@vahid-ahmadi vahid-ahmadi commented Jan 15, 2025

Overview

This PR implements the 15/30-hour free childcare (working parent) scheme calculation in PolicyEngine UK. The scheme provides government contributions towards childcare costs for eligible families. (Documentation link)

Key Features

  • 15/30 hours of free childcare programs
  • Income threshold of £100,000 per partner
  • Output type: boolean variables that show eligibility

Fixes #1006

@vahid-ahmadi vahid-ahmadi changed the title 5/30 hours free childcare 5/30 hours free childcare (working parent) Jan 17, 2025
@vahid-ahmadi vahid-ahmadi changed the title 5/30 hours free childcare (working parent) 15/30 hours free childcare (working parent) Jan 17, 2025
@vahid-ahmadi vahid-ahmadi changed the title 15/30 hours free childcare (working parent) 15/30-hour free childcare (working parent) Jan 17, 2025
@vahid-ahmadi vahid-ahmadi changed the title 15/30-hour free childcare (working parent) Extended childcare entitlement Jan 22, 2025
Copy link
Collaborator

@MaxGhenis MaxGhenis left a comment

Choose a reason for hiding this comment

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

Some of these suggestions are in specific places but please apply them generally in this and other PRs

- title: Extended childcare entitlement guidance
href: https://www.gov.uk/check-eligible-free-childcare-if-youre-working?step-by-step-nav=f517cd57-3c18-4bb9-aa8b-1b907e279bf9
values:
2015-01-01: 0.75
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
2015-01-01: 0.75
2015-01-01: 0.75 # Nine months.

@@ -0,0 +1,12 @@
description: The department for education provides the extended childcare entitlement program eligibility to children from this minimum age.
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
description: The department for education provides the extended childcare entitlement program eligibility to children from this minimum age.
description: The Department for Education provides the extended childcare entitlement to children this age or older.

metadata:
unit: year
period: year
label: minimum age eligibility for extended childcare entitlement program (15 hours of free childcare)
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
label: minimum age eligibility for extended childcare entitlement program (15 hours of free childcare)
label: Minimum age for extended childcare entitlement

definition_period = YEAR # Evaluate eligibility on a yearly basis

def formula(person, period, parameters):
"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove docstring - by convention we put these in the class attributes

Copy link
Collaborator

Choose a reason for hiding this comment

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

Refer to the program in filenames/paths/variables as extended_childcare_entitlement without the 15_hours, as that's a policy parameter.


# Calculate eligible income
total_income = person("total_income", period)
# Extract investment incomes to subtract
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is this defined in the law? Let's make it a list parameter.

period
).gov.dwp.extended_childcare_entitlement.income_thresholds

required_threshold = income_limits.calc(age) * 4
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's 4 from?

from policyengine_uk.model_api import *


class extended_childcare_entitlement_income_requirements(Variable):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same with filename, which should always match the variable name

Suggested change
class extended_childcare_entitlement_income_requirements(Variable):
class extended_childcare_entitlement_income_eligible(Variable):

bool: True if the child is eligible for 30 hours, False otherwise.
"""
# Get the child's age
age = person("age", period)
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
age = person("age", period)
p = parameters(period).gov.dwp.extended_childcare_entitlement.eligibility
return p.second_entitlement.calc(person("age", period))

)

# Build conditions for Couples
is_couple = (benunit.sum(is_adult) == 2).astype(bool)
Copy link
Collaborator

Choose a reason for hiding this comment

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

In general should almost never need to cast

Suggested change
is_couple = (benunit.sum(is_adult) == 2).astype(bool)
is_couple = benunit.sum(is_adult) == 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add extended childcare entitlement
2 participants