Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nunavut married or common-law status credit #315

Draft
wants to merge 52 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
ed03ea0
initial changes
runyao-yin May 31, 2023
53621ab
Fixes issue 314
runyao-yin May 31, 2023
0069f37
fixes issue 314
runyao-yin May 31, 2023
49231e8
fixes issue 314 and issue 324
runyao-yin Jun 7, 2023
369ca7c
Merge branch 'master' of https://github.com/PolicyEngine/policyengine…
runyao-yin Jun 7, 2023
93968b9
Update addon_max_amount.yaml
runyao-yin Aug 15, 2023
aa6e892
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin Aug 15, 2023
b067834
Update base.yaml
runyao-yin Aug 15, 2023
6ec4da9
Update base.yaml
runyao-yin Aug 15, 2023
56d24af
Update addon_max_amount.yaml
runyao-yin Aug 15, 2023
0f760e1
Update base.yaml
runyao-yin Aug 15, 2023
ec785e6
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin Aug 15, 2023
60e451f
Update nu_married_status_credit.py
runyao-yin Aug 15, 2023
d82a09b
Update nu_eligible_dependent_credit.yaml
runyao-yin Aug 15, 2023
6a473ae
Update nu_married_status_credit.yaml
runyao-yin Aug 15, 2023
527262d
Update reference
runyao-yin Aug 15, 2023
a1479c1
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin Aug 16, 2023
cfa440e
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin Aug 16, 2023
210b85e
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin Aug 16, 2023
d372c5c
Fixes
runyao-yin Aug 16, 2023
8d42b47
Merge branch 'master' of https://github.com/PolicyEngine/policyengine…
runyao-yin Aug 16, 2023
8e1156a
edit for newest comments
runyao-yin Aug 29, 2023
5c9d097
fixes
runyao-yin Aug 30, 2023
8a784ad
fixes
runyao-yin Aug 30, 2023
cf29afd
Update nu_eligible_dependent_credit_eligible.py
runyao-yin Aug 30, 2023
53aa977
Update changelog_entry.yaml
runyao-yin Sep 12, 2023
3da9350
Update changelog_entry.yaml
runyao-yin Sep 12, 2023
4bf54c6
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin Sep 12, 2023
2b5d20a
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin Sep 12, 2023
22a170e
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin Sep 12, 2023
f39ae06
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin Sep 12, 2023
38a0dda
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin Sep 12, 2023
04605b0
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin Sep 12, 2023
807c1d8
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin Sep 12, 2023
6621dd7
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin Sep 12, 2023
f46ed2b
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin Sep 12, 2023
a37d6fa
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin Sep 12, 2023
1f58f99
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin Sep 12, 2023
b7d52f7
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin Sep 12, 2023
a0f5167
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin Sep 12, 2023
2817e6f
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin Sep 12, 2023
67071fb
Update changelog_entry.yaml
runyao-yin Sep 12, 2023
c3b394c
Update changelog_entry.yaml
runyao-yin Sep 12, 2023
eba7f36
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin Sep 12, 2023
b90adbb
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin Sep 12, 2023
5f22625
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin Sep 12, 2023
42c8abf
Update nu_married_status_credit.py
runyao-yin Sep 12, 2023
d239203
fixes
runyao-yin Sep 19, 2023
1f195c2
Add eligible variables' tests
runyao-yin Oct 10, 2023
4c9d37a
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin Nov 14, 2023
2af38ad
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin Nov 14, 2023
5216fa5
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin Nov 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog_entry.yaml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need a make format and git pull upstream master

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- bump: minor
changes:
added:
- Nunavut married status credit.
- Nunavut eligible dependent credit.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description: Nunavut allows for this additional max amount for filers who are supporting a dependent, living in the same household.
runyao-yin marked this conversation as resolved.
Show resolved Hide resolved
values:
2022-01-01: 16_862
metadata:
unit: currency-CAD
label: Nunavut eligible dependent max additional amount
runyao-yin marked this conversation as resolved.
Show resolved Hide resolved
reference:
- title: Nunavut Income Tax Act Subvision C Section 2.15
href: https://www.nunavutlegislation.ca/en/consolidated-law/income-tax-act-consolidation
- title: 2022 Form NU428, Nunavut Tax
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5014-c/5014-c-22e.pdf#page=1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description: Nunavut provides this base amount for individuals who are supporting a dependent living in the same household.
values:
2022-01-01: 16_862
metadata:
unit: currency-CAD
label: Nunavut eligible dependent credit base amount
reference:
- title: Nunavut Income Tax Act Subvision C Section 2.15
href: https://www.nunavutlegislation.ca/en/consolidated-law/income-tax-act-consolidation
- title: 2022 Form NU428, Nunavut Tax
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5014-c/5014-c-22e.pdf#page=1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description: Nunavut allows for this additional maximum amount for individuals, supporting their spouse or common law partner living in the same household.
runyao-yin marked this conversation as resolved.
Show resolved Hide resolved
values:
2022-01-01: 16_862
metadata:
unit: currency-CAD
label: Nunavut married status additional max amount
reference:
- title: Nunavut Income Tax Act Subvision C Section 2.14
href: https://www.nunavutlegislation.ca/en/consolidated-law/income-tax-act-consolidation
- title: 2022 Form NU428, Nunavut Tax
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5014-c/5014-c-22e.pdf#page=1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description: Nunavut provides this base amount for a filer who is supporting their spouse or common law partner, living in the same household.
values:
2022-01-01: 16_862
metadata:
unit: currency-CAD
label: Nunavut married status base amount
reference:
- title: Nunavut Income Tax Act Subvision C Section 2.14
href: https://www.nunavutlegislation.ca/en/consolidated-law/income-tax-act-consolidation
- title: 2022 Form NU428, Nunavut Tax
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5014-c/5014-c-22e.pdf#page=1
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
- name: No dependent in the household
period: 2023
input:
people:
head:
is_head: true
households:
household:
members: [head]
province_code: NU
output:
nu_eligible_dependent_credit: 0

