Skip to content
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

Updated pr.yaml and push.yaml #54

Merged
merged 4 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check formatting
uses: "lgeiger/black-action@master"
with:
Expand All @@ -15,7 +15,7 @@ jobs:
name: Check version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ github.event.pull_request.head.repo.full_name }}
Expand All @@ -38,7 +38,7 @@ jobs:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
(github.repository == 'TheCGO/fiscalsim-us')
&& (github.event.head_commit.message == 'Update FiscalSim US')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check formatting
uses: "lgeiger/black-action@master"
with:
Expand All @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand All @@ -68,7 +68,7 @@ jobs:
run: make documentation
- name: Deploy documentation
if: matrix.os == 'ubuntu-latest'
uses: JamesIves/github-pages-deploy-action@releases/v4
uses: JamesIves/github-pages-deploy-action@v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
Expand All @@ -80,7 +80,7 @@ jobs:
&& (github.event.head_commit.message == 'Update FiscalSim US')
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
Expand Down
3 changes: 2 additions & 1 deletion changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
- bump: minor
changes:
added:
- Added Minnesota state income tax logic with credits and refunds
- Update push.yaml and pr.yaml GH Actions
- Fix code formatting in some files
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,21 @@ class calc_line_14(Variable):
defined_for = StateCode.VA

def formula(tax_unit, period, parameters):

# line_11 = tax_unit("va_standard_deduction",period)

filing_status = tax_unit("filing_status", period)

if filing_status == 1:

va_standard_deduction = parameters(
period
).gov.states.va.tax.income.va_standard_deduction.SINGLE

if filing_status == 2:

va_standard_deduction = parameters(
period
).gov.states.va.tax.income.va_standard_deduction.JOINT

if filing_status == 3:

va_standard_deduction = parameters(
period
).gov.states.va.tax.income.va_standard_deduction.SEPARATE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class va_additions_to_federal_agi(Variable):
defined_for = StateCode.VA

def formula(tax_unit, period, parameters):

