From 30210462c954c0718bbd81c42f985f34c244215c Mon Sep 17 00:00:00 2001 From: okeyiii <96802936+okeyiii@users.noreply.github.com> Date: Thu, 15 Feb 2024 23:14:44 +0000 Subject: [PATCH] Change name of eligibility var Fixes #455 --- .../income/credits/age/ns_age_amount_supplement.yaml | 10 +++++----- .../credits/age/ns_age_amount_supplement_eligible.yaml | 10 +++++----- .../tax/income/credits/age/ns_age_amount_supplement.py | 8 +++++--- .../credits/age/ns_age_amount_supplement_eligible.py | 4 ++-- .../ns/tax/income/credits/age/ns_age_tax_credit.py | 4 ++-- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.yaml b/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.yaml index e239929f2..3e2525887 100644 --- a/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.yaml +++ b/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.yaml @@ -2,7 +2,7 @@ period: 2023 input: ns_taxable_income: 24_999 - ns_age_amount_supplement_eligible: true + ns_age_amount_eligible: true output: ns_age_amount_supplement: 1_465 @@ -10,7 +10,7 @@ period: 2023 input: ns_taxable_income: 65_000 - ns_age_amount_supplement_eligible: true + ns_age_amount_eligible: true output: ns_age_amount_supplement: 293 @@ -18,7 +18,7 @@ period: 2023 input: ns_taxable_income: 75_001 - ns_age_amount_supplement_eligible: true + ns_age_amount_eligible: true output: ns_age_amount_supplement: 0 @@ -26,7 +26,7 @@ period: 2023 input: ns_taxable_income: 24_999 - ns_age_amount_supplement_eligible: false + ns_age_amount_eligible: false output: ns_age_amount_supplement: 0 @@ -34,6 +34,6 @@ period: 2023 input: ns_taxable_income: 75_001 - ns_age_amount_supplement_eligible: false + ns_age_amount_eligible: false output: ns_age_amount_supplement: 0 diff --git a/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement_eligible.yaml b/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement_eligible.yaml index c4461912e..6cb218658 100644 --- a/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement_eligible.yaml +++ b/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement_eligible.yaml @@ -4,7 +4,7 @@ province_code: NS age: 65 output: - ns_age_amount_supplement_eligible: true + ns_age_amount_eligible: true - name: Nova Scotia Age amonut supplement; lower than 65 is not an eligible age @@ -13,7 +13,7 @@ province_code: NS age: 64 output: - ns_age_amount_supplement_eligible: false + ns_age_amount_eligible: false - name: Nova Scotia Age amonut supplement; lower than 65 is not an eligible age period: 2023 @@ -21,7 +21,7 @@ province_code: NS age: 50 output: - ns_age_amount_supplement_eligible: false + ns_age_amount_eligible: false - name: Nova Scotia Age amonut supplement; higher than 65 is eligible age period: 2023 @@ -29,7 +29,7 @@ province_code: NS age: 67 output: - ns_age_amount_supplement_eligible: true + ns_age_amount_eligible: true - name: Nova Scotia Age amonut supplement; higher than 65 is eligible age period: 2023 @@ -37,4 +37,4 @@ province_code: NS age: 70 output: - ns_age_amount_supplement_eligible: true + ns_age_amount_eligible: true diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.py index b1074a8b5..a68b21c6a 100644 --- a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.py +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.py @@ -4,10 +4,10 @@ class ns_age_amount_supplement(Variable): value_type = float entity = Person - label = "Nova Scotia Age Amount Supplement" + label = "Nova Scotia age amount supplement" unit = CAD definition_period = YEAR - defined_for = "ns_age_amount_supplement_eligible" + defined_for = "ns_age_amount_eligible" reference = ( "https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1", "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1ns-ws/td1ns-ws-23e.pdf#page=1", @@ -15,7 +15,9 @@ class ns_age_amount_supplement(Variable): ) def formula(person, period, parameters): - p = parameters(period).gov.provinces.ns.tax.income.credits.age.supplement + p = parameters( + period + ).gov.provinces.ns.tax.income.credits.age.supplement taxable_income = person("ns_taxable_income", period) # Calculate additional amount added to base amount diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement_eligible.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement_eligible.py index b497e582c..05b4e4330 100644 --- a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement_eligible.py +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement_eligible.py @@ -1,10 +1,10 @@ from policyengine_canada.model_api import * -class ns_age_amount_supplement_eligible(Variable): +class ns_age_amount_eligible(Variable): value_type = bool entity = Person - label = "Eligible for the Nova Scotia Age Amount Supplement" + label = "Eligible for the Nova Scotia age amount and age amount supplement" definition_period = YEAR defined_for = ProvinceCode.NS reference = ( diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_tax_credit.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_tax_credit.py index ce348f92d..ff7c0dcf2 100644 --- a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_tax_credit.py +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_tax_credit.py @@ -6,7 +6,7 @@ class ns_age_tax_credit(Variable): entity = Person label = "Nova Scotia Age tax credit" definition_period = YEAR - defined_for = "ns_age_amount_supplement_eligible" + defined_for = "ns_age_amount_eligible" reference = ( "https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1", "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1ns-ws/td1ns-ws-23e.pdf#page=1", @@ -17,6 +17,6 @@ def formula(person, period, parameters): age = person("age", period) income = person("ns_taxable_income", period) p = parameters(period).gov.provinces.ns.tax.income.credits.age - eligibility = (income < p.income_eligibility) + eligibility = income < p.income_eligibility return eligibility * p.amount