From a767f0de7d4908b887c8f32024346c5d80c67cfc Mon Sep 17 00:00:00 2001 From: Yiwei Jia Date: Thu, 30 Nov 2023 16:34:41 -0500 Subject: [PATCH 1/4] British Columbia Family Benefit Temporary Enhanced Monthly Benefit Fixes #119 --- .../bc/benefits/bcfb/temporary_enhancement/max_amount.yaml | 0 .../benefits/bcfb/temporary_enhancement/phase_out_rate.yaml | 4 ++++ 2 files changed, 4 insertions(+) create mode 100644 policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/max_amount.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out_rate.yaml diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/max_amount.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/max_amount.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out_rate.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out_rate.yaml new file mode 100644 index 000000000..472213ffa --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out_rate.yaml @@ -0,0 +1,4 @@ +description: British Columbia phases family benefit temporary enhancement amount out at this rate, based on net income. +brackets: + - threshold: + \ No newline at end of file From 0d834a6cb6d7b8c88952ce88c26aadfae302ca0d Mon Sep 17 00:00:00 2001 From: Yiwei Jia Date: Fri, 1 Dec 2023 12:23:29 -0500 Subject: [PATCH 2/4] Completed models --- changelog_entry.yaml | 4 ++ .../temporary_enhancement/max_amount.yaml | 12 ++++ .../minimum_amount_middle_family_income.yaml | 12 ++++ .../temporary_enhancement/phase_out_rate.yaml | 4 -- .../phase_out_rate_high_income.yaml | 21 +++++++ .../phase_out_rate_middle_income.yaml | 26 +++++++++ ..._family_benefit_temporary_enhancement.yaml | 58 +++++++++++++++++++ ...bc_family_benefit_temporary_enhancement.py | 49 ++++++++++++++++ 8 files changed, 182 insertions(+), 4 deletions(-) create mode 100644 policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/minimum_amount_middle_family_income.yaml delete mode 100644 policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out_rate.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out_rate_high_income.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out_rate_middle_income.yaml create mode 100644 policyengine_canada/tests/gov/provinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.yaml create mode 100644 policyengine_canada/variables/gov/provinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.py diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..42e1f291a 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: minor + changes: + added: + - British Columbia family benefit temporary enhanced monthly benefit. diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/max_amount.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/max_amount.yaml index e69de29bb..075e4bf33 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/max_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/max_amount.yaml @@ -0,0 +1,12 @@ +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: 175 # up to $58.33 monthly per child + 2023-04-01: 0 +metadata: + unit: currency-CAD + 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 diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/minimum_amount_middle_family_income.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/minimum_amount_middle_family_income.yaml new file mode 100644 index 000000000..1684bb07e --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/minimum_amount_middle_family_income.yaml @@ -0,0 +1,12 @@ +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: 150 # up to $50 monthly per child + 2023-04-01: 0 +metadata: + unit: currency-CAD + 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 diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out_rate.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out_rate.yaml deleted file mode 100644 index 472213ffa..000000000 --- a/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out_rate.yaml +++ /dev/null @@ -1,4 +0,0 @@ -description: British Columbia phases family benefit temporary enhancement amount out at this rate, based on net income. -brackets: - - threshold: - \ No newline at end of file diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out_rate_high_income.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out_rate_high_income.yaml new file mode 100644 index 000000000..6404964c1 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out_rate_high_income.yaml @@ -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 + diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out_rate_middle_income.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out_rate_middle_income.yaml new file mode 100644 index 000000000..ac5d9460a --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out_rate_middle_income.yaml @@ -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 + diff --git a/policyengine_canada/tests/gov/provinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.yaml b/policyengine_canada/tests/gov/provinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.yaml new file mode 100644 index 000000000..f108ecaaa --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.yaml @@ -0,0 +1,58 @@ +- name: Temporary Enhancement with 1 Child and Low Family Net Income + period: 2023 + input: + province_code: BC + bc_family_benefit_eligible_children: 1 + adjusted_family_net_income: 25_000 + output: + bc_family_benefit_temporary_enhancement: 175 + +- name: 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: 350 + +- name: 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.48 + + +- name: 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: 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: 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 diff --git a/policyengine_canada/variables/gov/provinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.py b/policyengine_canada/variables/gov/provinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.py new file mode 100644 index 000000000..d9a310f64 --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.py @@ -0,0 +1,49 @@ +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 + phase_out_amount_middle_income = p.phase_out_rate_middle_income.calc( + family_net_income + ) + phase_out_amount_high_income = p.phase_out_rate_high_income.calc( + family_net_income + ) + return select( + [ + family_net_income + < p.phase_out_rate_middle_income.thresholds[1], + p.phase_out_rate_middle_income.thresholds[1] + < family_net_income + < p.phase_out_rate_middle_income.thresholds[2], + family_net_income + > p.phase_out_rate_middle_income.thresholds[2], + ], + [ + p.max_amount * children, + max_( + p.max_amount - phase_out_amount_middle_income, + p.minimum_amount_middle_family_income, + ) + * children, + max_( + p.minimum_amount_middle_family_income + - phase_out_amount_high_income, + 0, + ) + * children, + ], + ) From b2551570dc4231a155498bb217fd473e432cab0a Mon Sep 17 00:00:00 2001 From: Yiwei Jia Date: Wed, 13 Dec 2023 21:24:05 -0500 Subject: [PATCH 3/4] Updated yaml and py files --- .../{max_amount.yaml => amount.yaml} | 3 +- .../bcfb/temporary_enhancement/cap_month.yaml | 13 +++++ .../income_threshold.yaml} | 3 +- .../high.yaml} | 0 .../middle.yaml} | 0 ..._family_benefit_temporary_enhancement.yaml | 19 ++++--- ...bc_family_benefit_temporary_enhancement.py | 57 +++++++++++-------- 7 files changed, 60 insertions(+), 35 deletions(-) rename policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/{max_amount.yaml => amount.yaml} (87%) create mode 100644 policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/cap_month.yaml rename policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/{minimum_amount_middle_family_income.yaml => income_threshold/income_threshold.yaml} (90%) rename policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/{phase_out_rate_high_income.yaml => phase_out/high.yaml} (100%) rename policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/{phase_out_rate_middle_income.yaml => phase_out/middle.yaml} (100%) diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/max_amount.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/amount.yaml similarity index 87% rename from policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/max_amount.yaml rename to policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/amount.yaml index 075e4bf33..826b16088 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/max_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/amount.yaml @@ -1,10 +1,11 @@ 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: 175 # up to $58.33 monthly per child + 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 diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/cap_month.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/cap_month.yaml new file mode 100644 index 000000000..8e5c665d1 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/cap_month.yaml @@ -0,0 +1,13 @@ +description: British Columbia caps months for temporary enhancement. +values: +# only for the period January 2023 to March 2023 + 2023-01-01: 3 + 2023-04-01: 0 +metadata: + unit: month + period: month + 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 diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/minimum_amount_middle_family_income.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/income_threshold/income_threshold.yaml similarity index 90% rename from policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/minimum_amount_middle_family_income.yaml rename to policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/income_threshold/income_threshold.yaml index 1684bb07e..d235260d9 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/minimum_amount_middle_family_income.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/income_threshold/income_threshold.yaml @@ -1,10 +1,11 @@ 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: 150 # up to $50 monthly per child + 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 diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out_rate_high_income.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out/high.yaml similarity index 100% rename from policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out_rate_high_income.yaml rename to policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out/high.yaml diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out_rate_middle_income.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out/middle.yaml similarity index 100% rename from policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out_rate_middle_income.yaml rename to policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/phase_out/middle.yaml diff --git a/policyengine_canada/tests/gov/provinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.yaml b/policyengine_canada/tests/gov/provinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.yaml index f108ecaaa..803284417 100644 --- a/policyengine_canada/tests/gov/provinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.yaml +++ b/policyengine_canada/tests/gov/provinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.yaml @@ -1,22 +1,23 @@ -- name: Temporary Enhancement with 1 Child and Low Family Net Income +- 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: 175 + bc_family_benefit_temporary_enhancement: 174.99 -- name: Temporary Enhancement with 2 Children and Low Family Net Income +- 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: 350 + bc_family_benefit_temporary_enhancement: 349.98 -- name: Temporary Enhancement with 3 Children and Middle Family Net Income - Deductible +- name: Case 3, Temporary Enhancement with 3 Children and Middle Family Net Income - Deductible period: 2023 absolute_error_margin: 0.01 input: @@ -24,10 +25,10 @@ bc_family_benefit_eligible_children: 3 adjusted_family_net_income: 30_000 output: - bc_family_benefit_temporary_enhancement: 483.48 + bc_family_benefit_temporary_enhancement: 483.45 -- name: Temporary Enhancement with 3 Children and Middle Family Net Income - Minimum Benefit +- name: Case 4, Temporary Enhancement with 3 Children and Middle Family Net Income - Minimum Benefit period: 2023 absolute_error_margin: 0.01 input: @@ -37,7 +38,7 @@ output: bc_family_benefit_temporary_enhancement: 450 -- name: Temporary Enhancement with 4 Children and High Family Net Income - Deductible +- name: Case 5, Temporary Enhancement with 4 Children and High Family Net Income - Deductible period: 2023 absolute_error_margin: 0.01 input: @@ -47,7 +48,7 @@ output: bc_family_benefit_temporary_enhancement: 502.03 -- name: Temporary Enhancement with 4 Children and High Family Net Income - Zero +- name: Case 6, Temporary Enhancement with 4 Children and High Family Net Income - Zero period: 2023 absolute_error_margin: 0.01 input: diff --git a/policyengine_canada/variables/gov/provinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.py b/policyengine_canada/variables/gov/provinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.py index d9a310f64..fa5811142 100644 --- a/policyengine_canada/variables/gov/provinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.py +++ b/policyengine_canada/variables/gov/provinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.py @@ -16,34 +16,43 @@ def formula(household, period, parameters): p = parameters( period ).gov.provinces.bc.benefits.bcfb.temporary_enhancement - phase_out_amount_middle_income = p.phase_out_rate_middle_income.calc( - family_net_income + months = p.cap_month + 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] ) - phase_out_amount_high_income = p.phase_out_rate_high_income.calc( + 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( + [low_family_income, middle_family_income, high_family_income], [ - family_net_income - < p.phase_out_rate_middle_income.thresholds[1], - p.phase_out_rate_middle_income.thresholds[1] - < family_net_income - < p.phase_out_rate_middle_income.thresholds[2], - family_net_income - > p.phase_out_rate_middle_income.thresholds[2], - ], - [ - p.max_amount * children, - max_( - p.max_amount - phase_out_amount_middle_income, - p.minimum_amount_middle_family_income, - ) - * children, - max_( - p.minimum_amount_middle_family_income - - phase_out_amount_high_income, - 0, - ) - * children, + temporary_enhancement_low_family_income, + temporary_enhancement_middle_family_income, + temporary_enhancement_high_family_income, ], ) From 62265e32b18e460d424d1bafdb468d1b7f0a5c74 Mon Sep 17 00:00:00 2001 From: Yiwei Jia Date: Thu, 21 Dec 2023 14:55:25 -0500 Subject: [PATCH 4/4] Updated cap_month and MONTHS_IN_YEAR --- .../bc/benefits/bcfb/temporary_enhancement/cap_month.yaml | 3 +-- .../bc_family_benefit_temporary_enhancement.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/cap_month.yaml b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/cap_month.yaml index 8e5c665d1..ba1ca3bc3 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/cap_month.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/benefits/bcfb/temporary_enhancement/cap_month.yaml @@ -2,10 +2,9 @@ description: British Columbia caps months for temporary enhancement. values: # only for the period January 2023 to March 2023 2023-01-01: 3 - 2023-04-01: 0 metadata: unit: month - period: month + period: year label: British Columbia caps months reference: # this temporary enhancement is not mentioned in the B.C. Income Tax Act diff --git a/policyengine_canada/variables/gov/provinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.py b/policyengine_canada/variables/gov/provinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.py index fa5811142..ad3e1ddfb 100644 --- a/policyengine_canada/variables/gov/provinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.py +++ b/policyengine_canada/variables/gov/provinces/bc/benefits/bcfb/temporary_enhancement/bc_family_benefit_temporary_enhancement.py @@ -16,7 +16,7 @@ def formula(household, period, parameters): p = parameters( period ).gov.provinces.bc.benefits.bcfb.temporary_enhancement - months = p.cap_month + months = min_(p.cap_month, MONTHS_IN_YEAR) low_family_income = ( family_net_income < p.phase_out.middle.thresholds[1] )