- name: Independent spouse and independent third person in the household
period: 2023
input:
people:
head:
is_head: true
spouse:
is_spouse: true
is_dependant: false
individual_net_income: 10_000
dependent:
is_spouse: false
is_dependant : false
individual_net_income : 10_000
household:
members: [head, spouse, dependent]
province_code: NU
output:
nu_eligible_dependent_credit: 0

- name: Independent spouse and dependent third person in the household with less than 16000 income
period: 2023
input:
people:
head:
is_head: true
spouse:
is_spouse: true
is_dependant: false
individual_net_income: 10_000
dependent:
is_spouse : false
is_dependant : true
individual_net_income : 10_000
household:
members: [head, spouse, dependent]
province_code: NU
output:
nu_eligible_dependent_credit: 23_724

- name: Dependent spouse and dependent third person in the household with less than 16000 income
period: 2023
input:
people:
head:
is_head: true
spouse:
is_spouse: true
is_dependant: true
individual_net_income: 10_000
dependent:
is_spouse: false
is_dependant : true
individual_net_income : 10_000
household:
members: [head, spouse, dependent]
province_code: NU
output:
nu_eligible_dependent_credit: 0

- name: Dependent third person in the household with less than 16000 income
period: 2023
input:
people:
head:
is_head: true
dependent:
is_spouse: false
is_dependant : true
individual_net_income : 10_000
household:
members: [head, dependent]
province_code: NU
output:
nu_eligible_dependent_credit: 23_724

- name: Independent spouse and dependent third person in the household with more than 16000 income
period: 2023
input:
people:
head:
is_head: true
spouse:
is_spouse: true
is_dependant: false
individual_net_income: 10_000
dependent:
is_spouse: false
is_dependant : true
individual_net_income : 20_000
household:
members: [head, spouse, dependent]
province_code: NU
output:
nu_eligible_dependent_credit: 16_862
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
- name: Ineligible for having no member in the household
period: 2023
input:
people:
head:
is_head: true
households:
household:
members: [head]
province_code: NU
output:
nu_eligible_dependent_credit_eligible: false

- name: Ineligible for having no dependent member in the household
period: 2023
input:
people:
head:
is_head: true
member:
is_dependant: false
households:
household:
members: [head, member]
province_code: NU
output:
nu_eligible_dependent_credit_eligible: false

