Skip to content

Commit

Permalink
upstream master
Browse files Browse the repository at this point in the history
Merge branch 'master' of https://github.com/PolicyEngine/policyengine-us into hua7450/issue5115
  • Loading branch information
hua7450 authored Oct 22, 2024
2 parents ec83331 + 7d6056f commit 60017d9
Show file tree
Hide file tree
Showing 12 changed files with 167 additions and 15 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,30 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.129.3] - 2024-10-21 20:37:15

### Fixed

- Changed weekly_hours_worked to weekly_hours_worked_before_lsr in SNAP formula to avoid circular dependency.

## [1.129.2] - 2024-10-21 20:22:41

### Changed

- Updated required version of policyengine-core

## [1.129.1] - 2024-10-21 19:39:15

### Fixed

- Pregnant people counted as 2 for Medicaid FPG percent

## [1.129.0] - 2024-10-17 19:59:12

### Added

- Biden NIIT label and description change.

## [1.128.0] - 2024-10-16 12:20:25

### Added
Expand Down Expand Up @@ -10029,6 +10053,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0



[1.129.3]: https://github.com/PolicyEngine/policyengine-us/compare/1.129.2...1.129.3
[1.129.2]: https://github.com/PolicyEngine/policyengine-us/compare/1.129.1...1.129.2
[1.129.1]: https://github.com/PolicyEngine/policyengine-us/compare/1.129.0...1.129.1
[1.129.0]: https://github.com/PolicyEngine/policyengine-us/compare/1.128.0...1.129.0
[1.128.0]: https://github.com/PolicyEngine/policyengine-us/compare/1.127.0...1.128.0
[1.127.0]: https://github.com/PolicyEngine/policyengine-us/compare/1.126.0...1.127.0
[1.126.0]: https://github.com/PolicyEngine/policyengine-us/compare/1.125.0...1.126.0
Expand Down
21 changes: 21 additions & 0 deletions changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8503,3 +8503,24 @@
added:
- Michigan 2024 income tax rate update.
date: 2024-10-16 12:20:25
- bump: minor
changes:
added:
- Biden NIIT label and description change.
date: 2024-10-17 19:59:12
- bump: patch
changes:
fixed:
- Pregnant people counted as 2 for Medicaid FPG percent
date: 2024-10-21 19:39:15
- bump: patch
changes:
changed:
- Updated required version of policyengine-core
date: 2024-10-21 20:22:41
- bump: patch
changes:
fixed:
- Changed weekly_hours_worked to weekly_hours_worked_before_lsr in SNAP formula
to avoid circular dependency.
date: 2024-10-21 20:37:15
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
description: President Biden proposed this additional NIIT tax rate.
description: President Biden proposed this additional net investment income tax rate.
metadata:
unit: /1
period: year
label: President Biden additional NIIT tax rate
label: President Biden additional NIIT rate
reference:
- title: General Explanations of the Administration's Fiscal Year 2025 Revenue Proposals
href: https://home.treasury.gov/system/files/131/General-Explanations-FY2025.pdf#page=85
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
description: President Biden proposed an additional Medicare tax rate for filers with adjusted gross income above this threshold.
description: President Biden proposed an additional net investment income tax rate for filers with adjusted gross income above this threshold.
metadata:
unit: currency-USD
period: year
uprating: gov.irs.uprating
label: President Biden additional Medicare tax rate threshold
label: President Biden additional NIIT rate threshold
reference:
- title: General Explanations of the Administration's Fiscal Year 2025 Revenue Proposals
href: https://home.treasury.gov/system/files/131/General-Explanations-FY2025.pdf#page=85
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
- name: Multiple people with income
period: 2024
input:
people:
head:
current_pregnancies: 0
spouse:
current_pregnancies: 0
tax_units:
tax_unit:
medicaid_magi: 20_440
tax_unit_size: 2
members: [head, spouse]
households:
household:
state_group_str: CONTIGUOUS_US
output:
tax_unit_medicaid_income_level: 1

- name: Multiple people with no income
period: 2024
input:
people:
head:
current_pregnancies: 0
spouse:
current_pregnancies: 0
tax_units:
tax_unit:
medicaid_magi: 0
tax_unit_size: 2
members: [head, spouse]
households:
household:
state_group_str: CONTIGUOUS_US
output:
tax_unit_medicaid_income_level: 0

- name: Multiple people with income and a pregnant person
period: 2024
input:
people:
head:
current_pregnancies: 1
spouse:
current_pregnancies: 0
tax_units:
tax_unit:
medicaid_magi: 25_820
tax_unit_size: 2
members: [head, spouse]
households:
household:
state_group_str: CONTIGUOUS_US
output:
tax_unit_medicaid_income_level: 1

