-
Notifications
You must be signed in to change notification settings - Fork 35
British Columbia Family Benefit Temporary Enhanced Monthly Benefit #472
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
Open
YiweiJ
wants to merge
5
commits into
PolicyEngine:master
Choose a base branch
from
YiweiJ:YiweiJ/issue119
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.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a767f0d
British Columbia Family Benefit Temporary Enhanced Monthly Benefit
YiweiJ 0d834a6
Completed models
YiweiJ 41b7975
Merge branch 'master' of https://github.com/PolicyEngine/policyengine…
YiweiJ b255157
Updated yaml and py files
YiweiJ 62265e3
Updated cap_month and MONTHS_IN_YEAR
YiweiJ 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 hidden or 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,4 @@ | ||
| - bump: minor | ||
| changes: | ||
| added: | ||
| - British Columbia family benefit temporary enhanced monthly benefit. |
13 changes: 13 additions & 0 deletions
13
...engine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/amount.yaml
This file contains hidden or 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,13 @@ | ||
| description: British Columbia provides this max temporary enhanced benefit to to eligible family. | ||
| values: | ||
| # only for the period January 2023 to March 2023 | ||
| 2023-01-01: 58.33 # up to $58.33 monthly per child | ||
| 2023-04-01: 0 | ||
| metadata: | ||
| unit: currency-CAD | ||
| period: month | ||
| label: British Columbia max family benefit temporary enhancement amount | ||
| reference: | ||
| # this temporary enhancement is not mentioned in the B.C. Income Tax Act | ||
| - title: B.C. family benefit | ||
| href: https://www2.gov.bc.ca/gov/content/family-social-supports/affordability/family-benefit |
12 changes: 12 additions & 0 deletions
12
...ine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/cap_month.yaml
This file contains hidden or 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,12 @@ | ||
| description: British Columbia caps months for temporary enhancement. | ||
| values: | ||
| # only for the period January 2023 to March 2023 | ||
| 2023-01-01: 3 | ||
| metadata: | ||
| unit: month | ||
| period: year | ||
| label: British Columbia caps months | ||
| reference: | ||
| # this temporary enhancement is not mentioned in the B.C. Income Tax Act | ||
| - title: B.C. family benefit | ||
| href: https://www2.gov.bc.ca/gov/content/family-social-supports/affordability/family-benefit |
13 changes: 13 additions & 0 deletions
13
...v/provinces/bc/benefits/bcfb/temporary_enhancement/income_threshold/income_threshold.yaml
This file contains hidden or 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,13 @@ | ||
| description: British Columbia provides this minimum temporary enhanced benefit to to eligible family, based on family net income. | ||
| values: | ||
| # only for the period January 2023 to March 2023 | ||
| 2023-01-01: 50 # up to $50 monthly per child | ||
| 2023-04-01: 0 | ||
| metadata: | ||
| unit: currency-CAD | ||
| period: month | ||
| label: British Columbia minimum family benefit temporary enhancement amount for middle range of family net income | ||
| reference: | ||
| # this temporary enhancement is not mentioned in the B.C. Income Tax Act | ||
| - title: B.C. family benefit | ||
| href: https://www2.gov.bc.ca/gov/content/family-social-supports/affordability/family-benefit |
21 changes: 21 additions & 0 deletions
21
...anada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out/high.yaml
This file contains hidden or 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,21 @@ | ||
| description: British Columbia phases family benefit temporary enhancement amount out at this rate, based on high family net income. | ||
| brackets: | ||
| - threshold: | ||
| 2021-07-01: 0 | ||
| rate: | ||
| 2021-07-01: 0 | ||
| - threshold: | ||
| 2021-07-01: 82_578 | ||
| rate: | ||
| 2021-07-01: 0.0033 | ||
|
|
||
| metadata: | ||
| type: marginal_rate | ||
| threshold_unit: currency-CAD | ||
| rate_unit: /1 | ||
| label: British Columbia phase out rate of high family net income # above $82_578 | ||
| reference: | ||
| # this temporary enhancement is not mentioned in the B.C. Income Tax Act | ||
| - title: B.C. family benefit | ||
| href: https://www2.gov.bc.ca/gov/content/family-social-supports/affordability/family-benefit | ||
|
|
26 changes: 26 additions & 0 deletions
26
...ada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out/middle.yaml
This file contains hidden or 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,26 @@ | ||
| description: British Columbia phases family benefit temporary enhancement amount out at this rate, based on middle range of previous year family net income. | ||
| brackets: | ||
| - threshold: | ||
| 2021-07-01: 0 | ||
| rate: | ||
| 2021-07-01: 0 | ||
| - threshold: | ||
| 2021-07-01: 25_806 | ||
| rate: | ||
| 2021-07-01: 0.0033 | ||
| - threshold: | ||
| 2021-07-01: 82_578 | ||
| rate: | ||
| 2021-07-01: 0 | ||
|
|
||
|
|
||
| metadata: | ||
| type: marginal_rate | ||
| threshold_unit: currency-CAD | ||
| rate_unit: /1 | ||
| label: British Columbia phase out rate of middel range of family net income # from $25_806 to $82_578 | ||
| reference: | ||
| # this temporary enhancement is not mentioned in the B.C. Income Tax Act | ||
| - title: B.C. family benefit | ||
| href: https://www2.gov.bc.ca/gov/content/family-social-supports/affordability/family-benefit | ||
|
|
59 changes: 59 additions & 0 deletions
59
...inces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.yaml
This file contains hidden or 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: Case 1, Temporary Enhancement with 1 Child and Low Family Net Income | ||
| period: 2023 | ||
| absolute_error_margin: 0.01 | ||
| input: | ||
| province_code: BC | ||
| bc_family_benefit_eligible_children: 1 | ||
| adjusted_family_net_income: 25_000 | ||
| output: | ||
| bc_family_benefit_temporary_enhancement: 174.99 | ||
|
|
||
| - name: Case 2, Temporary Enhancement with 2 Children and Low Family Net Income | ||
| period: 2023 | ||
| input: | ||
| province_code: BC | ||
| bc_family_benefit_eligible_children: 2 | ||
| adjusted_family_net_income: 25_000 | ||
| output: | ||
| bc_family_benefit_temporary_enhancement: 349.98 | ||
|
|
||
| - name: Case 3, Temporary Enhancement with 3 Children and Middle Family Net Income - Deductible | ||
| period: 2023 | ||
| absolute_error_margin: 0.01 | ||
| input: | ||
| province_code: BC | ||
| bc_family_benefit_eligible_children: 3 | ||
| adjusted_family_net_income: 30_000 | ||
| output: | ||
| bc_family_benefit_temporary_enhancement: 483.45 | ||
|
|
||
|
|
||
| - name: Case 4, Temporary Enhancement with 3 Children and Middle Family Net Income - Minimum Benefit | ||
| period: 2023 | ||
| absolute_error_margin: 0.01 | ||
| input: | ||
| province_code: BC | ||
| bc_family_benefit_eligible_children: 3 | ||
| adjusted_family_net_income: 82_000 | ||
| output: | ||
| bc_family_benefit_temporary_enhancement: 450 | ||
|
|
||
| - name: Case 5, Temporary Enhancement with 4 Children and High Family Net Income - Deductible | ||
| period: 2023 | ||
| absolute_error_margin: 0.01 | ||
| input: | ||
| province_code: BC | ||
| bc_family_benefit_eligible_children: 4 | ||
| adjusted_family_net_income: 90_000 | ||
| output: | ||
| bc_family_benefit_temporary_enhancement: 502.03 | ||
|
|
||
| - name: Case 6, Temporary Enhancement with 4 Children and High Family Net Income - Zero | ||
| period: 2023 | ||
| absolute_error_margin: 0.01 | ||
| input: | ||
| province_code: BC | ||
| bc_family_benefit_eligible_children: 4 | ||
| adjusted_family_net_income: 200_000 | ||
| output: | ||
| bc_family_benefit_temporary_enhancement: 0 |
58 changes: 58 additions & 0 deletions
58
...ovinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.py
This file contains hidden or 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,58 @@ | ||
| from policyengine_canada.model_api import * | ||
|
|
||
|
|
||
| class bc_family_benefit_temporary_enhancement(Variable): | ||
| value_type = float | ||
| entity = Household | ||
| label = "British Columbia family benefit temporary enhancement" | ||
| unit = CAD | ||
| definition_period = YEAR | ||
| defined_for = ProvinceCode.BC | ||
| reference = "https://www2.gov.bc.ca/gov/content/family-social-supports/affordability/family-benefit" | ||
|
|
||
| def formula(household, period, parameters): | ||
| children = household("bc_family_benefit_eligible_children", period) | ||
| family_net_income = household("adjusted_family_net_income", period) | ||
| p = parameters( | ||
| period | ||
| ).gov.provinces.bc.benefits.bcfb.temporary_enhancement | ||
| months = min_(p.cap_month, MONTHS_IN_YEAR) | ||
| low_family_income = ( | ||
| family_net_income < p.phase_out.middle.thresholds[1] | ||
| ) | ||
| middle_family_income = ( | ||
| p.phase_out.middle.thresholds[1] | ||
| < family_net_income | ||
| < p.phase_out.middle.thresholds[2] | ||
| ) | ||
| high_family_income = ( | ||
| family_net_income > p.phase_out.middle.thresholds[2] | ||
| ) | ||
| phase_out_amount_middle_income = p.phase_out.middle.calc( | ||
| family_net_income | ||
| ) | ||
| phase_out_amount_high_income = p.phase_out.high.calc(family_net_income) | ||
| temporary_enhancement_low_family_income = p.amount * children * months | ||
| temporary_enhancement_middle_family_income = ( | ||
| max_( | ||
| p.amount * months - phase_out_amount_middle_income, | ||
| p.income_threshold.income_threshold * months, | ||
| ) | ||
| * children | ||
| ) | ||
| temporary_enhancement_high_family_income = ( | ||
| max_( | ||
| p.income_threshold.income_threshold * months | ||
| - phase_out_amount_high_income, | ||
| 0, | ||
| ) | ||
| * children | ||
| ) | ||
| return select( | ||
YiweiJ marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| [low_family_income, middle_family_income, high_family_income], | ||
| [ | ||
| temporary_enhancement_low_family_income, | ||
| temporary_enhancement_middle_family_income, | ||
| temporary_enhancement_high_family_income, | ||
| ], | ||
| ) | ||
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.
Uh oh!
There was an error while loading. Please reload this page.