- name: Ineligible for having dependent spouse in the household in addition to the dependent member
period: 2023
input:
people:
head:
is_head: true
spouse:
is_spouse: true
is_dependant: true
dependent:
is_spouse: false
is_dependant : true
household:
members: [head, spouse, dependent]
province_code: NU
output:
nu_eligible_dependent_credit_eligible: false

- name: Eligible for having dependent member in the household
period: 2023
input:
people:
head:
is_head: true
dependent:
is_dependant : true
household:
members: [head, dependent]
province_code: NU
output:
nu_eligible_dependent_credit_eligible: true

Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
- name: No spouse in the household
period: 2023
input:
people:
head:
is_head: true
household:
members: [head]
province_code: NU
output:
nu_married_status_credit: 0

- name: Spouse in the household but independent
period: 2023
input:
people:
head:
is_head: true
spouse:
is_spouse: true
is_dependant: false
individual_net_income: 10_000
household:
members: [head, spouse]
province_code: NU
output:
nu_married_status_credit: 0

- name: Dependent spouse in the household with income less than 1600
period: 2023
input:
people:
head:
is_head: true
spouse:
is_spouse: true
is_dependant: true
individual_net_income: 10_000
household:
members: [head, spouse]
province_code: NU
output:
nu_married_status_credit: 23_724

- name: Dependent spouse in the household with income more than 1600
period: 2023
input:
people:
head:
is_head: true
spouse:
is_spouse: true
is_dependant: true
individual_net_income: 20_000
household:
members: [head, spouse]
province_code: NU
output:
nu_married_status_credit: 16_862
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
- name: Ineligible for having no spouse
period: 2023
input:
people:
head:
is_head: true
household:
members: [head]
province_code: NU
output:
nu_married_status_credit_eligible: false

- name: Ineligible for having no dependent spouse
period: 2023
input:
people:
head:
is_head: true
spouse:
is_spouse: true
is_dependant: false
household:
members: [head, spouse]
province_code: NU
output:
nu_married_status_credit_eligible: false

- name: Ineligible for having dependent household member in addition to dependent spouse
period: 2023
input:
people:
head:
is_head: true
spouse:
is_spouse: true
is_dependant: true
dependent:
is_spouse: false
is_dependant: true
household:
members: [head, spouse, dependent]
province_code: NU
output:
nu_married_status_credit_eligible: false

- name: Eligible
period: 2023
input:
people:
head:
is_head: true
spouse:
is_spouse: true
is_dependant: true
household:
members: [head, spouse]
province_code: NU
output:
nu_married_status_credit_eligible: true
runyao-yin marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from policyengine_canada.model_api import *


class nu_eligible_dependent_credit(Variable):
value_type = float
entity = Household
label = "Nunavut eligible dependent credit"
definition_period = YEAR
defined_for = "nu_eligible_dependent_credit_eligible"

def formula(household, period, parameters):
person = household.members
p = parameters(
period
).gov.provinces.nu.tax.income.credits.eligible_dependent_credit

spouse = person("is_spouse", period)
dependent = person("is_dependant", period)
income_eligible = (~spouse) & dependent
income = income_eligible * person("individual_net_income", period)
eligible_income = household.sum(income)
max_amount = max_(0, p.amount.additional - eligible_income)
return p.amount.base + max_amount
runyao-yin marked this conversation as resolved.
Show resolved Hide resolved
runyao-yin marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from policyengine_canada.model_api import *


class nu_eligible_dependent_credit_eligible(Variable):
value_type = bool
entity = Household
label = "Eligible for the Nunavut eligible dependent credit"
definition_period = YEAR
defined_for = ProvinceCode.NU

def formula(household, period, parameters):
person = household.members
p = parameters(
period
).gov.provinces.nu.tax.income.credits.eligible_dependent_credit
spouse = person("is_spouse", period)
dependent = person("is_dependant", period)
dependent_spouse = household.any(spouse & dependent)
dependent_non_spouse = household.any((~spouse) & dependent)
# The household can only be eligible for one of the credits:
# eligible dependent credit and married status credit.
return (~dependent_spouse) & (dependent_non_spouse)

Loading