- name: Multiple people with income and a pregnant person expecting twins
period: 2024
input:
people:
head:
current_pregnancies: 2
spouse:
current_pregnancies: 0
tax_units:
tax_unit:
medicaid_magi: 31_200
tax_unit_size: 2
members: [head, spouse]
households:
household:
state_group_str: CONTIGUOUS_US
output:
tax_unit_medicaid_income_level: 1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
is_full_time_student: true
age: 18
is_disabled: false
weekly_hours_worked: false
weekly_hours_worked_before_lsr: false
is_parent: false
output:
is_snap_ineligible_student: true
Expand All @@ -15,7 +15,7 @@
is_full_time_student: true
age: 17
is_disabled: false
weekly_hours_worked: false
weekly_hours_worked_before_lsr: false
is_parent: false
output:
is_snap_ineligible_student: false
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from policyengine_us.model_api import *
from policyengine_us.variables.gov.hhs.tax_unit_fpg import fpg


class tax_unit_medicaid_income_level(Variable):
Expand All @@ -10,10 +11,24 @@ class tax_unit_medicaid_income_level(Variable):
"Medicaid/CHIP-related MAGI as fraction of federal poverty line."
"Documentation: 'Federal poverty level (FPL)' at the following URL:"
"URL: https://www.healthcare.gov/glossary/federal-poverty-level-fpl/"
"**Pregnant Women:**"
" * Pregnant women are counted as themselves plus the number of children they are expecting to deliver"
" when determining household size for Medicaid eligibility."
" * Sources:"
" URL: https://www.sos.state.co.us/CCR/GenerateRulePdf.do?ruleVersionId=11618&fileName=10%20CCR%25202505-10%208.100"
" URL: https://www.cms.gov/marketplace/technical-assistance-resources/special-populations-pregnant-women.pdf"
)
definition_period = YEAR

def formula(tax_unit, period, parameters):
income = tax_unit("medicaid_magi", period)
fpg = tax_unit("tax_unit_fpg", period)
return income / fpg

pregnant_count = add(tax_unit, period, ["current_pregnancies"])
tax_unit_size = tax_unit("tax_unit_size", period)
state_group = tax_unit.household("state_group_str", period)

medicaid_fpg = fpg(
pregnant_count + tax_unit_size, state_group, period, parameters
)

return income / medicaid_fpg
12 changes: 8 additions & 4 deletions policyengine_us/variables/gov/hhs/tax_unit_fpg.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
from policyengine_us.model_api import *


def fpg(unit_size, state_group, period, parameters):
p_fpg = parameters(period).gov.hhs.fpg
p1 = p_fpg.first_person[state_group]
pn = p_fpg.additional_person[state_group]
return p1 + pn * (unit_size - 1)


class tax_unit_fpg(Variable):
value_type = float
entity = TaxUnit
Expand All @@ -11,7 +18,4 @@ class tax_unit_fpg(Variable):
def formula(tax_unit, period, parameters):
n = tax_unit("tax_unit_size", period)
state_group = tax_unit.household("state_group_str", period)
p_fpg = parameters(period).gov.hhs.fpg
p1 = p_fpg.first_person[state_group]
pn = p_fpg.additional_person[state_group]
return p1 + pn * (n - 1)
return fpg(n, state_group, period, parameters)
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def formula(person, period, parameters):
p = parameters(period).gov.usda.snap.student
age_eligible = p.age_threshold.calc(age)
disabled = person("is_disabled", period)
hours_worked = person("weekly_hours_worked", period)
hours_worked = person("weekly_hours_worked_before_lsr", period)
hours_eligible = hours_worked >= p.working_hours_threshold
# The parental status applies to children under 6 (under 12
# if no care available)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from policyengine_us.model_api import *


class current_pregnancies(Variable):
value_type = int
entity = Person
definition_period = YEAR
label = "The number of children a pregnant person is expecting"
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ class is_pregnant(Variable):
entity = Person
label = "Is pregnant"
definition_period = YEAR
adds = ["current_pregnancies"]
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="policyengine-us",
version="1.128.0",
version="1.129.3",
author="PolicyEngine",
author_email="[email protected]",
long_description=readme,
Expand All @@ -34,7 +34,7 @@
),
],
install_requires=[
"policyengine-core>=3.8.1",
"policyengine-core>=3.10.0",
"policyengine-us-data==1.11.0",
"microdf-python",
"tqdm",
Expand Down

0 comments on commit 60017d9

Please sign in to comment.