From c00d35d897e214cb67dee7ffbe3e2b99c6d758a4 Mon Sep 17 00:00:00 2001 From: okeyiii <96802936+okeyiii@users.noreply.github.com> Date: Thu, 13 Jul 2023 20:37:09 +0000 Subject: [PATCH 01/21] Add parameters Co-authored-by: Yaohhhh --- .../ns_basic_personal_amount/additional_amount.yaml | 0 .../ns_basic_personal_amount/applicable_rate.yaml | 11 +++++++++++ .../ns_basic_personal_amount/basic_amount.yaml | 0 .../higher_income_threshold.yaml | 0 .../lower_income_threshold.yaml | 11 +++++++++++ 5 files changed, 22 insertions(+) create mode 100644 policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/additional_amount.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/applicable_rate.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/basic_amount.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/higher_income_threshold.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/lower_income_threshold.yaml 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 new file mode 100644 index 000000000..e69de29bb 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 new file mode 100644 index 000000000..1452ea156 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/applicable_rate.yaml @@ -0,0 +1,11 @@ +description: Nova Scotia applicable rate for calculating partial basic personal amount in basic personal amount. +values: + 2022-01-01: 0.06 +metadata: + unit: \1 + label: Nova Scotia Basic Personal Amount + reference: + - title: Nova Scotia Basic Personal Amount + href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf + - title: Nova Scotia Basic Personal Amount + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf \ No newline at end of file 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 new file mode 100644 index 000000000..e69de29bb 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 new file mode 100644 index 000000000..e69de29bb 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 new file mode 100644 index 000000000..4b03b0b99 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/lower_income_threshold.yaml @@ -0,0 +1,11 @@ +description: Nova Scotia lower income threshold for maximum basic personal amount in basic personal amount. +values: + 2022-01-01: 25_000 +metadata: + unit: currency-CAD + label: Nova Scotia Basic Personal Amount + reference: + - title: Nova Scotia Basic Personal Amount + href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf + - title: Nova Scotia Basic Personal Amount + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf \ No newline at end of file From bc34af8101b478f4c8602625da1b6f277bc8025d Mon Sep 17 00:00:00 2001 From: okeyiii <96802936+okeyiii@users.noreply.github.com> Date: Thu, 13 Jul 2023 21:38:42 +0000 Subject: [PATCH 02/21] Add Variables and Partial Tests --- .../additional_amount.yaml | 11 ++++++++++ .../applicable_rate.yaml | 2 +- .../basic_amount.yaml | 11 ++++++++++ .../higher_income_threshold.yaml | 11 ++++++++++ .../lower_income_threshold.yaml | 2 +- .../credits/ns_basic_personal_amount.yaml | 7 +++++++ .../credits/ns_basic_personal_credits.py | 21 +++++++++++++++++++ 7 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 policyengine_canada/tests/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.yaml create mode 100644 policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_credits.py 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 e69de29bb..735cffb14 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 @@ -0,0 +1,11 @@ +description: Nova Scotia additional amount in basic personal amount. +values: + 2022-01-01: 3_000 +metadata: + unit: currency-CAD + label: Nova Scotia Additional Personal Amount + reference: + - title: Nova Scotia Basic Personal Amount + href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf + - title: Nova Scotia Basic Personal Amount + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf \ No newline at end of file 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 1452ea156..c9eeab014 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 @@ -3,7 +3,7 @@ values: 2022-01-01: 0.06 metadata: unit: \1 - label: Nova Scotia Basic Personal Amount + label: Nova Scotia Basic Personal Amount Applicable Rate reference: - title: Nova Scotia Basic Personal Amount href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf 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 e69de29bb..1f063d7dd 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 @@ -0,0 +1,11 @@ +description: Nova Scotia basic amount in basic personal amount. +values: + 2022-01-01: 8_481 +metadata: + unit: currency-CAD + label: Nova Scotia Basic Personal Amount + reference: + - title: Nova Scotia Basic Personal Amount + href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf + - title: Nova Scotia Basic Personal Amount + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf \ No newline at end of file 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 e69de29bb..1f4383a4b 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 @@ -0,0 +1,11 @@ +description: Nova Scotia higher income threshold for minimum basic personal amount in basic personal amount. +values: + 2022-01-01: 75_000 +metadata: + unit: currency-CAD + label: Nova Scotia Basic Personal Amount Higher Income Threshold + reference: + - title: Nova Scotia Basic Personal Amount + href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf + - title: Nova Scotia Basic Personal Amount + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf \ No newline at end of file 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 4b03b0b99..fc57c40ad 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 @@ -3,7 +3,7 @@ values: 2022-01-01: 25_000 metadata: unit: currency-CAD - label: Nova Scotia Basic Personal Amount + label: Nova Scotia Basic Personal Amount Lower Income Threshold reference: - title: Nova Scotia Basic Personal Amount href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf diff --git a/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.yaml b/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.yaml new file mode 100644 index 000000000..31f16ecf4 --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.yaml @@ -0,0 +1,7 @@ +- name: Person has taxable income lower than 25_000 + period: 2023 + input: + province_code: NS + total_individual_pre_tax_income: 24_999 + output: + ns_basic_personal_credits: 11_481 \ No newline at end of file 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 new file mode 100644 index 000000000..a8f706a8b --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_credits.py @@ -0,0 +1,21 @@ +from policyengine_canada.model_api import * + + +class ns_basic_personal_credits(Variable): + value_type = float + entity = Person + label = "Nova Scotia Basic Personal Amount" + definition_period = YEAR + defined_for = ProvinceCode.NS + + def formula(person, period, parameters): + p = parameters(period).gov.provinces.ns.tax.income.credits.ns_basic_personal_amount + taxable_income = person("total_individual_pre_tax_income",period) + + return select([taxable_income <= p.lower_income_threshold, + p.lower_income_threshold < taxable_income < p.higher_income_threshold, + taxable_income >= p.higher_income_threshold], + + [p.additional_amount + p.basic_amount, + p.basic_amount + 3000 - p.applicable_rate*(taxable_income - p.lower_income_threshold), + p.basic_amount]) From 0f71af726415ca706a8e771f73f4c91e80fb751b Mon Sep 17 00:00:00 2001 From: okeyiii <96802936+okeyiii@users.noreply.github.com> Date: Mon, 17 Jul 2023 21:57:57 +0000 Subject: [PATCH 03/21] Nova Scotia Basic Personal Amount Fixes #395 --- .../credits/ns_basic_personal_amount.yaml | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.yaml b/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.yaml index 31f16ecf4..580d7994d 100644 --- a/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.yaml +++ b/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.yaml @@ -4,4 +4,28 @@ province_code: NS total_individual_pre_tax_income: 24_999 output: - ns_basic_personal_credits: 11_481 \ No newline at end of file + ns_basic_personal_credits: 11_481 + +- name: Person has taxable income between 25_000 and 75_000 + period: 2023 + input: + province_code: NS + total_individual_pre_tax_income: 27_000 + output: + ns_basic_personal_credits: 11_361 + +- name: Person has taxable income between 25_000 and 75_000 + period: 2023 + input: + province_code: NS + total_individual_pre_tax_income: 70_000 + output: + ns_basic_personal_credits: 8_781 + +- name: Person has taxable income higher than 75_000 + period: 2023 + input: + province_code: NS + total_individual_pre_tax_income: 76_000 + output: + ns_basic_personal_credits: 8_481 \ No newline at end of file From c9a2626ca11e41f8dde4ff464d67650edba2beca Mon Sep 17 00:00:00 2001 From: okeyiii <96802936+okeyiii@users.noreply.github.com> Date: Mon, 17 Jul 2023 22:03:07 +0000 Subject: [PATCH 04/21] Complete --- changelog_entry.yaml | 5 ++++ .../additional_amount.yaml | 2 +- .../applicable_rate.yaml | 2 +- .../basic_amount.yaml | 2 +- .../higher_income_threshold.yaml | 2 +- .../lower_income_threshold.yaml | 2 +- .../credits/pension/ab_pension_credit.yaml | 2 +- .../credits/ns_basic_personal_amount.yaml | 2 +- .../credits/ns_basic_personal_credits.py | 30 +++++++++++++------ 9 files changed, 33 insertions(+), 16 deletions(-) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..cb6917d8d 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,5 @@ +- bump: minor + changes: + added: + - Nova Scotia Basic personal amount. + 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 735cffb14..9f6a60f12 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 @@ -8,4 +8,4 @@ metadata: - title: Nova Scotia Basic Personal Amount href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf - title: Nova Scotia Basic Personal Amount - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf \ No newline at end of file + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf 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 c9eeab014..565fc47bf 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 @@ -8,4 +8,4 @@ metadata: - title: Nova Scotia Basic Personal Amount href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf - title: Nova Scotia Basic Personal Amount - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf \ No newline at end of file + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf 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 1f063d7dd..938ee6829 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 @@ -8,4 +8,4 @@ metadata: - title: Nova Scotia Basic Personal Amount href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf - title: Nova Scotia Basic Personal Amount - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf \ No newline at end of file + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf 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 1f4383a4b..f3869efe8 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 @@ -8,4 +8,4 @@ metadata: - title: Nova Scotia Basic Personal Amount href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf - title: Nova Scotia Basic Personal Amount - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf \ No newline at end of file + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf 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 fc57c40ad..f2707cb88 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 @@ -8,4 +8,4 @@ metadata: - title: Nova Scotia Basic Personal Amount href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf - title: Nova Scotia Basic Personal Amount - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf \ No newline at end of file + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf diff --git a/policyengine_canada/tests/gov/provinces/ab/tax/income/credits/pension/ab_pension_credit.yaml b/policyengine_canada/tests/gov/provinces/ab/tax/income/credits/pension/ab_pension_credit.yaml index e3c23fabd..a9faa8c92 100644 --- a/policyengine_canada/tests/gov/provinces/ab/tax/income/credits/pension/ab_pension_credit.yaml +++ b/policyengine_canada/tests/gov/provinces/ab/tax/income/credits/pension/ab_pension_credit.yaml @@ -20,4 +20,4 @@ pension_and_savings_plan_income: 0 province_code: AB output: - ab_pension_credit: 0 \ No newline at end of file + ab_pension_credit: 0 diff --git a/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.yaml b/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.yaml index 580d7994d..5df8f1a88 100644 --- a/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.yaml +++ b/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.yaml @@ -28,4 +28,4 @@ province_code: NS total_individual_pre_tax_income: 76_000 output: - ns_basic_personal_credits: 8_481 \ No newline at end of file + ns_basic_personal_credits: 8_481 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 a8f706a8b..1f2064b2d 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 @@ -9,13 +9,25 @@ class ns_basic_personal_credits(Variable): defined_for = ProvinceCode.NS def formula(person, period, parameters): - p = parameters(period).gov.provinces.ns.tax.income.credits.ns_basic_personal_amount - taxable_income = person("total_individual_pre_tax_income",period) + p = parameters( + period + ).gov.provinces.ns.tax.income.credits.ns_basic_personal_amount + taxable_income = person("total_individual_pre_tax_income", period) - return select([taxable_income <= p.lower_income_threshold, - p.lower_income_threshold < taxable_income < p.higher_income_threshold, - taxable_income >= p.higher_income_threshold], - - [p.additional_amount + p.basic_amount, - p.basic_amount + 3000 - p.applicable_rate*(taxable_income - p.lower_income_threshold), - 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, + ], + [ + p.additional_amount + p.basic_amount, + p.basic_amount + + 3000 + - p.applicable_rate + * (taxable_income - p.lower_income_threshold), + p.basic_amount, + ], + ) From cafa9ed2f3fe6dd8f2af8b2e196834a0e6287868 Mon Sep 17 00:00:00 2001 From: okeyiii <96802936+okeyiii@users.noreply.github.com> Date: Mon, 24 Jul 2023 16:46:15 +0000 Subject: [PATCH 05/21] Nova Scotia Basic Personal Amount Fixes #395 --- .../additional_amount.yaml | 2 +- .../applicable_rate.yaml | 2 +- .../basic_amount.yaml | 2 +- .../higher_income_threshold.yaml | 2 +- .../lower_income_threshold.yaml | 2 +- .../credits/ns_basic_personal_credits.py | 31 ++++++++++++------- 6 files changed, 25 insertions(+), 16 deletions(-) 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, ], ) From f13d546ab24e69f68e731ec6f869231bcf533bfb Mon Sep 17 00:00:00 2001 From: okeyiii <96802936+okeyiii@users.noreply.github.com> Date: Mon, 31 Jul 2023 16:44:38 +0000 Subject: [PATCH 06/21] Nova Scotia Basic Personal Amount Fixes #395 --- changelog_entry.yaml | 4 ++-- .../ns_basic_personal_amount/additional_amount.yaml | 4 ++-- .../credits/ns_basic_personal_amount/applicable_rate.yaml | 8 +++++--- .../credits/ns_basic_personal_amount/basic_amount.yaml | 4 ++-- .../ns_basic_personal_amount/higher_income_threshold.yaml | 4 ++-- .../ns_basic_personal_amount/lower_income_threshold.yaml | 4 ++-- ...asic_personal_credits.py => basic_personal_credits.py} | 2 ++ 7 files changed, 17 insertions(+), 13 deletions(-) rename policyengine_canada/variables/gov/provinces/ns/tax/income/credits/{ns_basic_personal_credits.py => basic_personal_credits.py} (87%) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index cb6917d8d..f0e062ca2 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -1,5 +1,5 @@ -- bump: minor +- bump: patch changes: added: - - Nova Scotia Basic personal amount. + - Chage names to proper expressions for title, label, reference and folder. 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 86dd7cf1a..8a25908b2 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 @@ -5,7 +5,7 @@ metadata: unit: currency-CAD label: Nova Scotia Additional Personal Amount reference: - - title: Nova Scotia Basic Personal Amount + - title: 2022 Nova Scotia Personal Tax Credits Return href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf - - title: Nova Scotia Basic Personal Amount + - title: Worksheet NS428 href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf 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 c2a8dcad6..23ba0c320 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 @@ -2,10 +2,12 @@ description: Nova Scotia employs this applicable rate for calculating partial ba values: 2022-01-01: 0.06 metadata: - unit: \1 + unit: currency-CAD + period: year + rate_unit: /1 label: Nova Scotia Basic Personal Amount Applicable Rate reference: - - title: Nova Scotia Basic Personal Amount + - title: 2022 Nova Scotia Personal Tax Credits Return href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf - - title: Nova Scotia Basic Personal Amount + - title: Worksheet NS428 href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf 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 0d368718b..13bf0c728 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 @@ -5,7 +5,7 @@ metadata: unit: currency-CAD label: Nova Scotia Basic Personal Amount reference: - - title: Nova Scotia Basic Personal Amount + - title: 2022 Nova Scotia Personal Tax Credits Return href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf - - title: Nova Scotia Basic Personal Amount + - title: Worksheet NS428 href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf 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 519438485..242e91b7b 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 @@ -5,7 +5,7 @@ metadata: unit: currency-CAD label: Nova Scotia Basic Personal Amount Higher Income Threshold reference: - - title: Nova Scotia Basic Personal Amount + - title: 2022 Nova Scotia Personal Tax Credits Return href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf - - title: Nova Scotia Basic Personal Amount + - title: Worksheet NS428 href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf 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 7ae2de356..0c68723b2 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 @@ -5,7 +5,7 @@ metadata: unit: currency-CAD label: Nova Scotia Basic Personal Amount Lower Income Threshold reference: - - title: Nova Scotia Basic Personal Amount + - title: 2022 Nova Scotia Personal Tax Credits Return href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf - - title: Nova Scotia Basic Personal Amount + - title: Worksheet NS428 href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf 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/basic_personal_credits.py similarity index 87% rename from policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_credits.py rename to policyengine_canada/variables/gov/provinces/ns/tax/income/credits/basic_personal_credits.py index d5f341704..87e2e7eda 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/basic_personal_credits.py @@ -7,6 +7,8 @@ class ns_basic_personal_credits(Variable): label = "Nova Scotia Basic Personal Amount" definition_period = YEAR defined_for = ProvinceCode.NS + reference = ("https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf", + "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf") def formula(person, period, parameters): p = parameters( From ce10cc0ba9d26c279846a9d1fe87f5d322eeb062 Mon Sep 17 00:00:00 2001 From: okeyiii <96802936+okeyiii@users.noreply.github.com> Date: Mon, 31 Jul 2023 21:28:14 +0000 Subject: [PATCH 07/21] Nova Scotia Basic Personal Amount Fixes format #395 --- changelog_entry.yaml | 1 + .../income/credits/basic_personal_credits.py | 28 +++++++++++-------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index f0e062ca2..1013ce63f 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -2,4 +2,5 @@ changes: added: - Chage names to proper expressions for title, label, reference and folder. + - Make format. diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/basic_personal_credits.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/basic_personal_credits.py index 87e2e7eda..9d1612d5c 100644 --- a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/basic_personal_credits.py +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/basic_personal_credits.py @@ -7,29 +7,35 @@ class ns_basic_personal_credits(Variable): label = "Nova Scotia Basic Personal Amount" definition_period = YEAR defined_for = ProvinceCode.NS - reference = ("https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf", - "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf") + reference = ( + "https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf", + "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf", + ) def formula(person, period, parameters): p = 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) + 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) + 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( [ lower_income_condition, From a8f1e15fb30cf7d76739f320802cea9c4bd3d6b2 Mon Sep 17 00:00:00 2001 From: okeyiii <96802936+okeyiii@users.noreply.github.com> Date: Tue, 8 Aug 2023 01:56:58 +0000 Subject: [PATCH 08/21] Nova Scotia Basic Personal Amount Fixes #395 Reformed the varaibles part code in a more mathematical way --- changelog_entry.yaml | 5 +- .../additional_amount}/additional_amount.yaml | 2 +- .../additional_amount}/applicable_rate.yaml | 5 +- .../lower_income_threshold.yaml | 4 +- .../base.yaml} | 4 +- .../higher_income_threshold.yaml | 11 ---- .../credits/ns_basic_personal_amount.yaml | 8 +-- .../income/credits/basic_personal_credits.py | 50 ------------------- .../credits/ns_basic_personal_amount.py | 34 +++++++++++++ 9 files changed, 48 insertions(+), 75 deletions(-) rename policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/{ns_basic_personal_amount => basic_personal_amount/additional_amount}/additional_amount.yaml (87%) rename policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/{ns_basic_personal_amount => basic_personal_amount/additional_amount}/applicable_rate.yaml (69%) rename policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/{ns_basic_personal_amount => basic_personal_amount/additional_amount}/lower_income_threshold.yaml (63%) rename policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/{ns_basic_personal_amount/basic_amount.yaml => basic_personal_amount/base.yaml} (72%) delete mode 100644 policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/higher_income_threshold.yaml delete mode 100644 policyengine_canada/variables/gov/provinces/ns/tax/income/credits/basic_personal_credits.py create mode 100644 policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py diff --git a/changelog_entry.yaml b/changelog_entry.yaml index 1013ce63f..2563d9ceb 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -1,6 +1,5 @@ -- bump: patch +- bump: minor changes: added: - - Chage names to proper expressions for title, label, reference and folder. - - Make format. + - Nova Scotia Basic Personal Amount. 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/basic_personal_amount/additional_amount/additional_amount.yaml similarity index 87% rename from policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/additional_amount.yaml rename to policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/additional_amount.yaml index 8a25908b2..79d8e836d 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/basic_personal_amount/additional_amount/additional_amount.yaml @@ -3,7 +3,7 @@ values: 2022-01-01: 3_000 metadata: unit: currency-CAD - label: Nova Scotia Additional Personal Amount + label: Nova Scotia basic personal amount additional amount reference: - title: 2022 Nova Scotia Personal Tax Credits Return href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf 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/basic_personal_amount/additional_amount/applicable_rate.yaml similarity index 69% rename from policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/applicable_rate.yaml rename to policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/applicable_rate.yaml index 23ba0c320..26ebd8d7c 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/basic_personal_amount/additional_amount/applicable_rate.yaml @@ -1,11 +1,12 @@ -description: Nova Scotia employs this applicable rate for calculating partial basic personal amounts. +description: Nova Scotia reduces its additional basic personal amount out at this rate. values: 2022-01-01: 0.06 metadata: unit: currency-CAD period: year rate_unit: /1 - label: Nova Scotia Basic Personal Amount Applicable Rate + label: Nova Scotia basic personal amount reduction rate + reference: - title: 2022 Nova Scotia Personal Tax Credits Return href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf 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/basic_personal_amount/additional_amount/lower_income_threshold.yaml similarity index 63% rename from policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/lower_income_threshold.yaml rename to policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/lower_income_threshold.yaml index 0c68723b2..ac95282ac 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/basic_personal_amount/additional_amount/lower_income_threshold.yaml @@ -1,9 +1,9 @@ -description: Nova Scotia limits this lower income threshold under the basic personal amount eligibility. +description: Nova Scotia phases its additional basic personal amount out for filers with income above this threshold. values: 2022-01-01: 25_000 metadata: unit: currency-CAD - label: Nova Scotia Basic Personal Amount Lower Income Threshold + label: Nova Scotia basic personal amount additional amount phase out start reference: - title: 2022 Nova Scotia Personal Tax Credits Return href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf 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/basic_personal_amount/base.yaml similarity index 72% rename from policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/basic_amount.yaml rename to policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/base.yaml index 13bf0c728..ac97c7271 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/basic_personal_amount/base.yaml @@ -1,9 +1,9 @@ -description: Nova Scotia provides this basic amount under basic personal amount. +description: Nova Scotia provides this base amount under the basic personal amount. values: 2022-01-01: 8_481 metadata: unit: currency-CAD - label: Nova Scotia Basic Personal Amount + label: Nova Scotia basic personal amount base reference: - title: 2022 Nova Scotia Personal Tax Credits Return href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf 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 deleted file mode 100644 index 242e91b7b..000000000 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount/higher_income_threshold.yaml +++ /dev/null @@ -1,11 +0,0 @@ -description: Nova Scotia limits this higher income threshold under the basic personal amount eligibility. -values: - 2022-01-01: 75_000 -metadata: - unit: currency-CAD - label: Nova Scotia Basic Personal Amount Higher Income Threshold - reference: - - title: 2022 Nova Scotia Personal Tax Credits Return - href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf - - title: Worksheet NS428 - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf diff --git a/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.yaml b/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.yaml index 5df8f1a88..4c647247f 100644 --- a/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.yaml +++ b/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.yaml @@ -4,7 +4,7 @@ province_code: NS total_individual_pre_tax_income: 24_999 output: - ns_basic_personal_credits: 11_481 + ns_basic_personal_amount: 11_481 - name: Person has taxable income between 25_000 and 75_000 period: 2023 @@ -12,7 +12,7 @@ province_code: NS total_individual_pre_tax_income: 27_000 output: - ns_basic_personal_credits: 11_361 + ns_basic_personal_amount: 11_361 - name: Person has taxable income between 25_000 and 75_000 period: 2023 @@ -20,7 +20,7 @@ province_code: NS total_individual_pre_tax_income: 70_000 output: - ns_basic_personal_credits: 8_781 + ns_basic_personal_amount: 8_781 - name: Person has taxable income higher than 75_000 period: 2023 @@ -28,4 +28,4 @@ province_code: NS total_individual_pre_tax_income: 76_000 output: - ns_basic_personal_credits: 8_481 + ns_basic_personal_amount: 8_481 diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/basic_personal_credits.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/basic_personal_credits.py deleted file mode 100644 index 9d1612d5c..000000000 --- a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/basic_personal_credits.py +++ /dev/null @@ -1,50 +0,0 @@ -from policyengine_canada.model_api import * - - -class ns_basic_personal_credits(Variable): - value_type = float - entity = Person - label = "Nova Scotia Basic Personal Amount" - definition_period = YEAR - defined_for = ProvinceCode.NS - reference = ( - "https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf", - "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf", - ) - - def formula(person, period, parameters): - p = 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( - [ - lower_income_condition, - medium_income_condition, - higher_income_condition, - ], - [ - lower_basic_personal_amount, - medium_basic_personal_amount, - higher_basic_personal_amount, - ], - ) diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py new file mode 100644 index 000000000..299263958 --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py @@ -0,0 +1,34 @@ +from policyengine_canada.model_api import * + + +class ns_basic_personal_amount(Variable): + value_type = float + entity = Person + label = "Nova Scotia Basic Personal Amount" + definition_period = YEAR + defined_for = ProvinceCode.NS + reference = ( + "https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf", + "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf", + ) + + def formula(person, period, parameters): + p = parameters( + period + ).gov.provinces.ns.tax.income.credits.basic_personal_amount + taxable_income = person("total_individual_pre_tax_income", period) + + # Calculate additional amount added to base amount + exceedance = ( + taxable_income - p.additional_amount.lower_income_threshold + ) + reduced_additional_amount = ( + p.additional_amount.additional_amount + - p.additional_amount.applicable_rate * exceedance + ) + additional_amount = max_(0, reduced_additional_amount) + additional_amount = min_( + additional_amount, p.additional_amount.additional_amount + ) + + return p.base + additional_amount From 02b51c5b28a1117a36759e50084124c4ed90e047 Mon Sep 17 00:00:00 2001 From: okeyiii <96802936+okeyiii@users.noreply.github.com> Date: Thu, 10 Aug 2023 02:16:12 +0000 Subject: [PATCH 09/21] Nova Scotia Basic Personal Amount Fixes #395 add reference, try to slove version issue by git --- changelog_entry.yaml | 2 +- .../additional_amount/additional_amount.yaml | 5 ++++- .../additional_amount/applicable_rate.yaml | 6 ++++-- .../additional_amount/lower_income_threshold.yaml | 4 +++- .../ns/tax/income/credits/basic_personal_amount/base.yaml | 4 +++- .../ns/tax/income/credits/ns_basic_personal_amount.py | 3 ++- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index 2563d9ceb..490d062ae 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -1,5 +1,5 @@ - bump: minor changes: added: - - Nova Scotia Basic Personal Amount. + - Nova Scotia Basic Personal Amount diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/additional_amount.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/additional_amount.yaml index 79d8e836d..02e09ebdb 100644 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/additional_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/additional_amount.yaml @@ -6,6 +6,9 @@ metadata: label: Nova Scotia basic personal amount additional amount reference: - title: 2022 Nova Scotia Personal Tax Credits Return - href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf + href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1 - title: Worksheet NS428 href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf + - title: Nova Scotia income tax act + href: https://nslegislature.ca/sites/default/files/legc/statutes/income%20tax.pdf#page=24 + diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/applicable_rate.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/applicable_rate.yaml index 26ebd8d7c..c846cf5b9 100644 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/applicable_rate.yaml +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/applicable_rate.yaml @@ -1,4 +1,4 @@ -description: Nova Scotia reduces its additional basic personal amount out at this rate. +description: Nova Scotia phases its additional basic personal amount out at this rate. values: 2022-01-01: 0.06 metadata: @@ -9,6 +9,8 @@ metadata: reference: - title: 2022 Nova Scotia Personal Tax Credits Return - href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf + href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1 - title: Worksheet NS428 href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf + - title: Nova Scotia income tax act + href: https://nslegislature.ca/sites/default/files/legc/statutes/income%20tax.pdf#page=24 diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/lower_income_threshold.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/lower_income_threshold.yaml index ac95282ac..b02829ad0 100644 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/lower_income_threshold.yaml +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/lower_income_threshold.yaml @@ -6,6 +6,8 @@ metadata: label: Nova Scotia basic personal amount additional amount phase out start reference: - title: 2022 Nova Scotia Personal Tax Credits Return - href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf + href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1 - title: Worksheet NS428 href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf + - title: Nova Scotia income tax act + href: https://nslegislature.ca/sites/default/files/legc/statutes/income%20tax.pdf#page=24 diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/base.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/base.yaml index ac97c7271..279405803 100644 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/base.yaml +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/base.yaml @@ -6,6 +6,8 @@ metadata: label: Nova Scotia basic personal amount base reference: - title: 2022 Nova Scotia Personal Tax Credits Return - href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf + href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1 - title: Worksheet NS428 href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf + - title: Nova Scotia income tax act + href: https://nslegislature.ca/sites/default/files/legc/statutes/income%20tax.pdf#page=24 diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py index 299263958..62101a20a 100644 --- a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py @@ -8,8 +8,9 @@ class ns_basic_personal_amount(Variable): definition_period = YEAR defined_for = ProvinceCode.NS reference = ( - "https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf", + "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/5003-d/5003-d-22e.pdf", + "https://nslegislature.ca/sites/default/files/legc/statutes/income%20tax.pdf#page=24", ) def formula(person, period, parameters): From c526ad911ad242f0722c75904490539c94cab16e Mon Sep 17 00:00:00 2001 From: okeyiii <96802936+okeyiii@users.noreply.github.com> Date: Tue, 15 Aug 2023 03:47:23 +0000 Subject: [PATCH 10/21] Nova Scotia Basic Personal Amount Fixes #395 --- .../additional_amount/additional_amount.yaml | 6 +++--- .../additional_amount/applicable_rate.yaml | 6 +++--- .../{lower_income_threshold.yaml => income_threshold.yaml} | 6 +++--- .../ns/tax/income/credits/basic_personal_amount/base.yaml | 6 +++--- .../ns/tax/income/credits/ns_basic_personal_amount.py | 6 ++---- 5 files changed, 14 insertions(+), 16 deletions(-) rename policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/{lower_income_threshold.yaml => income_threshold.yaml} (78%) diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/additional_amount.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/additional_amount.yaml index 02e09ebdb..50bf2631d 100644 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/additional_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/additional_amount.yaml @@ -7,8 +7,8 @@ metadata: reference: - title: 2022 Nova Scotia Personal Tax Credits Return href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1 - - title: Worksheet NS428 - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf - - title: Nova Scotia income tax act + - title: 2022 Worksheet NS428 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf#page=1 + - title: Nova Scotia income tax act - subdivision c - Deduction for employment out of Canada href: https://nslegislature.ca/sites/default/files/legc/statutes/income%20tax.pdf#page=24 diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/applicable_rate.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/applicable_rate.yaml index c846cf5b9..3e5a3eb4c 100644 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/applicable_rate.yaml +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/applicable_rate.yaml @@ -10,7 +10,7 @@ metadata: reference: - title: 2022 Nova Scotia Personal Tax Credits Return href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1 - - title: Worksheet NS428 - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf - - title: Nova Scotia income tax act + - title: 2022 Worksheet NS428 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf#page=1 + - title: Nova Scotia income tax act - subdivision c - Deduction for employment out of Canada href: https://nslegislature.ca/sites/default/files/legc/statutes/income%20tax.pdf#page=24 diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/lower_income_threshold.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/income_threshold.yaml similarity index 78% rename from policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/lower_income_threshold.yaml rename to policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/income_threshold.yaml index b02829ad0..8cc49eb12 100644 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/lower_income_threshold.yaml +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/income_threshold.yaml @@ -7,7 +7,7 @@ metadata: reference: - title: 2022 Nova Scotia Personal Tax Credits Return href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1 - - title: Worksheet NS428 - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf - - title: Nova Scotia income tax act + - title: 2022 Worksheet NS428 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf#page=1 + - title: Nova Scotia income tax act - subdivision c - Deduction for employment out of Canada href: https://nslegislature.ca/sites/default/files/legc/statutes/income%20tax.pdf#page=24 diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/base.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/base.yaml index 279405803..8d2a42030 100644 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/base.yaml +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/base.yaml @@ -7,7 +7,7 @@ metadata: reference: - title: 2022 Nova Scotia Personal Tax Credits Return href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1 - - title: Worksheet NS428 - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf - - title: Nova Scotia income tax act + - title: 2022 Worksheet NS428 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf#page=1 + - title: Nova Scotia income tax act - subdivision c - Deduction for employment out of Canada href: https://nslegislature.ca/sites/default/files/legc/statutes/income%20tax.pdf#page=24 diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py index 62101a20a..083e292e9 100644 --- a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py @@ -9,7 +9,7 @@ class ns_basic_personal_amount(Variable): defined_for = ProvinceCode.NS 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/5003-d/5003-d-22e.pdf", + "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf#page=1", "https://nslegislature.ca/sites/default/files/legc/statutes/income%20tax.pdf#page=24", ) @@ -20,9 +20,7 @@ def formula(person, period, parameters): taxable_income = person("total_individual_pre_tax_income", period) # Calculate additional amount added to base amount - exceedance = ( - taxable_income - p.additional_amount.lower_income_threshold - ) + exceedance = taxable_income - p.additional_amount.income_threshold reduced_additional_amount = ( p.additional_amount.additional_amount - p.additional_amount.applicable_rate * exceedance From 18136a1e4c0177f94fd7172f2838ed3306bc2689 Mon Sep 17 00:00:00 2001 From: okeyiii <96802936+okeyiii@users.noreply.github.com> Date: Wed, 16 Aug 2023 00:38:38 +0000 Subject: [PATCH 11/21] Nova Scotia Basic Personal Amount Fixes #395 --- .../ns/tax/income/credits/ns_basic_personal_amount.yaml | 2 +- .../ns/tax/income/credits/ns_basic_personal_amount.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.yaml b/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.yaml index 4c647247f..7227033c9 100644 --- a/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.yaml +++ b/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.yaml @@ -26,6 +26,6 @@ period: 2023 input: province_code: NS - total_individual_pre_tax_income: 76_000 + total_individual_pre_tax_income: 75_001 output: ns_basic_personal_amount: 8_481 diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py index 083e292e9..7e5183e7d 100644 --- a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py @@ -20,7 +20,9 @@ def formula(person, period, parameters): taxable_income = person("total_individual_pre_tax_income", period) # Calculate additional amount added to base amount - exceedance = taxable_income - p.additional_amount.income_threshold + exceedance = max_( + taxable_income - p.additional_amount.income_threshold, 0 + ) reduced_additional_amount = ( p.additional_amount.additional_amount - p.additional_amount.applicable_rate * exceedance From 948dce76896f75f0853705e9dcf9be42905ae5c7 Mon Sep 17 00:00:00 2001 From: okeyiii <96802936+okeyiii@users.noreply.github.com> Date: Tue, 29 Aug 2023 16:43:37 +0000 Subject: [PATCH 12/21] Nova Scotia Basic Personal Amount Fixes #395 --- .../additional_amount/income_threshold.yaml | 13 ----------- .../{applicable_rate.yaml => max_amount.yaml} | 22 ++++++++++++++----- .../credits/ns_basic_personal_amount.py | 6 ++--- 3 files changed, 19 insertions(+), 22 deletions(-) delete mode 100644 policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/income_threshold.yaml rename policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/{applicable_rate.yaml => max_amount.yaml} (71%) diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/income_threshold.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/income_threshold.yaml deleted file mode 100644 index 8cc49eb12..000000000 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/income_threshold.yaml +++ /dev/null @@ -1,13 +0,0 @@ -description: Nova Scotia phases its additional basic personal amount out for filers with income above this threshold. -values: - 2022-01-01: 25_000 -metadata: - unit: currency-CAD - label: Nova Scotia basic personal amount additional amount phase out start - reference: - - title: 2022 Nova Scotia Personal Tax Credits Return - href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1 - - title: 2022 Worksheet NS428 - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf#page=1 - - title: Nova Scotia income tax act - subdivision c - Deduction for employment out of Canada - href: https://nslegislature.ca/sites/default/files/legc/statutes/income%20tax.pdf#page=24 diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/applicable_rate.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/max_amount.yaml similarity index 71% rename from policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/applicable_rate.yaml rename to policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/max_amount.yaml index 3e5a3eb4c..0922dfe9c 100644 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/applicable_rate.yaml +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/max_amount.yaml @@ -1,12 +1,24 @@ description: Nova Scotia phases its additional basic personal amount out at this rate. -values: - 2022-01-01: 0.06 +brackets: + - threshold: + values: + 2022-01-01: 0 + rate: + values: + 2022-01-01: 0 + - threshold: + values: + 2022-01-01: 25_000 + rate: + values: + 2022-01-01: 0.06 + metadata: - unit: currency-CAD - period: year + type: marginal_rate rate_unit: /1 + threshold_unit: currency-CAD + period: year label: Nova Scotia basic personal amount reduction rate - reference: - title: 2022 Nova Scotia Personal Tax Credits Return href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1 diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py index 7e5183e7d..b08662ded 100644 --- a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py @@ -20,12 +20,10 @@ def formula(person, period, parameters): taxable_income = person("total_individual_pre_tax_income", period) # Calculate additional amount added to base amount - exceedance = max_( - taxable_income - p.additional_amount.income_threshold, 0 - ) + reduced_additional_amount = ( p.additional_amount.additional_amount - - p.additional_amount.applicable_rate * exceedance + - p.additional_amount.max_amount.calc(taxable_income) ) additional_amount = max_(0, reduced_additional_amount) additional_amount = min_( From 7bbcf3a8c05de95fe219bdf3c51fee9749fd0e0f Mon Sep 17 00:00:00 2001 From: okeyiii <96802936+okeyiii@users.noreply.github.com> Date: Wed, 30 Aug 2023 00:46:20 +0000 Subject: [PATCH 13/21] Nova Scotia Basic Personal Amount Fixes #395 --- changelog_entry.yaml | 2 +- .../additional_amount/max_amount.yaml | 12 ++++-------- .../tax/income/credits/ns_basic_personal_amount.py | 8 ++++---- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index 490d062ae..2563d9ceb 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -1,5 +1,5 @@ - bump: minor changes: added: - - Nova Scotia Basic Personal Amount + - Nova Scotia Basic Personal Amount. diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/max_amount.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/max_amount.yaml index 0922dfe9c..f2fb24378 100644 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/max_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/max_amount.yaml @@ -1,17 +1,13 @@ description: Nova Scotia phases its additional basic personal amount out at this rate. brackets: - threshold: - values: - 2022-01-01: 0 + 2022-01-01: 0 rate: - values: - 2022-01-01: 0 + 2022-01-01: 0 - threshold: - values: - 2022-01-01: 25_000 + 2022-01-01: 25_000 rate: - values: - 2022-01-01: 0.06 + 2022-01-01: 0.06 metadata: type: marginal_rate diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py index b08662ded..810fe4c23 100644 --- a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py @@ -21,13 +21,13 @@ def formula(person, period, parameters): # Calculate additional amount added to base amount - reduced_additional_amount = ( + reduced_additional_amount = max_( + 0, p.additional_amount.additional_amount - - p.additional_amount.max_amount.calc(taxable_income) + - p.additional_amount.max_amount.calc(taxable_income), ) - additional_amount = max_(0, reduced_additional_amount) additional_amount = min_( - additional_amount, p.additional_amount.additional_amount + reduced_additional_amount, p.additional_amount.additional_amount ) return p.base + additional_amount From b58867bd5ae1bc0b79960bcd9ba3e974ecfba707 Mon Sep 17 00:00:00 2001 From: PavelMakarchuk Date: Wed, 30 Aug 2023 04:01:50 +0300 Subject: [PATCH 14/21] rename parameters --- .../additional_amount/{additional_amount.yaml => base.yaml} | 4 ++-- .../{max_amount.yaml => phase_out_rate.yaml} | 2 +- .../ns/tax/income/credits/ns_basic_personal_amount.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) rename policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/{additional_amount.yaml => base.yaml} (78%) rename policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/{max_amount.yaml => phase_out_rate.yaml} (93%) diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/additional_amount.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/base.yaml similarity index 78% rename from policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/additional_amount.yaml rename to policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/base.yaml index 50bf2631d..a888bf5be 100644 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/additional_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/base.yaml @@ -1,9 +1,9 @@ -description: Nova Scotia provides this additional amount under the basic personal amount. +description: Nova Scotia adds this additional amount to the basic personal amount. values: 2022-01-01: 3_000 metadata: unit: currency-CAD - label: Nova Scotia basic personal amount additional amount + label: Nova Scotia basic personal amount additional base reference: - title: 2022 Nova Scotia Personal Tax Credits Return href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1 diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/max_amount.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/phase_out_rate.yaml similarity index 93% rename from policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/max_amount.yaml rename to policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/phase_out_rate.yaml index f2fb24378..98e815145 100644 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/max_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/phase_out_rate.yaml @@ -14,7 +14,7 @@ metadata: rate_unit: /1 threshold_unit: currency-CAD period: year - label: Nova Scotia basic personal amount reduction rate + label: Nova Scotia basic personal amount phase out rate reference: - title: 2022 Nova Scotia Personal Tax Credits Return href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1 diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py index 810fe4c23..370078fc5 100644 --- a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py @@ -23,11 +23,11 @@ def formula(person, period, parameters): reduced_additional_amount = max_( 0, - p.additional_amount.additional_amount - - p.additional_amount.max_amount.calc(taxable_income), + p.additional_amount.base + - p.additional_amount.phase_out_rate.calc(taxable_income), ) additional_amount = min_( - reduced_additional_amount, p.additional_amount.additional_amount + reduced_additional_amount, p.additional_amount.base ) return p.base + additional_amount From 92d4e0615094e1a1ef04539753406c4775f6b6bc Mon Sep 17 00:00:00 2001 From: okeyiii <96802936+okeyiii@users.noreply.github.com> Date: Wed, 6 Sep 2023 00:47:09 +0000 Subject: [PATCH 15/21] Nova Scotia Basic Personal Amount Fixes #395 Add income threshold back, and use where as return --- .../additional_amount/income_threshold.yaml | 12 ++++++++++++ .../additional_amount/max_personal_amount.yaml | 13 +++++++++++++ .../tax/income/credits/ns_basic_personal_amount.py | 8 +++++++- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/income_threshold.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/max_personal_amount.yaml diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/income_threshold.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/income_threshold.yaml new file mode 100644 index 000000000..960ff8b36 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/income_threshold.yaml @@ -0,0 +1,12 @@ +description: Nova Scotia lower income threshold for maximum basic personal amount in basic personal amount. + +values: + 2022-01-01: 25_000 +metadata: + unit: currency-CAD + label: Nova Scotia Basic Personal Amount Lower Income Threshold + reference: + - title: Nova Scotia Basic Personal Amount + href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf + - title: Nova Scotia Basic Personal Amount + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/max_personal_amount.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/max_personal_amount.yaml new file mode 100644 index 000000000..384659688 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/max_personal_amount.yaml @@ -0,0 +1,13 @@ +description: Nova Scotia provides this max personal amount under the basic personal amount. +values: + 2022-01-01: 11_481 +metadata: + unit: currency-CAD + label: Nova Scotia basic personal amount max personal amount + reference: + - title: 2022 Nova Scotia Personal Tax Credits Return + href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1 + - title: 2022 Worksheet NS428 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf#page=1 + - title: Nova Scotia income tax act - subdivision c - Deduction for employment out of Canada + href: https://nslegislature.ca/sites/default/files/legc/statutes/income%20tax.pdf#page=24 diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py index 810fe4c23..5902344d6 100644 --- a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py @@ -30,4 +30,10 @@ def formula(person, period, parameters): reduced_additional_amount, p.additional_amount.additional_amount ) - return p.base + additional_amount + return where( + taxable_income <= p.additional_amount.income_threshold, + p.additional_amount.max_personal_amount, + p.base + additional_amount, + ) + + # p.base + additional_amount From 36bb8137d5c3d388f2fe9155629cbb987864f351 Mon Sep 17 00:00:00 2001 From: Pavel Makarchuk <110687043+PavelMakarchuk@users.noreply.github.com> Date: Sun, 10 Sep 2023 02:58:08 +0300 Subject: [PATCH 16/21] Update policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py --- .../provinces/ns/tax/income/credits/ns_basic_personal_amount.py | 1 - 1 file changed, 1 deletion(-) diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py index ee7685916..65580aa4e 100644 --- a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py @@ -36,4 +36,3 @@ def formula(person, period, parameters): p.base + additional_amount, ) - # p.base + additional_amount From e122967fa90c7fcaac8ba024f471fa567b4e62d4 Mon Sep 17 00:00:00 2001 From: Pavel Makarchuk <110687043+PavelMakarchuk@users.noreply.github.com> Date: Sun, 10 Sep 2023 02:58:23 +0300 Subject: [PATCH 17/21] Update changelog_entry.yaml --- changelog_entry.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index 2563d9ceb..718d15f07 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -1,5 +1,5 @@ - bump: minor changes: added: - - Nova Scotia Basic Personal Amount. + - Nova Scotia basic personal amount. From a4e1df7e49d03a52abc774290852b85f746604cb Mon Sep 17 00:00:00 2001 From: PavelMakarchuk Date: Sun, 10 Sep 2023 03:00:52 +0300 Subject: [PATCH 18/21] remove additional variable --- .../additional_amount/max_personal_amount.yaml | 13 ------------- .../tax/income/credits/ns_basic_personal_amount.py | 10 +--------- 2 files changed, 1 insertion(+), 22 deletions(-) delete mode 100644 policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/max_personal_amount.yaml diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/max_personal_amount.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/max_personal_amount.yaml deleted file mode 100644 index 384659688..000000000 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/max_personal_amount.yaml +++ /dev/null @@ -1,13 +0,0 @@ -description: Nova Scotia provides this max personal amount under the basic personal amount. -values: - 2022-01-01: 11_481 -metadata: - unit: currency-CAD - label: Nova Scotia basic personal amount max personal amount - reference: - - title: 2022 Nova Scotia Personal Tax Credits Return - href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1 - - title: 2022 Worksheet NS428 - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf#page=1 - - title: Nova Scotia income tax act - subdivision c - Deduction for employment out of Canada - href: https://nslegislature.ca/sites/default/files/legc/statutes/income%20tax.pdf#page=24 diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py index 65580aa4e..ac22f631e 100644 --- a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py @@ -26,13 +26,5 @@ def formula(person, period, parameters): p.additional_amount.base - p.additional_amount.phase_out_rate.calc(taxable_income), ) - additional_amount = min_( - reduced_additional_amount, p.additional_amount.base - ) - - return where( - taxable_income <= p.additional_amount.income_threshold, - p.additional_amount.max_personal_amount, - p.base + additional_amount, - ) + return (p.base + reduced_additional_amount,) From 6d0a8600391858ad33caeaf8c57f24411cc912aa Mon Sep 17 00:00:00 2001 From: PavelMakarchuk Date: Sun, 10 Sep 2023 03:01:49 +0300 Subject: [PATCH 19/21] unit --- .../provinces/ns/tax/income/credits/ns_basic_personal_amount.py | 1 + 1 file changed, 1 insertion(+) diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py index ac22f631e..f331442a1 100644 --- a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py @@ -5,6 +5,7 @@ class ns_basic_personal_amount(Variable): value_type = float entity = Person label = "Nova Scotia Basic Personal Amount" + unit = CAD definition_period = YEAR defined_for = ProvinceCode.NS reference = ( From 793adca94a6b54185850cc66d58bcbdb93f06ead Mon Sep 17 00:00:00 2001 From: okeyiii <96802936+okeyiii@users.noreply.github.com> Date: Fri, 6 Oct 2023 05:16:06 +0000 Subject: [PATCH 20/21] Nova Scotia Basic Personal Amount Update the return value Fix #395 --- .../provinces/ns/tax/income/credits/ns_basic_personal_amount.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py index f331442a1..1e96c59a7 100644 --- a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/ns_basic_personal_amount.py @@ -28,4 +28,4 @@ def formula(person, period, parameters): - p.additional_amount.phase_out_rate.calc(taxable_income), ) - return (p.base + reduced_additional_amount,) + return p.base + reduced_additional_amount From 49194315e0f6c6c0a1dc951a1635295a7bd244d8 Mon Sep 17 00:00:00 2001 From: okeyiii <96802936+okeyiii@users.noreply.github.com> Date: Sun, 8 Oct 2023 14:15:24 +0000 Subject: [PATCH 21/21] Nova Scotia Basic Personal Amount income_threshold is not actually used, delete it. Fixes #395 --- .../additional_amount/income_threshold.yaml | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/income_threshold.yaml diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/income_threshold.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/income_threshold.yaml deleted file mode 100644 index 960ff8b36..000000000 --- a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/basic_personal_amount/additional_amount/income_threshold.yaml +++ /dev/null @@ -1,12 +0,0 @@ -description: Nova Scotia lower income threshold for maximum basic personal amount in basic personal amount. - -values: - 2022-01-01: 25_000 -metadata: - unit: currency-CAD - label: Nova Scotia Basic Personal Amount Lower Income Threshold - reference: - - title: Nova Scotia Basic Personal Amount - href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf - - title: Nova Scotia Basic Personal Amount - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf