Skip to content
Closed
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
1 change: 1 addition & 0 deletions policyengine-us
Submodule policyengine-us added at 6958e3
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description: Maryland TANF counts these income sources as earned income.
values:
2022-11-01:
- employment_income
- self_employment_income
- armed_services_basic_allowance_for_housing
metadata:
unit: list
reference:
title: 0903 Unearned Income 11.22.doc

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

description: Maryland TANF counts these income sources as unearned income.
values:
2022-11-01:
- pension_income
- investment_income
- social_security
- sick_accident
- alimony_income
- monetary_gifts
- dividend_income
- interest_income
- lottery_winnings
- lawsuit_settlements
- inheritances
- rent_subsidies
- worker_compensation
- unemployment_compensation
- veterans_benefits
- criminal_injuries_compensation

metadata:
unit: list
reference:
title: 0903 Unearned Income 11.22.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
- name: "Person who is age 20 and is full time student".
period: 2023
input:
age:20
is_full_time_college_student:true
is_k12_student:false
output:
is_child:false


- name: "Person who is age 18 and is full time k12 student".
period: 2023
input:
age:18
is_full_time_college_student:true
is_k12_student:true
output:
is_child:true


- name: "Person who is age 19 and is full time college student".
period: 2023
input:
age:19
is_full_time_college_student:true
is_k12_student:false
output:
is_child:true


- name: "Person who is age 19 and is full time k12 student".
period: 2023
input:
age:19
is_full_time_college_student:false
is_k12_student:true
output:
is_child:false
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from policyengine_us.model_api import *


class md_tanf_countable_gross_earned_income(Variable):
value_type = int
entity = SPMUnit
label = "Maryland TANF countable gross earned income"
unit = USD
definition_period = YEAR

def formula(spm_unit, period, parameters):
p = parameters(period).gov.states.md.tanf.income.sources
gross_earned = add(spm_unit, period, p.earned)
return gross_earned
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from policyengine_us.model_api import *


class md_tanf_countable_gross_unearned_income(Variable):
value_type = float
entity = SPMUnit
label = "Maryland TANF countable gross unearned income"
unit = USD
definition_period = YEAR
defined_for = StateCode.MD

def formula(spm_unit, period, parameters):
p = parameters(period).gov.states.md.tanf.income.sources
# Sum unearned sources, plus child support if not currently enrolled.
gross_unearned = add(spm_unit, period, p.unearned)
child_support = add(spm_unit, period, ["child_support_received"])
enrolled = spm_unit("is_tanf_enrolled", period)
return gross_unearned + where(enrolled, 0, child_support)
32 changes: 32 additions & 0 deletions policyengine_us/variables/gov/states/md/tanf/md_tanf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from policyengine_us.model_api import *


class md_tanf(Variable):
value_type = float
entity = SPMUnit
label = "Maryland TANF"
unit = USD
definition_period = YEAR
defined_for = "md_tanf_eligible"

def formula(spm_unit, period, parameters):
grant_standard = spm_unit("md_tanf_maximun_benefit", period)
earned_income = spm_unit(
"md_tanf_countable_gross_earned_income", period
)
earned_income_deduction = spm_unit(
"md_tanf_gross_earned_income_deduction", period
)
unearned_income = spm_unit(
"md_tanf_countable_gross_unearned_income", period
)
unearned_income_deduction = spm_unit(
"md_tanf_gross_unearned_income_deduction", period
)
income = add(
spm_unit,
period,
earned_income - earned_income_deduction,
unearned_income - unearned_income_deduction,
)
return max(grant_standard - income, 0)
26 changes: 26 additions & 0 deletions policyengine_us/variables/gov/states/md/tanf/md_tanf_is_child.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from policyengine_us.model_api import *




class md_tanf_is_child(Variable):
value_type = bool
entity = Person
definition_period = YEAR
label = "Wether is a child for MD TANF based on age, education, etc."
documentation = "0307 Age rev 11.22.doc"


def formula(person, period, parameters):
# younger than age 18
child_0_17 = person("is_child", period)
# Younger than age 19 and A full time k12 student
younger_than_19 = person("age", period) <= 19
k12 = person("is_k12_student", period)
k12_younger_than_19 = k12 & younger_than_19
# age 19 and a full time student
age_19 = person("age", period) == 19
full_time_student = person("is_full_time_college_student", period)
school_enrolled_19_year_old = full_time_student & younger_than_19
# return
return child_0_17 | school_enrolled_19_year_old | k12_younger_than_19