income_from_obligations_fed_exempt = tax_unit(
"income_from_obligations_fed_exempt", period
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,13 @@ def formula(tax_unit, period, parameters):
subtotal = line3 - line8

if filing_status == 1 or filing_status == 3:

if subtotal < single:

tax_owed = 0

return tax_owed

if filing_status == 2:

if subtotal < joint:

tax_owed = 0

return tax_owed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class va_age_deduction(Variable):
defined_for = StateCode.VA

def formula(tax_unit, period, parameters):

age_of_head = tax_unit("age_head", period)

age_of_spouse = tax_unit("age_spouse", period)
Expand All @@ -30,37 +29,28 @@ def formula(tax_unit, period, parameters):
spouse_fdcs = 0 # change this

if age_of_head > 65:

if filing_status == 1:

age_deduction_count = 1

if filing_status == 2 & age_of_spouse > 65:

age_deduction_count = 2

if filing_status == 1:

total_agi = federal_agi

else:

total_agi = federal_agi + spouse_agi

if filing_status == 1:

total_fda = you_fdca

else:

total_fda = you_fdca + spouse_fdca

if filing_status == 1:

total_fds = you_fdcs

else:

total_fds = you_fdcs + spouse_fdcs

line4 = total_agi + total_fda
Expand All @@ -72,41 +62,33 @@ def formula(tax_unit, period, parameters):
line8 = line6 - line7

if filing_status == 1:

threshold_ln9 = (
parameters.gov.states.va.tax.income.va_age_deduction_threshold.single
)

if filing_status == 2:

threshold_ln9 = (
parameters.gov.states.va.tax.income.va_age_deduction_threshold.joint
)

if filing_status == 3:

threshold_ln9 = (
parameters.gov.states.va.tax.income.va_age_deduction_threshold.separate
)

if line8 > threshold_ln9:

line11 = line8 - threshold_ln9

line12 = age_deduction_count * 12000

if line11 > line12:

final_age_deduction = 0

if line11 < line12:

line14 = line12 - line11

if filing_status == 1 or filing_status == 2:

return line14

if filing_status == 3:

return line14 / 2
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class va_calc_line_3(Variable):
defined_for = StateCode.VA

def formula(tax_unit, period, parameters):

federal_agi = tax_unit("adjusted_gross_income", period)

additions_to_federal_agi = tax_unit(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class va_calc_line_8(Variable):
defined_for = StateCode.VA

def formula(tax_unit, period, parameters):

age_deduction = tax_unit("va_age_deduction", period)

subtractions_to_federal_agi = tax_unit(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class va_exemptions(Variable):
defined_for = StateCode.VA

def formula(tax_unit, period, parameters):

va_indiv_exempt_multiplier = parameters(
period
).gov.states.va.tax.income.exemptions.indiv_exemption_multiplier
Expand All @@ -29,15 +28,12 @@ def formula(tax_unit, period, parameters):
filing_status = tax_unit("filing_status", period)

if filing_status == 1:

spouse_if_filing_jointly = 0

elif filing_status == 2:

spouse_if_filing_jointly = 1

else:

spouse_if_filing_jointly = 0

you_p65 = (tax_unit("age_head", period) >= 65).astype(int)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,16 @@ class va_income_tax(Variable):
defined_for = StateCode.VA

def formula(tax_unit, period, parameters):

net_tax = tax_unit("va_income_tax_before_refundable_credits", period)

line_26 = tax_unit("va_refundable_credits", period)

if line_26 < net_tax:

owed_tax = net_tax - line_26

return owed_tax

if net_tax < line_26:

refund = (line_26 - net_tax) * -1

return refund
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ class va_income_tax_before_refundable_credits(Variable):
defined_for = StateCode.VA

def formula(tax_unit, period, parameters):

rates = parameters(period).gov.states.va.tax.income.va_tax_rates

taxable_inc = tax_unit("va_taxable_income", period)

if taxable_inc > 0:

net_tax = rates.calc(taxable_inc)

# if taxable_inc < 3000:
Expand All @@ -42,7 +40,6 @@ def formula(tax_unit, period, parameters):
# net_tax = (excess_taxable * .0575) + 720

else:

net_tax = 0

return net_tax
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class va_refundable_credits(Variable):
defined_for = StateCode.VA

def formula(tax_unit, period, parameters):

line_19 = tax_unit("va_witholding", period)

line_19b = tax_unit("va_spouse_witholding", period)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,19 @@ class va_standard_deduction(Variable):
defined_for = StateCode.VA

def formula(tax_unit, period, parameters):

filing_status = tax_unit("filing_status", period)

if filing_status == 1:

standard_deduction = (
parameters.gov.states.va.tax.income.va_standard_deduction.SINGLE
)

if filing_status == 2:

standard_deduction = (
parameters.gov.states.va.tax.income.va_standard_deduction.JOINT
)

if filing_status == 3:

standard_deduction = (
parameters.gov.states.va.tax.income.va_standard_deduction.SINGLE
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class va_subtractions_to_federal_agi(Variable):
defined_for = StateCode.VA

def formula(tax_unit, period, parameters):

income_from_obligations_state_exempt = tax_unit(
"income_from_obligations_state_exempt", period
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class va_tax_credit_for_low_income_individuals(Variable):
defined_for = StateCode.VA

def formula(tax_unit, period, parameters):

agi = tax_unit("va_adj_gross_income", period)

filing_status = tax_unit("filing_status", period)
Expand All @@ -20,15 +19,12 @@ def formula(tax_unit, period, parameters):
net_tax = tax_unit("va_income_tax_before_refundable_credits", period)

if filing_status == 1:

spouse_if_filing_jointly = 0

elif filing_status == 2:

spouse_if_filing_jointly = 1

else:

spouse_if_filing_jointly = 0

spouse_agi = tax_unit("spouse_separate_adjusted_gross_income", period)
Expand All @@ -50,7 +46,6 @@ def formula(tax_unit, period, parameters):
# threshold = 12880 + (4540*(total_num_exemptions-1))

if total_agi < threshold:

line_13 = total_num_exemptions * 300

# if fed_eitc > 0 :
Expand All @@ -62,24 +57,19 @@ def formula(tax_unit, period, parameters):
line_15 = line_14 * eitc_rate

if line_15 > line_13:

line_16 = line_15
else:

line_16 = line_13

if net_tax > line_16:

line_17 = line_16

else:

line_17 = net_tax

return line_17

else:

line_17 = 0

return line_17
Loading