-
Notifications
You must be signed in to change notification settings - Fork 185
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
Create phaseout for NYC school credit for NYC CTC proposal #5510
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
af2b621
Include the New York 2025 inflation rebate in the net income tree
PavelMakarchuk 39a17d1
format
PavelMakarchuk 625ff98
Merge branch 'master' of https://github.com/PolicyEngine/policyengine…
PavelMakarchuk bb3e67d
docstring, reference and format
PavelMakarchuk ec52f0b
minor
PavelMakarchuk f92638c
readme
PavelMakarchuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- bump: minor | ||
changes: | ||
added: | ||
- NYC school tax credit phase out reform. |
9 changes: 9 additions & 0 deletions
9
policyengine_us/parameters/gov/contrib/local/nyc/stc/phase_out/in_effect.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
description: The NYC school tax credit phases out with state adjusted gross income, if this is true. | ||
|
||
values: | ||
0000-01-01: false | ||
|
||
metadata: | ||
unit: bool | ||
period: year | ||
label: NYC school tax credit phase out in effect |
20 changes: 20 additions & 0 deletions
20
...ne_us/parameters/gov/contrib/local/nyc/stc/phase_out/rate/joint_and_surviving_spouse.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
description: New York reduces the NYC school tax credit for joint filers and surviving spouses at this rate, based on state adjusted gross income. | ||
metadata: | ||
type: marginal_rate | ||
threshold_unit: currency-USD | ||
rate_unit: /1 | ||
period: year | ||
label: NYC school tax credit joint and surviving spouse reduction rate | ||
reference: | ||
- title: New York Senate Bill S2238 §1(4-c)(B) | ||
href: https://www.nysenate.gov/legislation/bills/2025/S2238 | ||
|
||
brackets: | ||
- threshold: | ||
2025-01-01: 0 | ||
rate: | ||
2025-01-01: 0 | ||
- threshold: | ||
2025-01-01: 150_000 | ||
rate: | ||
2025-01-01: 0.05 |
20 changes: 20 additions & 0 deletions
20
policyengine_us/parameters/gov/contrib/local/nyc/stc/phase_out/rate/other.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
description: New York reduces the NYC school tax credit for single, separate, and head of household filers, based on state adjusted gross income. | ||
metadata: | ||
type: marginal_rate | ||
threshold_unit: currency-USD | ||
rate_unit: /1 | ||
period: year | ||
label: NYC school tax credit other reduction rate | ||
reference: | ||
- title: New York Senate Bill S2238 §1(4-c)(A) | ||
href: https://www.nysenate.gov/legislation/bills/2025/S2238 | ||
|
||
brackets: | ||
- threshold: | ||
2025-01-01: 0 | ||
rate: | ||
2025-01-01: 0 | ||
- threshold: | ||
2025-01-01: 75_000 | ||
rate: | ||
2025-01-01: 0.05 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .nyc_school_tax_credit_with_phase_out import ( | ||
create_nyc_school_tax_credit_with_phase_out_reform, | ||
) |
105 changes: 105 additions & 0 deletions
105
policyengine_us/reforms/local/nyc/stc/phase_out/nyc_school_tax_credit_with_phase_out.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
from policyengine_us.model_api import * | ||
from policyengine_core.periods import period as period_ | ||
|
||
|
||
def create_nyc_school_tax_credit_with_phase_out() -> Reform: | ||
class nyc_school_tax_credit_phase_out(Variable): | ||
value_type = float | ||
unit = USD | ||
entity = TaxUnit | ||
label = "NYC School Tax Credit Phase Out" | ||
definition_period = YEAR | ||
defined_for = "in_nyc" | ||
reference = "https://www.nysenate.gov/legislation/bills/2025/S2238" | ||
|
||
def formula(tax_unit, period, parameters): | ||
""" | ||
Calculates the phase-out amount for the NYC School Tax Credit. | ||
|
||
Args: | ||
AGI: The State Adjusted Gross Income of the tax unit. | ||
Filing status: The filing status of the tax unit. | ||
Phase-out rate: The phase-out rate of the credit. | ||
Returns: | ||
float: The calculated phase-out amount. | ||
""" | ||
agi = tax_unit("ny_agi", period) | ||
filing_status = tax_unit("filing_status", period) | ||
joint = filing_status == filing_status.possible_values.JOINT | ||
surviving_spouse = ( | ||
filing_status == filing_status.possible_values.SURVIVING_SPOUSE | ||
) | ||
joint_filers = joint | surviving_spouse | ||
p = parameters(period).gov.contrib.local.nyc.stc.phase_out.rate | ||
return where( | ||
joint_filers, | ||
p.joint_and_surviving_spouse.calc(agi), | ||
p.other.calc(agi), | ||
) | ||
|
||
class nyc_school_tax_credit(Variable): | ||
value_type = float | ||
entity = TaxUnit | ||
label = "NYC School Tax Credit" | ||
unit = USD | ||
definition_period = YEAR | ||
defined_for = "in_nyc" | ||
reference = "https://www.nysenate.gov/legislation/bills/2025/S2238" | ||
|
||
def formula(tax_unit, period, parameters): | ||
""" | ||
Calculates the NYC School Tax Credit amount after applying the phase-out. | ||
|
||
Args: | ||
Fixed amount: The fixed amount of the credit. | ||
Rate reduction amount: The rate reduction amount of the credit. | ||
phase_out: The phase-out amount of the credit. | ||
|
||
Returns: | ||
float: The calculated credit amount. | ||
""" | ||
base_amount = add( | ||
tax_unit, | ||
period, | ||
[ | ||
"nyc_school_tax_credit_fixed_amount", | ||
"nyc_school_tax_credit_rate_reduction_amount", | ||
], | ||
) | ||
phase_out = tax_unit("nyc_school_tax_credit_phase_out", period) | ||
return max_(0, base_amount - phase_out) | ||
|
||
class reform(Reform): | ||
def apply(self): | ||
self.update_variable(nyc_school_tax_credit_phase_out) | ||
self.update_variable(nyc_school_tax_credit) | ||
|
||
return reform | ||
|
||
|
||
def create_nyc_school_tax_credit_with_phase_out_reform( | ||
parameters, period, bypass: bool = False | ||
): | ||
if bypass: | ||
return create_nyc_school_tax_credit_with_phase_out() | ||
|
||
p = parameters.gov.contrib.local.nyc.stc.phase_out | ||
|
||
reform_active = False | ||
current_period = period_(period) | ||
|
||
for i in range(5): | ||
if p(current_period).in_effect: | ||
reform_active = True | ||
break | ||
current_period = current_period.offset(1, "year") | ||
|
||
if reform_active: | ||
return create_nyc_school_tax_credit_with_phase_out() | ||
else: | ||
return None | ||
|
||
|
||
nyc_school_tax_credit_with_phase_out = ( | ||
create_nyc_school_tax_credit_with_phase_out_reform(None, None, bypass=True) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
policyengine_us/tests/policy/contrib/local/nyc/stc/nyc_school_tax_credit_with_phase_out.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
- name: Joint, with AGI below phase out threshold | ||
period: 2025 | ||
reforms: policyengine_us.reforms.local.nyc.stc.phase_out.nyc_school_tax_credit_with_phase_out.nyc_school_tax_credit_with_phase_out | ||
input: | ||
gov.contrib.local.nyc.stc.phase_out.in_effect: true | ||
in_nyc: True | ||
ny_agi: 150_000 | ||
filing_status: JOINT | ||
output: | ||
nyc_school_tax_credit_phase_out: 0 | ||
|
||
- name: Single, with AGI above phase out threshold | ||
period: 2025 | ||
reforms: policyengine_us.reforms.local.nyc.stc.phase_out.nyc_school_tax_credit_with_phase_out.nyc_school_tax_credit_with_phase_out | ||
input: | ||
gov.contrib.local.nyc.stc.phase_out.in_effect: true | ||
in_nyc: True | ||
ny_agi: 150_000 | ||
filing_status: SINGLE | ||
output: | ||
nyc_school_tax_credit_phase_out: 3_750 | ||
|
||
- name: Single, with AGI above phase out threshold, with credit amount, fully reduced | ||
period: 2025 | ||
reforms: policyengine_us.reforms.local.nyc.stc.phase_out.nyc_school_tax_credit_with_phase_out.nyc_school_tax_credit_with_phase_out | ||
input: | ||
gov.contrib.local.nyc.stc.phase_out.in_effect: true | ||
in_nyc: True | ||
ny_agi: 150_000 | ||
filing_status: SINGLE | ||
nyc_school_tax_credit_fixed_amount: 1_000 | ||
nyc_school_tax_credit_rate_reduction_amount: 500 | ||
output: | ||
nyc_school_tax_credit_phase_out: 3_750 | ||
nyc_school_tax_credit: 0 | ||
|
||
- name: Single, with AGI above phase out threshold, with credit amount, partially reduced | ||
period: 2025 | ||
reforms: policyengine_us.reforms.local.nyc.stc.phase_out.nyc_school_tax_credit_with_phase_out.nyc_school_tax_credit_with_phase_out | ||
input: | ||
gov.contrib.local.nyc.stc.phase_out.in_effect: true | ||
in_nyc: True | ||
ny_agi: 160_000 | ||
filing_status: SURVIVING_SPOUSE | ||
nyc_school_tax_credit_fixed_amount: 1_000 | ||
nyc_school_tax_credit_rate_reduction_amount: 600 | ||
output: | ||
nyc_school_tax_credit_phase_out: 500 | ||
nyc_school_tax_credit: 1_100 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant a file-level docstring explaining the policy. These args do not match the formula args.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a readme instead