diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/additional_amount.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/additional_amount.yaml index 9f6a60f12..86dd7cf1a 100644 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/additional_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/additional_amount.yaml @@ -1,4 +1,4 @@ -description: Nova Scotia additional amount in basic personal amount. +description: Nova Scotia provides this additional amount under the basic personal amount. values: 2022-01-01: 3_000 metadata: diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/applicable_rate.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/applicable_rate.yaml index 565fc47bf..c2a8dcad6 100644 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/applicable_rate.yaml +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/applicable_rate.yaml @@ -1,4 +1,4 @@ -description: Nova Scotia applicable rate for calculating partial basic personal amount in basic personal amount. +description: Nova Scotia employs this applicable rate for calculating partial basic personal amounts. values: 2022-01-01: 0.06 metadata: diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/basic_amount.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/basic_amount.yaml index 938ee6829..0d368718b 100644 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/basic_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/basic_amount.yaml @@ -1,4 +1,4 @@ -description: Nova Scotia basic amount in basic personal amount. +description: Nova Scotia provides this basic amount under basic personal amount. values: 2022-01-01: 8_481 metadata: diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/higher_income_threshold.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/higher_income_threshold.yaml index f3869efe8..519438485 100644 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/higher_income_threshold.yaml +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/higher_income_threshold.yaml @@ -1,4 +1,4 @@ -description: Nova Scotia higher income threshold for minimum basic personal amount in basic personal amount. +description: Nova Scotia limits this higher income threshold under the basic personal amount eligibility. values: 2022-01-01: 75_000 metadata: diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/lower_income_threshold.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/lower_income_threshold.yaml index f2707cb88..7ae2de356 100644 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/lower_income_threshold.yaml +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/lower_income_threshold.yaml @@ -1,4 +1,4 @@ -description: Nova Scotia lower income threshold for maximum basic personal amount in basic personal amount. +description: Nova Scotia limits this lower income threshold under the basic personal amount eligibility. values: 2022-01-01: 25_000 metadata: diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_credits.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_credits.py index 1f2064b2d..d5f341704 100644 --- a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_credits.py +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_credits.py @@ -13,21 +13,30 @@ def formula(person, period, parameters): period ).gov.provinces.ns.tax.income.credits.ns_basic_personal_amount taxable_income = person("total_individual_pre_tax_income", period) + + # Income Condition + lower_income_condition = (taxable_income <= p.lower_income_threshold) + medium_income_condition = (p.lower_income_threshold + < taxable_income + < p.higher_income_threshold) + higher_income_condition = (taxable_income >= p.higher_income_threshold) + + # Basic Personal Amount + lower_basic_personal_amount = p.additional_amount + p.basic_amount + medium_basic_personal_amount = p.basic_amount + 3000 - p.applicable_rate * (taxable_income - p.lower_income_threshold) + higher_basic_personal_amount = p.basic_amount + + return select( [ - taxable_income <= p.lower_income_threshold, - p.lower_income_threshold - < taxable_income - < p.higher_income_threshold, - taxable_income >= p.higher_income_threshold, + lower_income_condition, + medium_income_condition, + higher_income_condition, ], [ - p.additional_amount + p.basic_amount, - p.basic_amount - + 3000 - - p.applicable_rate - * (taxable_income - p.lower_income_threshold), - p.basic_amount, + lower_basic_personal_amount, + medium_basic_personal_amount, + higher_basic_personal_amount, ], )