-
Notifications
You must be signed in to change notification settings - Fork 33
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
runyao-yin
wants to merge
52
commits into
PolicyEngine:master
Choose a base branch
from
runyao-yin:runyao-yin/issue314
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 49 commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
ed03ea0
initial changes
runyao-yin 53621ab
Fixes issue 314
runyao-yin 0069f37
fixes issue 314
runyao-yin 49231e8
fixes issue 314 and issue 324
runyao-yin 369ca7c
Merge branch 'master' of https://github.com/PolicyEngine/policyengine…
runyao-yin 93968b9
Update addon_max_amount.yaml
runyao-yin aa6e892
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin b067834
Update base.yaml
runyao-yin 6ec4da9
Update base.yaml
runyao-yin 56d24af
Update addon_max_amount.yaml
runyao-yin 0f760e1
Update base.yaml
runyao-yin ec785e6
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin 60e451f
Update nu_married_status_credit.py
runyao-yin d82a09b
Update nu_eligible_dependent_credit.yaml
runyao-yin 6a473ae
Update nu_married_status_credit.yaml
runyao-yin 527262d
Update reference
runyao-yin a1479c1
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin cfa440e
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin 210b85e
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin d372c5c
Fixes
runyao-yin 8d42b47
Merge branch 'master' of https://github.com/PolicyEngine/policyengine…
runyao-yin 8e1156a
edit for newest comments
runyao-yin 5c9d097
fixes
runyao-yin 8a784ad
fixes
runyao-yin cf29afd
Update nu_eligible_dependent_credit_eligible.py
runyao-yin 53aa977
Update changelog_entry.yaml
runyao-yin 3da9350
Update changelog_entry.yaml
runyao-yin 4bf54c6
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin 2b5d20a
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin 22a170e
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin f39ae06
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin 38a0dda
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin 04605b0
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin 807c1d8
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin 6621dd7
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin f46ed2b
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin a37d6fa
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin 1f58f99
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin b7d52f7
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin a0f5167
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin 2817e6f
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin 67071fb
Update changelog_entry.yaml
runyao-yin c3b394c
Update changelog_entry.yaml
runyao-yin eba7f36
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin b90adbb
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin 5f22625
Update policyengine_canada/variables/gov/provinces/nu/tax/income/cred…
runyao-yin 42c8abf
Update nu_married_status_credit.py
runyao-yin d239203
fixes
runyao-yin 1f195c2
Add eligible variables' tests
runyao-yin 4c9d37a
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin 2af38ad
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin 5216fa5
Update policyengine_canada/parameters/gov/provinces/nu/tax/income/cre…
runyao-yin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
11 changes: 11 additions & 0 deletions
11
...ters/gov/provinces/nu/tax/income/credits/eligible_dependent_credit/amount/additional.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
11 changes: 11 additions & 0 deletions
11
...parameters/gov/provinces/nu/tax/income/credits/eligible_dependent_credit/amount/base.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
11 changes: 11 additions & 0 deletions
11
...rameters/gov/provinces/nu/tax/income/credits/married_status_credit/amount/additional.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
11 changes: 11 additions & 0 deletions
11
...ada/parameters/gov/provinces/nu/tax/income/credits/married_status_credit/amount/base.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
108 changes: 108 additions & 0 deletions
108
...engine_canada/tests/gov/provinces/nu/tax/income/credits/nu_eligible_dependent_credit.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
60 changes: 60 additions & 0 deletions
60
...nada/tests/gov/provinces/nu/tax/income/credits/nu_eligible_dependent_credit_eligible.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
59 changes: 59 additions & 0 deletions
59
policyengine_canada/tests/gov/provinces/nu/tax/income/credits/nu_married_status_credit.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
59 changes: 59 additions & 0 deletions
59
...e_canada/tests/gov/provinces/nu/tax/income/credits/nu_married_status_credit_eligible.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
23 changes: 23 additions & 0 deletions
23
...gine_canada/variables/gov/provinces/nu/tax/income/credits/nu_eligible_dependent_credit.py
runyao-yin marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
|
23 changes: 23 additions & 0 deletions
23
...da/variables/gov/provinces/nu/tax/income/credits/nu_eligible_dependent_credit_eligible.py
runyao-yin marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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