diff --git a/policyengine_uk/variables/gov/hmrc/tax_free_childcare/conditions/childcare_age_child_condition.py b/policyengine_uk/variables/gov/hmrc/tax_free_childcare/conditions/childcare_age_child_condition.py index 65a134aa..8ec5346b 100644 --- a/policyengine_uk/variables/gov/hmrc/tax_free_childcare/conditions/childcare_age_child_condition.py +++ b/policyengine_uk/variables/gov/hmrc/tax_free_childcare/conditions/childcare_age_child_condition.py @@ -5,9 +5,7 @@ class child_age_eligible(Variable): value_type = bool entity = Person label = "Child age eligibility requirements" - documentation = ( - "Whether this person meets the age and disability requirements for eligibility" - ) + documentation = "Whether this person meets the age and disability requirements for eligibility" definition_period = YEAR def formula(person, period, parameters): @@ -17,16 +15,11 @@ def formula(person, period, parameters): Returns: bool: True if eligible (under standard age limit, or under disability age limit with disability), False otherwise """ - # Get the benefit unit the person belongs to - benunit = person.benunit - # Get person's characteristics age = person("age", period) # Get age thresholds from parameters - age_limits = parameters( - period - ).gov.hmrc.childcare_subsidies.tax_free_childcare.age_limits + age_limits = parameters(period).gov.hmrc.childcare_subsidies.tax_free_childcare.age_limits standard_age_limit = age_limits.standard_age_limit disability_age_limit = age_limits.disability_age_limit @@ -47,4 +40,4 @@ def formula(person, period, parameters): # Combine conditions eligible = basic_age_condition | (age_under_disability_limit & is_disabled) - return eligible + return eligible \ No newline at end of file diff --git a/policyengine_uk/variables/gov/hmrc/tax_free_childcare/conditions/childcare_income_condition.py b/policyengine_uk/variables/gov/hmrc/tax_free_childcare/conditions/childcare_income_condition.py index 2f91e7c8..7e1dcca2 100644 --- a/policyengine_uk/variables/gov/hmrc/tax_free_childcare/conditions/childcare_income_condition.py +++ b/policyengine_uk/variables/gov/hmrc/tax_free_childcare/conditions/childcare_income_condition.py @@ -9,8 +9,7 @@ class meets_income_requirements(Variable): definition_period = YEAR def formula(person, period, parameters): - """ - Calculate if a person meets income requirements based on their age and income. + """Calculate if a person meets income requirements based on their age and income. Returns: bool: True if they meet the income conditions for their age group @@ -35,9 +34,7 @@ def formula(person, period, parameters): yearly_eligible_income = total_income - investment_income # Get income thresholds from parameters - income_limits = parameters( - period - ).gov.hmrc.childcare_subsidies.tax_free_childcare.income_thresholds + income_limits = parameters(period).gov.hmrc.childcare_subsidies.tax_free_childcare.income_thresholds quarterly_income = yearly_eligible_income / 4 # Age >= 21 @@ -58,6 +55,4 @@ def formula(person, period, parameters): ) # Combine all conditions - return ( - meets_adult_condition | meets_young_adult_condition | meets_youth_condition - ) + return meets_adult_condition | meets_young_adult_condition | meets_youth_condition \ No newline at end of file diff --git a/policyengine_uk/variables/gov/hmrc/tax_free_childcare/conditions/childcare_work_condition.py b/policyengine_uk/variables/gov/hmrc/tax_free_childcare/conditions/childcare_work_condition.py index 93e278a1..0d3ad034 100644 --- a/policyengine_uk/variables/gov/hmrc/tax_free_childcare/conditions/childcare_work_condition.py +++ b/policyengine_uk/variables/gov/hmrc/tax_free_childcare/conditions/childcare_work_condition.py @@ -5,14 +5,11 @@ class childcare_work_condition(Variable): value_type = bool entity = Person label = "Work conditions for tax-free childcare" - documentation = ( - "Whether the person/couple meets work requirements for tax-free childcare" - ) + documentation = "Whether the person/couple meets work requirements for tax-free childcare" definition_period = YEAR def formula(person, period, parameters): - """ - Calculate if person meets work conditions for: + """Calculate if person meets work conditions for: - Single working adult - Couple where either both work or one works and other has disability/incapacity """ @@ -48,13 +45,11 @@ def formula(person, period, parameters): is_partner_working_with_disabled_person = ( is_couple & partner_in_work & (is_disabled | has_incapacity) ) - is_person_working_with_disabled_partner = ( - is_couple & in_work & partner_has_condition - ) + is_person_working_with_disabled_partner = is_couple & in_work & partner_has_condition return ( single_working | couple_both_working | is_person_working_with_disabled_partner | is_partner_working_with_disabled_person - ) + ) \ No newline at end of file diff --git a/policyengine_uk/variables/gov/hmrc/tax_free_childcare/tax_free_childcare_benefits.py b/policyengine_uk/variables/gov/hmrc/tax_free_childcare/tax_free_childcare_benefits.py index 0f8a3de5..b277be76 100644 --- a/policyengine_uk/variables/gov/hmrc/tax_free_childcare/tax_free_childcare_benefits.py +++ b/policyengine_uk/variables/gov/hmrc/tax_free_childcare/tax_free_childcare_benefits.py @@ -10,8 +10,7 @@ class tax_free_childcare(Variable): unit = GBP def formula(benunit, period, parameters): - """ - Calculate the government contribution for tax-free childcare. + """Calculate the government contribution for tax-free childcare. Args: benunit: The benefit unit @@ -25,9 +24,7 @@ def formula(benunit, period, parameters): parents_contribution = benunit("childcare_cost", period) # Get parameters from the parameter tree - p = parameters( - period - ).gov.hmrc.childcare_subsidies.tax_free_childcare.contribution_parameters + p = parameters(period).gov.hmrc.childcare_subsidies.tax_free_childcare.contribution_parameters # Check eligibility conditions meets_age_condition = benunit("child_age_eligible", period) @@ -55,4 +52,4 @@ def formula(benunit, period, parameters): max_amount, ) - return where(is_eligible, government_contribution, 0) + return where(is_eligible, government_contribution, 0) \ No newline at end of file