From c6e4546e853cdcdc03155dd651b2cc507a0aa67b Mon Sep 17 00:00:00 2001 From: hua7450 <113824411+hua7450@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:53:19 +0000 Subject: [PATCH 1/9] District Child Tax Credit Fixes #5183 Co-authored-by: Pinyan --- changelog_entry.yaml | 1 + .../dc/tax/income/credits/ctc/README.md | 1 + .../dc/tax/income/credits/ctc/amount.yaml | 16 +++++ .../credits/ctc/child/age_threshold.yaml | 11 ++++ .../ctc/child/max_qualifying_children.yaml | 9 +++ .../income/credits/ctc/income_threshold.yaml | 56 ++++++++++++++++ .../income/credits/ctc/phase_out/amount.yaml | 10 +++ .../credits/ctc/phase_out/increment.yaml | 10 +++ .../dc/tax/income/credits/refundable.yaml | 4 ++ .../gov/states/dc/tax/income/ctc/dc_ctc.yaml | 40 ++++++++++++ .../ctc/dc_ctc_eligible_children_count.yaml | 64 +++++++++++++++++++ .../dc/tax/income/credits/ctc/dc_ctc.py | 33 ++++++++++ .../credits/ctc/dc_ctc_qualify_child.py | 20 ++++++ 13 files changed, 275 insertions(+) create mode 100644 policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/README.md create mode 100644 policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/amount.yaml create mode 100644 policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/age_threshold.yaml create mode 100644 policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/max_qualifying_children.yaml create mode 100644 policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/income_threshold.yaml create mode 100644 policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/amount.yaml create mode 100644 policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/increment.yaml create mode 100644 policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc.yaml create mode 100644 policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc_eligible_children_count.yaml create mode 100644 policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py create mode 100644 policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_qualify_child.py diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb2d..8b137891791 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1 @@ + diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/README.md b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/README.md new file mode 100644 index 00000000000..6731dd9cb79 --- /dev/null +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/README.md @@ -0,0 +1 @@ +# Child Tax Credit. diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/amount.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/amount.yaml new file mode 100644 index 00000000000..f7c9d3a9399 --- /dev/null +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/amount.yaml @@ -0,0 +1,16 @@ +description: DC Child Tax Credit is limited to this amount per eligible child. +metadata: + unit: currency-USD + label: DC CTC amount per eligible child + period: year + uprating: + parameter: gov.irs.uprating + rounding: + type: downwards + interval: 5 + reference: + - title: Code of the District of Columbia § 47–1806.17(b)(1) + href: https://code.dccouncil.gov/us/dc/council/code/sections/47-1806.17#(b)(1) + +values: + 2025-01-01: 420 diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/age_threshold.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/age_threshold.yaml new file mode 100644 index 00000000000..07f297d5b6b --- /dev/null +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/age_threshold.yaml @@ -0,0 +1,11 @@ +description: DC limits Child Tax Credit to children below this age. +metadata: + unit: age + label: DC CTC child age threshold + period: year + reference: + - title: Code of the District of Columbia § 47–1806.17(b)(1) + href: https://code.dccouncil.gov/us/dc/council/code/sections/47-1806.17#(b)(1) + +values: + 2025-01-01: 6 diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/max_qualifying_children.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/max_qualifying_children.yaml new file mode 100644 index 00000000000..8a6d2da8778 --- /dev/null +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/max_qualifying_children.yaml @@ -0,0 +1,9 @@ +description: DC limits the number of qualifying children for the Child Tax Credit to this amount. +values: + 2025-01-01: 3 +metadata: + type: single_amount + label: DC CTC max quafilying children amount + reference: + - title: Code of the District of Columbia § 47–1806.17(b)(2) + href: https://code.dccouncil.gov/us/dc/council/code/sections/47-1806.17##(b)(2) diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/income_threshold.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/income_threshold.yaml new file mode 100644 index 00000000000..ea2123f5b16 --- /dev/null +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/income_threshold.yaml @@ -0,0 +1,56 @@ +description: DC limits its Child Tax Credit to filers with taxable income below the following amount, based on filing status. +metadata: + label: DC CTC taxable income threshold + unit: currency_USD + period: year + breakdown: + - filing_status + reference: + - title: Code of the District of Columbia § 47–1806.17(e)(5) + href: https://code.dccouncil.gov/us/dc/council/code/sections/47-1806.17#(e)(5) + +SINGLE: + values: + 2025-01-01: 160_000 + metadata: + uprating: + parameter: gov.irs.uprating + rounding: + type: downwards + interval: 100 +JOINT: + values: + 2025-01-01: 240_000 + metadata: + uprating: + parameter: gov.irs.uprating + rounding: + type: downwards + interval: 100 +SEPARATE: + values: + 2025-01-01: 120_000 + metadata: + uprating: + parameter: gov.irs.uprating + rounding: + type: downwards + interval: 100 +HEAD_OF_HOUSEHOLD: + values: + 2025-01-01: 160_000 + metadata: + uprating: + parameter: gov.irs.uprating + rounding: + type: downwards + interval: 100 +SURVIVING_SPOUSE: + values: + 2025-01-01: 160_000 + metadata: + uprating: + parameter: gov.irs.uprating + rounding: + type: downwards + interval: 100 diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/amount.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/amount.yaml new file mode 100644 index 00000000000..231e730907a --- /dev/null +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/amount.yaml @@ -0,0 +1,10 @@ +description: DC reduces the Child Tax Credit expansion by this amount for each increment by which one's income exceeds the phase-out thresholds. +values: + 2025-01-01: 20 +metadata: + unit: currency-USD + label: DC CTC phase-out amount + period: year + reference: + - title: Code of the District of Columbia § 47–1806.17(b)(2) + href: https://code.dccouncil.gov/us/dc/council/code/sections/47-1806.17##(b)(2) diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/increment.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/increment.yaml new file mode 100644 index 00000000000..daf82017664 --- /dev/null +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/increment.yaml @@ -0,0 +1,10 @@ +description: DC reduces the Child Tax Credit expansion by a certain amount for each of this increment by which one's income exceeds the phase-out thresholds. +values: + 2025-01-01: 1_000 +metadata: + unit: currency-USD + label: DC CTC phase-out increment + period: year + reference: + - title: Code of the District of Columbia § 47–1806.17(b)(2) + href: https://code.dccouncil.gov/us/dc/council/code/sections/47-1806.17#(b)(2) diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/refundable.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/refundable.yaml index bb817122bb4..0e2eb6ffb84 100644 --- a/policyengine_us/parameters/gov/states/dc/tax/income/credits/refundable.yaml +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/refundable.yaml @@ -15,3 +15,7 @@ values: - dc_eitc # DC earned income tax credit - dc_ptc # DC property tax credit - dc_kccatc # DC keep child care affordable tax credit + + 2025-01-01: + - dc_ctc + diff --git a/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc.yaml b/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc.yaml new file mode 100644 index 00000000000..9f36efbdc78 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc.yaml @@ -0,0 +1,40 @@ +- name: Case 1, no phase_out, single filer with 2 qualifying children. + period: 2025 + input: + adjusted_gross_income: 120_000 + filing_status: SINGLE + dc_ctc_eligible_children_count: 2 + state_code: DC + output: + dc_ctc: 840 + +- name: Case 2, no phase_out, jointly filers with 4 qualifying children. + period: 2025 + input: + adjusted_gross_income: 200_000 + filing_status: JOINT + dc_ctc_eligible_children_count: 4 + state_code: DC + output: + dc_ctc: 1_260 + +- name: Case 3, income above income threshold, single filer with 2 qualifying children. + period: 2025 + input: + adjusted_gross_income: 162_000 + filing_status: SINGLE + dc_ctc_eligible_children_count: 2 + state_code: DC + output: + dc_ctc: 800 + +- name: Case 4, income above income threshold, jointly filers with 4 qualifying children. + period: 2025 + input: + adjusted_gross_income: 245_000 + filing_status: JOINT + dc_ctc_eligible_children_count: 4 + state_code: DC + output: + dc_ctc: 1_160 + \ No newline at end of file diff --git a/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc_eligible_children_count.yaml b/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc_eligible_children_count.yaml new file mode 100644 index 00000000000..acfeaff86e7 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc_eligible_children_count.yaml @@ -0,0 +1,64 @@ +- name: Case 1, 1 dependent child that is also age qualify. + period: 2025 + input: + people: + person1: + is_tax_unit_head: true + person2: + is_tax_unit_spouse: true + person3: + is_tax_unit_dependent: true + age: 5 + tax_units: + tax_unit: + members: [person1, person2, person3] + households: + household: + members: [person1, person2, person3] + state_code: DC + output: + dc_ctc_eligible_children_count: 1 + +- name: Case 2, 2 dependent children, both age qualify. + period: 2025 + input: + people: + person1: + is_tax_unit_head: true + person2: + is_tax_unit_dependent: true + age: 4 + person3: + is_tax_unit_dependent: true + age: 5 + tax_units: + tax_unit: + members: [person1, person2, person3] + households: + household: + members: [person1, person2, person3] + state_code: DC + output: + dc_ctc_eligible_children_count: 2 + +- name: Case 3, 2 dependent children, both age unqalify. + period: 2025 + input: + people: + person1: + is_tax_unit_head: true + person2: + is_tax_unit_dependent: true + age: 8 + person3: + is_tax_unit_dependent: true + age: 7 + tax_units: + tax_unit: + members: [person1, person2, person3] + households: + household: + members: [person1, person2, person3] + state_code: DC + output: + dc_ctc_eligible_children_count: 0 diff --git a/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py new file mode 100644 index 00000000000..8b2cb082d2a --- /dev/null +++ b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py @@ -0,0 +1,33 @@ +from policyengine_us.model_api import * +from numpy import ceil + + +class dc_ctc(Variable): + value_type = float + entity = TaxUnit + label = "DC Child Tax Credit" + unit = USD + definition_period = YEAR + reference = ( + "https://code.dccouncil.gov/us/dc/council/code/sections/47-1806.17" + ) + + def formula(tax_unit, period, parameters): + p = parameters(period).gov.states.dc.tax.income.credits.ctc + income = tax_unit("adjusted_gross_income", period) + filing_status = tax_unit("filing_status", period) + income_threshold = p.income_threshold[filing_status] + # For each $1000 above income threshold, the ctc amount decrease by $20. + excess = max_(0, income - income_threshold) + increments = ceil(excess / p.phase_out.increment) + phase_out = increments * p.phase_out.amount + + eligible_children_count = tax_unit( + "dc_ctc_eligible_children_count", period + ) + children_count = min_( + p.child.max_qualifying_children, eligible_children_count + ) + amount_before_phase_out = p.amount * children_count + + return amount_before_phase_out - phase_out diff --git a/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_qualify_child.py b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_qualify_child.py new file mode 100644 index 00000000000..860437260b2 --- /dev/null +++ b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_qualify_child.py @@ -0,0 +1,20 @@ +from policyengine_us.model_api import * + + +class dc_ctc_eligible_children_count(Variable): + value_type = float + entity = TaxUnit + label = "DC CTC eligible children count" + definition_period = YEAR + reference = ( + "https://code.dccouncil.gov/us/dc/council/code/sections/47-1806.17" + ) + + def formula(tax_unit, period, parameters): + p = parameters(period).gov.states.dc.tax.income.credits.ctc.child + person = tax_unit.members + age = person("age", period) + age_qualify = age < p.age_threshold + is_dependent = person("is_tax_unit_dependent", period) + ctc_eligible_children = age_qualify & is_dependent + return tax_unit.sum(ctc_eligible_children) From 1884863e5e23a378d6926907e7c5b1053d4760e7 Mon Sep 17 00:00:00 2001 From: hua7450 <113824411+hua7450@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:55:09 +0000 Subject: [PATCH 2/9] format --- .../policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc.yaml | 1 - .../variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc.yaml b/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc.yaml index 9f36efbdc78..4de5fa674c7 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc.yaml @@ -37,4 +37,3 @@ state_code: DC output: dc_ctc: 1_160 - \ No newline at end of file diff --git a/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py index 8b2cb082d2a..fa429a479da 100644 --- a/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py +++ b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py @@ -29,5 +29,5 @@ def formula(tax_unit, period, parameters): p.child.max_qualifying_children, eligible_children_count ) amount_before_phase_out = p.amount * children_count - + return amount_before_phase_out - phase_out From 22b4ed63de287e716190edda8f3ea137beb3c961 Mon Sep 17 00:00:00 2001 From: hua7450 <113824411+hua7450@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:57:50 +0000 Subject: [PATCH 3/9] add changelod and minor change --- changelog_entry.yaml | 5 ++++- .../gov/states/dc/tax/income/credits/refundable.yaml | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index 8b137891791..d6641214927 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -1 +1,4 @@ - +- bump: minor + changes: + added: + - DC Child Tax Credit. diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/refundable.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/refundable.yaml index 0e2eb6ffb84..3bded7567ee 100644 --- a/policyengine_us/parameters/gov/states/dc/tax/income/credits/refundable.yaml +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/refundable.yaml @@ -17,5 +17,8 @@ values: - dc_kccatc # DC keep child care affordable tax credit 2025-01-01: - - dc_ctc - + - dc_eitc # DC earned income tax credit + - dc_ptc # DC property tax credit + - dc_kccatc # DC keep child care affordable tax credit + - dc_ctc # DC child tax credit + \ No newline at end of file From 1104a613d37d2d7d32d9248da2ea3731dce2c49a Mon Sep 17 00:00:00 2001 From: hua7450 <113824411+hua7450@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:30:13 +0000 Subject: [PATCH 4/9] rename files and description adjustment --- .../gov/states/dc/tax/income/credits/ctc/amount.yaml | 4 ++-- .../dc/tax/income/credits/ctc/child/age_threshold.yaml | 4 ++-- .../child/{max_qualifying_children.yaml => child_cap.yaml} | 4 ++-- .../states/dc/tax/income/credits/ctc/income_threshold.yaml | 2 +- .../states/dc/tax/income/credits/ctc/phase_out/amount.yaml | 2 +- .../dc/tax/income/credits/ctc/phase_out/increment.yaml | 2 +- .../gov/states/dc/tax/income/credits/refundable.yaml | 7 ------- .../gov/states/dc/tax/income/credits/ctc/dc_ctc.py | 2 +- 8 files changed, 10 insertions(+), 17 deletions(-) rename policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/{max_qualifying_children.yaml => child_cap.yaml} (60%) diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/amount.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/amount.yaml index f7c9d3a9399..b902d57cf33 100644 --- a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/amount.yaml +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/amount.yaml @@ -1,7 +1,7 @@ -description: DC Child Tax Credit is limited to this amount per eligible child. +description: DC provides a Child Tax Credit of this amount per eligible child. metadata: unit: currency-USD - label: DC CTC amount per eligible child + label: DC Child Tax Credit amount period: year uprating: parameter: gov.irs.uprating diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/age_threshold.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/age_threshold.yaml index 07f297d5b6b..0d2514581d4 100644 --- a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/age_threshold.yaml +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/age_threshold.yaml @@ -1,7 +1,7 @@ -description: DC limits Child Tax Credit to children below this age. +description: DC provides a Child Tax Credit amount for children below this age. metadata: unit: age - label: DC CTC child age threshold + label: DC Child Tax Credit child age threshold period: year reference: - title: Code of the District of Columbia § 47–1806.17(b)(1) diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/max_qualifying_children.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/child_cap.yaml similarity index 60% rename from policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/max_qualifying_children.yaml rename to policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/child_cap.yaml index 8a6d2da8778..df80938ab57 100644 --- a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/max_qualifying_children.yaml +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/child_cap.yaml @@ -1,9 +1,9 @@ -description: DC limits the number of qualifying children for the Child Tax Credit to this amount. +description: DC caps the number of eligible children for the Child Tax Credit at this number. values: 2025-01-01: 3 metadata: type: single_amount - label: DC CTC max quafilying children amount + label: DC Child Tax Credit child cap reference: - title: Code of the District of Columbia § 47–1806.17(b)(2) href: https://code.dccouncil.gov/us/dc/council/code/sections/47-1806.17##(b)(2) diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/income_threshold.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/income_threshold.yaml index ea2123f5b16..d9da506a86f 100644 --- a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/income_threshold.yaml +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/income_threshold.yaml @@ -1,6 +1,6 @@ description: DC limits its Child Tax Credit to filers with taxable income below the following amount, based on filing status. metadata: - label: DC CTC taxable income threshold + label: DC Child Tax Credit taxable income threshold unit: currency_USD period: year breakdown: diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/amount.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/amount.yaml index 231e730907a..2f58ee1670f 100644 --- a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/amount.yaml +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/amount.yaml @@ -3,7 +3,7 @@ values: 2025-01-01: 20 metadata: unit: currency-USD - label: DC CTC phase-out amount + label: DC Child Tax Credit phase-out amount period: year reference: - title: Code of the District of Columbia § 47–1806.17(b)(2) diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/increment.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/increment.yaml index daf82017664..b5d12c37afd 100644 --- a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/increment.yaml +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/increment.yaml @@ -3,7 +3,7 @@ values: 2025-01-01: 1_000 metadata: unit: currency-USD - label: DC CTC phase-out increment + label: DC Child Tax Credit phase-out increment period: year reference: - title: Code of the District of Columbia § 47–1806.17(b)(2) diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/refundable.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/refundable.yaml index 3bded7567ee..bb817122bb4 100644 --- a/policyengine_us/parameters/gov/states/dc/tax/income/credits/refundable.yaml +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/refundable.yaml @@ -15,10 +15,3 @@ values: - dc_eitc # DC earned income tax credit - dc_ptc # DC property tax credit - dc_kccatc # DC keep child care affordable tax credit - - 2025-01-01: - - dc_eitc # DC earned income tax credit - - dc_ptc # DC property tax credit - - dc_kccatc # DC keep child care affordable tax credit - - dc_ctc # DC child tax credit - \ No newline at end of file diff --git a/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py index fa429a479da..07eca3c6dbd 100644 --- a/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py +++ b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py @@ -26,7 +26,7 @@ def formula(tax_unit, period, parameters): "dc_ctc_eligible_children_count", period ) children_count = min_( - p.child.max_qualifying_children, eligible_children_count + p.child.child_cap, eligible_children_count ) amount_before_phase_out = p.amount * children_count From e062c5a659494d3778d6d2a42db5af14717b7a50 Mon Sep 17 00:00:00 2001 From: hua7450 <113824411+hua7450@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:30:43 +0000 Subject: [PATCH 5/9] format --- .../variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py index 07eca3c6dbd..600be83b5aa 100644 --- a/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py +++ b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py @@ -25,9 +25,7 @@ def formula(tax_unit, period, parameters): eligible_children_count = tax_unit( "dc_ctc_eligible_children_count", period ) - children_count = min_( - p.child.child_cap, eligible_children_count - ) + children_count = min_(p.child.child_cap, eligible_children_count) amount_before_phase_out = p.amount * children_count return amount_before_phase_out - phase_out From 3cabee78c246ae282e90009dc0d5f3e8239c4b79 Mon Sep 17 00:00:00 2001 From: hua7450 <113824411+hua7450@users.noreply.github.com> Date: Wed, 23 Oct 2024 20:01:38 +0000 Subject: [PATCH 6/9] minor change --- .../gov/states/dc/tax/income/credits/ctc/amount.yaml | 2 +- .../dc/tax/income/credits/ctc/child/age_threshold.yaml | 2 +- .../dc/tax/income/credits/ctc/child/child_cap.yaml | 2 +- .../dc/tax/income/credits/ctc/income_threshold.yaml | 2 +- .../dc/tax/income/credits/ctc/phase_out/amount.yaml | 2 +- .../dc/tax/income/credits/ctc/phase_out/increment.yaml | 2 +- .../gov/states/dc/tax/income/credits/refundable.yaml | 6 ++++++ .../gov/states/dc/tax/income/credits/ctc/dc_ctc.py | 10 ++++------ 8 files changed, 16 insertions(+), 12 deletions(-) diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/amount.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/amount.yaml index b902d57cf33..e838f66177b 100644 --- a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/amount.yaml +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/amount.yaml @@ -9,7 +9,7 @@ metadata: type: downwards interval: 5 reference: - - title: Code of the District of Columbia § 47–1806.17(b)(1) + - title: Code of the District of Columbia § 47-1806.17(b)(1)(A) href: https://code.dccouncil.gov/us/dc/council/code/sections/47-1806.17#(b)(1) values: diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/age_threshold.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/age_threshold.yaml index 0d2514581d4..54dd22a4f48 100644 --- a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/age_threshold.yaml +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/age_threshold.yaml @@ -4,7 +4,7 @@ metadata: label: DC Child Tax Credit child age threshold period: year reference: - - title: Code of the District of Columbia § 47–1806.17(b)(1) + - title: Code of the District of Columbia § 47-1806.17(b)(1)(B) href: https://code.dccouncil.gov/us/dc/council/code/sections/47-1806.17#(b)(1) values: diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/child_cap.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/child_cap.yaml index df80938ab57..2ffa41c39b4 100644 --- a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/child_cap.yaml +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/child_cap.yaml @@ -1,4 +1,4 @@ -description: DC caps the number of eligible children for the Child Tax Credit at this number. +description: DC limits the number of eligible children for the Child Tax Credit to this number. values: 2025-01-01: 3 metadata: diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/income_threshold.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/income_threshold.yaml index d9da506a86f..3164df3a586 100644 --- a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/income_threshold.yaml +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/income_threshold.yaml @@ -6,7 +6,7 @@ metadata: breakdown: - filing_status reference: - - title: Code of the District of Columbia § 47–1806.17(e)(5) + - title: Code of the District of Columbia § 47-1806.17(e)(5) href: https://code.dccouncil.gov/us/dc/council/code/sections/47-1806.17#(e)(5) SINGLE: diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/amount.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/amount.yaml index 2f58ee1670f..2290da26f06 100644 --- a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/amount.yaml +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/amount.yaml @@ -1,4 +1,4 @@ -description: DC reduces the Child Tax Credit expansion by this amount for each increment by which one's income exceeds the phase-out thresholds. +description: DC reduces the Child Tax Credit by this amount for each increment by which one's income exceeds the phase-out thresholds. values: 2025-01-01: 20 metadata: diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/increment.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/increment.yaml index b5d12c37afd..874e354b836 100644 --- a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/increment.yaml +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/phase_out/increment.yaml @@ -1,4 +1,4 @@ -description: DC reduces the Child Tax Credit expansion by a certain amount for each of this increment by which one's income exceeds the phase-out thresholds. +description: DC reduces the Child Tax Credit by a certain amount for each of this increment by which one's income exceeds the phase-out thresholds. values: 2025-01-01: 1_000 metadata: diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/refundable.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/refundable.yaml index bb817122bb4..01a755f71bd 100644 --- a/policyengine_us/parameters/gov/states/dc/tax/income/credits/refundable.yaml +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/refundable.yaml @@ -15,3 +15,9 @@ values: - dc_eitc # DC earned income tax credit - dc_ptc # DC property tax credit - dc_kccatc # DC keep child care affordable tax credit + + 2025-01-01: + - dc_eitc # DC earned income tax credit + - dc_ptc # DC property tax credit + - dc_kccatc # DC keep child care affordable tax credit + - dc_ctc # DC child tax credit diff --git a/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py index 600be83b5aa..a7531e476c5 100644 --- a/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py +++ b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py @@ -22,10 +22,8 @@ def formula(tax_unit, period, parameters): increments = ceil(excess / p.phase_out.increment) phase_out = increments * p.phase_out.amount - eligible_children_count = tax_unit( - "dc_ctc_eligible_children_count", period - ) - children_count = min_(p.child.child_cap, eligible_children_count) - amount_before_phase_out = p.amount * children_count + eligible_children = tax_unit("dc_ctc_eligible_children_count", period) + capped_children = min_(p.child.child_cap, eligible_children) + base_amount = p.amount * capped_children - return amount_before_phase_out - phase_out + return max_(base_amount - phase_out, 0) From 7f1bc4b92621eed5c26db5ba4a7b95c7652eca56 Mon Sep 17 00:00:00 2001 From: hua7450 <113824411+hua7450@users.noreply.github.com> Date: Thu, 24 Oct 2024 19:47:10 +0000 Subject: [PATCH 7/9] delete files related in reforms folder, remove dc_ctc from the reform structure --- .../contrib/states/dc/ctc/age_threshold.yaml | 10 - .../gov/contrib/states/dc/ctc/amount.yaml | 15 - .../gov/contrib/states/dc/ctc/child_cap.yaml | 11 - .../gov/contrib/states/dc/ctc/in_effect.yaml | 8 - .../states/dc/ctc/reduction/amount.yaml | 10 - .../states/dc/ctc/reduction/increment.yaml | 10 - .../states/dc/ctc/reduction/start.yaml | 22 -- policyengine_us/reforms/reforms.py | 6 - policyengine_us/reforms/states/dc/__init__.py | 3 - policyengine_us/reforms/states/dc/dc_ctc.py | 74 ----- .../reforms/states/dc/dc_ctc_test_microsim.py | 32 --- .../policy/contrib/states/dc/dc_ctc.yaml | 268 ------------------ 12 files changed, 469 deletions(-) delete mode 100644 policyengine_us/parameters/gov/contrib/states/dc/ctc/age_threshold.yaml delete mode 100644 policyengine_us/parameters/gov/contrib/states/dc/ctc/amount.yaml delete mode 100644 policyengine_us/parameters/gov/contrib/states/dc/ctc/child_cap.yaml delete mode 100644 policyengine_us/parameters/gov/contrib/states/dc/ctc/in_effect.yaml delete mode 100644 policyengine_us/parameters/gov/contrib/states/dc/ctc/reduction/amount.yaml delete mode 100644 policyengine_us/parameters/gov/contrib/states/dc/ctc/reduction/increment.yaml delete mode 100644 policyengine_us/parameters/gov/contrib/states/dc/ctc/reduction/start.yaml delete mode 100644 policyengine_us/reforms/states/dc/__init__.py delete mode 100644 policyengine_us/reforms/states/dc/dc_ctc.py delete mode 100644 policyengine_us/reforms/states/dc/dc_ctc_test_microsim.py delete mode 100644 policyengine_us/tests/policy/contrib/states/dc/dc_ctc.yaml diff --git a/policyengine_us/parameters/gov/contrib/states/dc/ctc/age_threshold.yaml b/policyengine_us/parameters/gov/contrib/states/dc/ctc/age_threshold.yaml deleted file mode 100644 index 2a0ed918077..00000000000 --- a/policyengine_us/parameters/gov/contrib/states/dc/ctc/age_threshold.yaml +++ /dev/null @@ -1,10 +0,0 @@ -description: DC provides a Child Tax Credit amount for children below this age. -values: - 2025-01-01: 6 -metadata: - period: year - unit: year - label: DC Child Tax Credit child age threshold - reference: - - title: District Child Tax Credit Amendment Act of 2023 “§ 47-1806.17. Child Tax Credit. (a)(2)(A) - href: https://lims.dccouncil.gov/downloads/LIMS/55181/Other/B25-0784-FIS_Fiscal_Year_2025_Budget_Support_Act_of_2024_Second_Reading.pdf#page=98 diff --git a/policyengine_us/parameters/gov/contrib/states/dc/ctc/amount.yaml b/policyengine_us/parameters/gov/contrib/states/dc/ctc/amount.yaml deleted file mode 100644 index 8e859e70bd2..00000000000 --- a/policyengine_us/parameters/gov/contrib/states/dc/ctc/amount.yaml +++ /dev/null @@ -1,15 +0,0 @@ -description: DC provides a Child Tax Credit of this amount per eligible child. -values: - 2025-01-01: 420 -metadata: - period: year - uprating: - parameter: gov.irs.uprating - rounding: - type: downwards - interval: 5 - unit: currency-USD - label: DC Child Tax Credit amount - reference: - - title: District Child Tax Credit Amendment Act of 2023 “§ 47-1806.17. Child Tax Credit. (a)(1) - href: https://lims.dccouncil.gov/downloads/LIMS/55181/Other/B25-0784-FIS_Fiscal_Year_2025_Budget_Support_Act_of_2024_Second_Reading.pdf#page=98 diff --git a/policyengine_us/parameters/gov/contrib/states/dc/ctc/child_cap.yaml b/policyengine_us/parameters/gov/contrib/states/dc/ctc/child_cap.yaml deleted file mode 100644 index eb6725fa376..00000000000 --- a/policyengine_us/parameters/gov/contrib/states/dc/ctc/child_cap.yaml +++ /dev/null @@ -1,11 +0,0 @@ - -description: DC caps the number of eligible children for the Child Tax Credit at this number. -values: - 2025-01-01: 3 -metadata: - period: year - unit: child - label: DC Child Tax Credit child cap - reference: - - title: District Child Tax Credit Amendment Act of 2023 “§ 47-1806.17. Child Tax Credit. (a)(1) - href: https://lims.dccouncil.gov/downloads/LIMS/55181/Other/B25-0784-FIS_Fiscal_Year_2025_Budget_Support_Act_of_2024_Second_Reading.pdf#page=98 diff --git a/policyengine_us/parameters/gov/contrib/states/dc/ctc/in_effect.yaml b/policyengine_us/parameters/gov/contrib/states/dc/ctc/in_effect.yaml deleted file mode 100644 index 2c8995e73f6..00000000000 --- a/policyengine_us/parameters/gov/contrib/states/dc/ctc/in_effect.yaml +++ /dev/null @@ -1,8 +0,0 @@ -description: DC provides a Child Tax Credit if this is true. -metadata: - unit: bool - period: year - label: DC Child Tax Credit in effect - -values: - 0000-01-01: false diff --git a/policyengine_us/parameters/gov/contrib/states/dc/ctc/reduction/amount.yaml b/policyengine_us/parameters/gov/contrib/states/dc/ctc/reduction/amount.yaml deleted file mode 100644 index 7c07cb15422..00000000000 --- a/policyengine_us/parameters/gov/contrib/states/dc/ctc/reduction/amount.yaml +++ /dev/null @@ -1,10 +0,0 @@ -description: DC reduces the Child Tax Credit by this amount fo each adjusted gross income increment. -values: - 2025-01-01: 20 -metadata: - period: year - unit: currency-USD - label: DC Child Tax Credit reduction amount - reference: - - title: District Child Tax Credit Amendment Act of 2023 “§ 47-1806.17. Child Tax Credit. (a)(2)(A) - href: https://lims.dccouncil.gov/downloads/LIMS/55181/Other/B25-0784-FIS_Fiscal_Year_2025_Budget_Support_Act_of_2024_Second_Reading.pdf#page=98 diff --git a/policyengine_us/parameters/gov/contrib/states/dc/ctc/reduction/increment.yaml b/policyengine_us/parameters/gov/contrib/states/dc/ctc/reduction/increment.yaml deleted file mode 100644 index b97997fcf85..00000000000 --- a/policyengine_us/parameters/gov/contrib/states/dc/ctc/reduction/increment.yaml +++ /dev/null @@ -1,10 +0,0 @@ -description: DC reduces the Child Tax Credit amount in these increments of adjusted gross income. -values: - 2025-01-01: 1_000 -metadata: - period: year - unit: currency-USD - label: DC Child Tax Credit reduction increment - reference: - - title: District Child Tax Credit Amendment Act of 2023 “§ 47-1806.17. Child Tax Credit. (a)(2)(A) - href: https://lims.dccouncil.gov/downloads/LIMS/55181/Other/B25-0784-FIS_Fiscal_Year_2025_Budget_Support_Act_of_2024_Second_Reading.pdf#page=98 diff --git a/policyengine_us/parameters/gov/contrib/states/dc/ctc/reduction/start.yaml b/policyengine_us/parameters/gov/contrib/states/dc/ctc/reduction/start.yaml deleted file mode 100644 index b93af6053a2..00000000000 --- a/policyengine_us/parameters/gov/contrib/states/dc/ctc/reduction/start.yaml +++ /dev/null @@ -1,22 +0,0 @@ -description: DC reduces the Child Tax Credit for filer with income above this thresholds, based on filing status. - -metadata: - period: year - unit: currency-USD - label: DC Child Tax Credit reduction start - breakdown: - - filing_status - reference: - - title: District Child Tax Credit Amendment Act of 2023 “§ 47-1806.17. Child Tax Credit. (a)(2)(A) - href: https://lims.dccouncil.gov/downloads/LIMS/55181/Other/B25-0784-FIS_Fiscal_Year_2025_Budget_Support_Act_of_2024_Second_Reading.pdf#page=98 - -SINGLE: - 2025-01-01: 160_000 -HEAD_OF_HOUSEHOLD: - 2025-01-01: 160_000 -JOINT: - 2025-01-01: 240_000 -SURVIVING_SPOUSE: - 2025-01-01: 160_000 -SEPARATE: - 2025-01-01: 120_000 diff --git a/policyengine_us/reforms/reforms.py b/policyengine_us/reforms/reforms.py index 890279dd6a7..9da1e13a575 100644 --- a/policyengine_us/reforms/reforms.py +++ b/policyengine_us/reforms/reforms.py @@ -20,9 +20,6 @@ from .biden.budget_2025 import create_capital_gains_tax_increase_reform from .eitc import create_halve_joint_eitc_phase_out_rate_reform from .states.ny.wftc import create_ny_working_families_tax_credit_reform -from .states.dc.dc_ctc import ( - create_dc_ctc_reform, -) from .harris.lift.middle_class_tax_credit import ( create_middle_class_tax_credit_reform, ) @@ -95,8 +92,6 @@ def create_structural_reforms_from_parameters(parameters, period): ) ny_wftc = create_ny_working_families_tax_credit_reform(parameters, period) - dc_ctc = create_dc_ctc_reform(parameters, period) - middle_class_tax_credit = create_middle_class_tax_credit_reform( parameters, period ) @@ -142,7 +137,6 @@ def create_structural_reforms_from_parameters(parameters, period): capital_gains_tax_increase, halve_joint_eitc_phase_out_rate, ny_wftc, - dc_ctc, middle_class_tax_credit, rent_relief_tax_credit, end_child_poverty_act, diff --git a/policyengine_us/reforms/states/dc/__init__.py b/policyengine_us/reforms/states/dc/__init__.py deleted file mode 100644 index 499ba20f994..00000000000 --- a/policyengine_us/reforms/states/dc/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .dc_ctc import ( - create_dc_ctc_reform, -) diff --git a/policyengine_us/reforms/states/dc/dc_ctc.py b/policyengine_us/reforms/states/dc/dc_ctc.py deleted file mode 100644 index d49d37a2363..00000000000 --- a/policyengine_us/reforms/states/dc/dc_ctc.py +++ /dev/null @@ -1,74 +0,0 @@ -from policyengine_us.model_api import * -from policyengine_core.periods import period as period_ - - -def create_dc_ctc() -> Reform: - class dc_ctc(Variable): - value_type = float - entity = TaxUnit - label = "DC Child Tax Credit" - unit = USD - definition_period = YEAR - reference = "https://lims.dccouncil.gov/downloads/LIMS/52461/Introduction/B25-0190-Introduction.pdf" - defined_for = StateCode.DC - - def formula(tax_unit, period, parameters): - p = parameters(period).gov.contrib.states.dc.ctc - person = tax_unit.members - age = person("age", period) - age_eligible = age < p.age_threshold - eligible_children = tax_unit.sum(age_eligible) - capped_children = min_(eligible_children, p.child_cap) - income = tax_unit("adjusted_gross_income", period) - max_amount = p.amount * capped_children - increment = p.reduction.increment - reduction_per_increment = p.reduction.amount - filing_status = tax_unit("filing_status", period) - reduction_start = p.reduction.start[filing_status] - excess = max_(income - reduction_start, 0) - increments = np.ceil(excess / increment) - reduction_amount = increments * reduction_per_increment - return max_(0, max_amount - reduction_amount) - - class dc_refundable_credits(Variable): - value_type = float - entity = TaxUnit - label = "DC refundable credits" - unit = USD - definition_period = YEAR - reference = ( - "https://otr.cfo.dc.gov/sites/default/files/dc/sites/otr/publication/attachments/52926_D-40_12.21.21_Final_Rev011122.pdf#page=63" - "https://otr.cfo.dc.gov/sites/default/files/dc/sites/otr/publication/attachments/2022_D-40_Booklet_Final_blk_01_23_23_Ordc.pdf#page=55" - ) - defined_for = StateCode.DC - - def formula(tax_unit, period, parameters): - p = parameters(period).gov.states.dc.tax.income.credits - previous_credits = add(tax_unit, period, p.refundable) - ctc = tax_unit("dc_ctc", period) - return ctc + previous_credits - - class reform(Reform): - def apply(self): - self.update_variable(dc_ctc) - self.update_variable(dc_refundable_credits) - - return reform - - -def create_dc_ctc_reform(parameters, period, bypass: bool = False): - if bypass: - return create_dc_ctc() - - p = parameters.gov.contrib.states.dc.ctc - - current_period = period_(period) - - for i in range(5): - if p(current_period).in_effect: - return create_dc_ctc() - current_period = current_period.offset(1, "year") - return None - - -dc_ctc = create_dc_ctc_reform(None, None, bypass=True) diff --git a/policyengine_us/reforms/states/dc/dc_ctc_test_microsim.py b/policyengine_us/reforms/states/dc/dc_ctc_test_microsim.py deleted file mode 100644 index 389d1563072..00000000000 --- a/policyengine_us/reforms/states/dc/dc_ctc_test_microsim.py +++ /dev/null @@ -1,32 +0,0 @@ -def test_dc_ctc(): - from policyengine_us import Microsimulation - from policyengine_core.reforms import Reform - from policyengine_core.periods import instant - - baseline = Microsimulation() - - baseline_net_income = baseline.calculate( - "household_net_income", period=2025 - ) - - def modify_parameters(parameters): - parameters.gov.contrib.states.dc.ctc.in_effect.update( - start=instant("2025-01-01"), - stop=instant("2028-12-31"), - value=True, - ) - return parameters - - class parameter_reform(Reform): - def apply(self): - self.modify_parameters(modify_parameters) - - dc_ctc_reformed = Microsimulation(reform=parameter_reform) - dc_ctc_reform_net_income = dc_ctc_reformed.calculate( - "household_net_income", period=2025 - ) - - total_loss = (dc_ctc_reform_net_income - baseline_net_income).sum() - - assert total_loss > 5e6 - assert total_loss < 100e6 diff --git a/policyengine_us/tests/policy/contrib/states/dc/dc_ctc.yaml b/policyengine_us/tests/policy/contrib/states/dc/dc_ctc.yaml deleted file mode 100644 index 372aee42002..00000000000 --- a/policyengine_us/tests/policy/contrib/states/dc/dc_ctc.yaml +++ /dev/null @@ -1,268 +0,0 @@ -- name: 5 children and each is accounted for - period: 2025 - reforms: policyengine_us.reforms.states.dc.dc_ctc.dc_ctc - input: - gov.contrib.states.dc.ctc.in_effect: true - gov.contrib.states.dc.ctc.child_cap: 999 - people: - person1: - age: 40 - person2: - age: 5 - person3: - age: 5 - person4: - age: 5 - person5: - age: 5 - person6: - age: 6 - tax_units: - tax_unit: - members: [person1, person2, person3, person4, person5, person6] - adjusted_gross_income: 240_000 - filing_status: JOINT - households: - household: - members: [person1, person2, person3, person4, person5, person6] - state_code: DC - output: - dc_ctc: 1_680 - - -- name: 5 children with one above the age threshold - period: 2025 - reforms: policyengine_us.reforms.states.dc.dc_ctc.dc_ctc - input: - gov.contrib.states.dc.ctc.in_effect: true - gov.contrib.states.dc.ctc.child_cap: 999 - people: - person1: - age: 40 - person2: - age: 5 - person3: - age: 5 - person4: - age: 5 - person5: - age: 5 - person6: - age: 6 - tax_units: - tax_unit: - members: [person1, person2, person3, person4, person5, person6] - adjusted_gross_income: 240_000 - filing_status: JOINT - households: - household: - members: [person1, person2, person3, person4, person5, person6] - state_code: DC - output: - dc_ctc: 1_680 - -- name: One child, reform does not change output - period: 2025 - reforms: policyengine_us.reforms.states.dc.dc_ctc.dc_ctc - input: - gov.contrib.states.dc.ctc.in_effect: true - people: - person1: - age: 40 - person2: - age: 5 - tax_units: - tax_unit: - members: [person1, person2] - adjusted_gross_income: 100_000 - filing_status: SINGLE - households: - household: - members: [person1, person2] - state_code: DC - output: - dc_ctc: 420 - -- name: Four children with reduction applied, joint, uncapped children - period: 2025 - reforms: policyengine_us.reforms.states.dc.dc_ctc.dc_ctc - input: - gov.contrib.states.dc.ctc.in_effect: true - gov.contrib.states.dc.ctc.child_cap: 999 - people: - person1: - age: 40 - person2: - age: 5 - person3: - age: 5 - person4: - age: 5 - person5: - age: 5 - tax_units: - tax_unit: - members: [person1, person2, person3, person4, person5] - adjusted_gross_income: 250_000 - filing_status: JOINT - households: - household: - members: [person1, person2, person3, person4, person5] - state_code: DC - output: - dc_ctc: 1_480 - -- name: Single person with one child, below reduction, cap applies - period: 2025 - reforms: policyengine_us.reforms.states.dc.dc_ctc.dc_ctc - input: - gov.contrib.states.dc.ctc.in_effect: true - people: - person1: - age: 40 - person2: - age: 5 - tax_units: - tax_unit: - members: [person1, person2] - adjusted_gross_income: 160_000 - filing_status: SINGLE - households: - household: - members: [person1, person2] - state_code: DC - output: - dc_ctc: 420 - -- name: Children capped at 3, cap applies - period: 2025 - reforms: policyengine_us.reforms.states.dc.dc_ctc.dc_ctc - input: - gov.contrib.states.dc.ctc.in_effect: true - people: - person1: - age: 40 - person2: - age: 5 - person3: - age: 5 - person4: - age: 5 - person5: - age: 5 - person6: - age: 6 - tax_units: - tax_unit: - members: [person1, person2, person3, person4, person5, person6] - adjusted_gross_income: 240_000 - filing_status: JOINT - households: - household: - members: [person1, person2, person3, person4, person5, person6] - state_code: DC - output: - dc_ctc: 1_260 - -- name: Joint filing, with reduction, cap applies - period: 2025 - reforms: policyengine_us.reforms.states.dc.dc_ctc.dc_ctc - input: - gov.contrib.states.dc.ctc.in_effect: true - people: - person1: - age: 40 - person2: - age: 5 - person3: - age: 5 - person4: - age: 5 - person5: - age: 5 - tax_units: - tax_unit: - members: [person1, person2, person3, person4, person5] - adjusted_gross_income: 255_000 - filing_status: JOINT - dc_eitc: 200 - households: - household: - members: [person1, person2, person3, person4, person5] - state_code: DC - output: - dc_ctc: 960 - dc_refundable_credits: 1_160 - -- name: Joint filing, fully reduced, cap applies - period: 2025 - reforms: policyengine_us.reforms.states.dc.dc_ctc.dc_ctc - input: - gov.contrib.states.dc.ctc.in_effect: true - people: - person1: - age: 40 - person2: - age: 5 - tax_units: - tax_unit: - members: [person1, person2] - adjusted_gross_income: 261_000 - filing_status: JOINT - households: - household: - members: [person1, person2] - state_code: DC - output: - dc_ctc: 0 - -- name: Reform not in effect - period: 2025 - input: - gov.contrib.states.dc.ctc.in_effect: false - people: - person1: - age: 40 - person2: - age: 5 - person3: - age: 5 - person4: - age: 5 - person5: - age: 5 - person6: - age: 5 - tax_units: - tax_unit: - members: [person1, person2, person3, person4, person5, person6] - adjusted_gross_income: 160_000 - filing_status: JOINT - households: - household: - members: [person1, person2, person3, person4, person5, person6] - state_code: DC - output: - dc_refundable_credits: 0 - -- name: Integration test with reform in effect - period: 2025 - reforms: policyengine_us.reforms.states.dc.dc_ctc.dc_ctc - input: - gov.contrib.states.dc.ctc.in_effect: true - dc_ctc: 1_000 - dc_eitc: 2_000 - dc_income_tax_before_refundable_credits: 5_000 - state_code: DC - output: - dc_income_tax: 2_000 - -- name: Integration test with reform not in effect - period: 2025 - input: - gov.contrib.states.dc.ctc.in_effect: false - dc_eitc: 2_000 - dc_income_tax_before_refundable_credits: 5_000 - state_code: DC - output: - dc_income_tax: 3_000 From 029b27d55656ff5f15606aaba27e1778145e6536 Mon Sep 17 00:00:00 2001 From: hua7450 <113824411+hua7450@users.noreply.github.com> Date: Mon, 28 Oct 2024 14:29:16 +0000 Subject: [PATCH 8/9] add dc_ctc_capped_children variable --- .../income/credits/ctc/child/child_cap.yaml | 3 +- .../gov/states/dc/tax/income/ctc/dc_ctc.yaml | 26 ++------------ ...count.yaml => dc_ctc_capped_children.yaml} | 6 ++-- .../tax/income/ctc/dc_ctc_eligible_child.yaml | 36 +++++++++++++++++++ .../dc/tax/income/credits/ctc/dc_ctc.py | 3 +- .../credits/ctc/dc_ctc_capped_children.py | 16 +++++++++ ...lify_child.py => dc_ctc_eligible_child.py} | 14 ++++---- 7 files changed, 67 insertions(+), 37 deletions(-) rename policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/{dc_ctc_eligible_children_count.yaml => dc_ctc_capped_children.yaml} (92%) create mode 100644 policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc_eligible_child.yaml create mode 100644 policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_capped_children.py rename policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/{dc_ctc_qualify_child.py => dc_ctc_eligible_child.py} (54%) diff --git a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/child_cap.yaml b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/child_cap.yaml index 2ffa41c39b4..e448ca7dad2 100644 --- a/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/child_cap.yaml +++ b/policyengine_us/parameters/gov/states/dc/tax/income/credits/ctc/child/child_cap.yaml @@ -2,7 +2,8 @@ description: DC limits the number of eligible children for the Child Tax Credit values: 2025-01-01: 3 metadata: - type: single_amount + period: year + unit: child label: DC Child Tax Credit child cap reference: - title: Code of the District of Columbia § 47–1806.17(b)(2) diff --git a/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc.yaml b/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc.yaml index 4de5fa674c7..97cfdd5ba2e 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc.yaml @@ -3,37 +3,17 @@ input: adjusted_gross_income: 120_000 filing_status: SINGLE - dc_ctc_eligible_children_count: 2 + dc_ctc_capped_children: 2 state_code: DC output: dc_ctc: 840 -- name: Case 2, no phase_out, jointly filers with 4 qualifying children. - period: 2025 - input: - adjusted_gross_income: 200_000 - filing_status: JOINT - dc_ctc_eligible_children_count: 4 - state_code: DC - output: - dc_ctc: 1_260 - -- name: Case 3, income above income threshold, single filer with 2 qualifying children. +- name: Case 2, income above income threshold, single filer with 2 qualifying children. period: 2025 input: adjusted_gross_income: 162_000 filing_status: SINGLE - dc_ctc_eligible_children_count: 2 + dc_ctc_capped_children: 2 state_code: DC output: dc_ctc: 800 - -- name: Case 4, income above income threshold, jointly filers with 4 qualifying children. - period: 2025 - input: - adjusted_gross_income: 245_000 - filing_status: JOINT - dc_ctc_eligible_children_count: 4 - state_code: DC - output: - dc_ctc: 1_160 diff --git a/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc_eligible_children_count.yaml b/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc_capped_children.yaml similarity index 92% rename from policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc_eligible_children_count.yaml rename to policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc_capped_children.yaml index acfeaff86e7..607f5269d3d 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc_eligible_children_count.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc_capped_children.yaml @@ -17,7 +17,7 @@ members: [person1, person2, person3] state_code: DC output: - dc_ctc_eligible_children_count: 1 + dc_ctc_capped_children: 1 - name: Case 2, 2 dependent children, both age qualify. period: 2025 @@ -39,7 +39,7 @@ members: [person1, person2, person3] state_code: DC output: - dc_ctc_eligible_children_count: 2 + dc_ctc_capped_children: 2 - name: Case 3, 2 dependent children, both age unqalify. period: 2025 @@ -61,4 +61,4 @@ members: [person1, person2, person3] state_code: DC output: - dc_ctc_eligible_children_count: 0 + dc_ctc_capped_children: 0 diff --git a/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc_eligible_child.yaml b/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc_eligible_child.yaml new file mode 100644 index 00000000000..0c91bb8d494 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/states/dc/tax/income/ctc/dc_ctc_eligible_child.yaml @@ -0,0 +1,36 @@ +- name: Case 1, is a dependent and age below threshold. + period: 2025 + input: + is_tax_unit_dependent: true + age: 5 + state_code: DC + output: + dc_ctc_eligible_child: true + +- name: Case 2, is a dependent but age above threshold. + period: 2025 + input: + is_tax_unit_dependent: true + age: 8 + state_code: DC + output: + dc_ctc_eligible_child: false + +- name: Case 3, not a dependent and age below threshold. + period: 2025 + input: + is_tax_unit_dependent: false + age: 5 + state_code: DC + output: + dc_ctc_eligible_child: false + +- name: Case 4, not a dependent and age above threshold. + period: 2025 + input: + is_tax_unit_dependent: false + age: 8 + state_code: DC + output: + dc_ctc_eligible_child: false + diff --git a/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py index a7531e476c5..c226ebeb5d4 100644 --- a/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py +++ b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc.py @@ -22,8 +22,7 @@ def formula(tax_unit, period, parameters): increments = ceil(excess / p.phase_out.increment) phase_out = increments * p.phase_out.amount - eligible_children = tax_unit("dc_ctc_eligible_children_count", period) - capped_children = min_(p.child.child_cap, eligible_children) + capped_children = tax_unit("dc_ctc_capped_children", period) base_amount = p.amount * capped_children return max_(base_amount - phase_out, 0) diff --git a/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_capped_children.py b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_capped_children.py new file mode 100644 index 00000000000..2d46ee51add --- /dev/null +++ b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_capped_children.py @@ -0,0 +1,16 @@ +from policyengine_us.model_api import * + + +class dc_ctc_capped_children(Variable): + value_type = int + entity = TaxUnit + label = "DC CTC eligible children capped" + definition_period = YEAR + reference = ( + "https://code.dccouncil.gov/us/dc/council/code/sections/47-1806.17" + ) + + def formula(tax_unit, period, parameters): + p = parameters(period).gov.states.dc.tax.income.credits.ctc.child + eligible_children = add(tax_unit, period, ["dc_ctc_eligible_child"]) + return min_(p.child_cap, eligible_children) diff --git a/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_qualify_child.py b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_eligible_child.py similarity index 54% rename from policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_qualify_child.py rename to policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_eligible_child.py index 860437260b2..500dcd86213 100644 --- a/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_qualify_child.py +++ b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_eligible_child.py @@ -1,20 +1,18 @@ from policyengine_us.model_api import * -class dc_ctc_eligible_children_count(Variable): - value_type = float - entity = TaxUnit - label = "DC CTC eligible children count" +class dc_ctc_eligible_child(Variable): + value_type = bool + entity = Person + label = "whether or not the child is DC CTC eligible" definition_period = YEAR reference = ( "https://code.dccouncil.gov/us/dc/council/code/sections/47-1806.17" ) - def formula(tax_unit, period, parameters): + def formula(person, period, parameters): p = parameters(period).gov.states.dc.tax.income.credits.ctc.child - person = tax_unit.members age = person("age", period) age_qualify = age < p.age_threshold is_dependent = person("is_tax_unit_dependent", period) - ctc_eligible_children = age_qualify & is_dependent - return tax_unit.sum(ctc_eligible_children) + return age_qualify & is_dependent From e6d3e0209e7b7de9e5b69c47aa8bbbd4bef849fe Mon Sep 17 00:00:00 2001 From: hua7450 <113824411+hua7450@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:00:15 +0000 Subject: [PATCH 9/9] minor change --- .../dc/tax/income/credits/ctc/dc_ctc_capped_children.py | 2 +- .../dc/tax/income/credits/ctc/dc_ctc_eligible_child.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_capped_children.py b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_capped_children.py index 2d46ee51add..402a123c0c9 100644 --- a/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_capped_children.py +++ b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_capped_children.py @@ -4,7 +4,7 @@ class dc_ctc_capped_children(Variable): value_type = int entity = TaxUnit - label = "DC CTC eligible children capped" + label = "Capped number of DC CTC eligible children" definition_period = YEAR reference = ( "https://code.dccouncil.gov/us/dc/council/code/sections/47-1806.17" diff --git a/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_eligible_child.py b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_eligible_child.py index 500dcd86213..7921dd888b6 100644 --- a/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_eligible_child.py +++ b/policyengine_us/variables/gov/states/dc/tax/income/credits/ctc/dc_ctc_eligible_child.py @@ -4,7 +4,7 @@ class dc_ctc_eligible_child(Variable): value_type = bool entity = Person - label = "whether or not the child is DC CTC eligible" + label = "Whether the child is eligible for the DC CTC" definition_period = YEAR reference = ( "https://code.dccouncil.gov/us/dc/council/code/sections/47-1806.17" @@ -13,6 +13,6 @@ class dc_ctc_eligible_child(Variable): def formula(person, period, parameters): p = parameters(period).gov.states.dc.tax.income.credits.ctc.child age = person("age", period) - age_qualify = age < p.age_threshold + age_eligible = age < p.age_threshold is_dependent = person("is_tax_unit_dependent", period) - return age_qualify & is_dependent + return age_eligible & is_dependent