Skip to content

Commit

Permalink
Change name of eligibility var
Browse files Browse the repository at this point in the history
  • Loading branch information
okeyiii committed Feb 15, 2024
1 parent 53d2cfe commit 3021046
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,38 @@
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

- name: Nova Scotia Age amonut supplement; eligible age with eligible taxable income between 25_000 and 75_000
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

- name: Nova Scotia Age tax credit; eligible age with ineligible taxable income more than 75_000
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

- name: Nova Scotia Age tax credit; ineligible age with eligible taxable income
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

- name: Nova Scotia Age tax credit; ineligible age with ineligible taxable income
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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -13,28 +13,28 @@
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
input:
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
input:
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
input:
province_code: NS
age: 70
output:
ns_age_amount_supplement_eligible: true
ns_age_amount_eligible: true
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@
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",
"https://nslegislature.ca/sites/default/files/legc/statutes/income%20tax.pdf#page=28",
)

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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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

0 comments on commit 3021046

Please sign in to comment.