-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feature/admin-&-translations-ui-rework
- Loading branch information
Showing
93 changed files
with
499 additions
and
348 deletions.
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 |
---|---|---|
@@ -1,64 +1,8 @@ | ||
from .rtdlive.calculator import RtdLive | ||
from .child_care_assistance.calculator import ChildCareAssistance | ||
from .mydenver.calculator import MyDenver | ||
from .cash_back.calculator import CashBack | ||
from .energy_assistance.calculator import EnergyAssistance | ||
from .energy_resource_center.calculator import EnergyResourceCenter | ||
from .omnisalud.calculator import OmniSalud | ||
from .dental_health_care_seniors.calculator import DentalHealthCareSeniors | ||
from .reproductive_health_care.calculator import ReproductiveHealthCare | ||
from .connect_for_health.calculator import ConnectForHealth | ||
from .medicaid.family_planning_services.calculator import FamilyPlanningServices | ||
from .denver_preschool_program.calculator import DenverPreschoolProgram | ||
from .head_start.calculator import HeadStart | ||
from .every_day_eats.calculator import EveryDayEats | ||
from .property_credit_rebate.calculator import PropertyCreditRebate | ||
from .universal_preschool.calculator import UniversalPreschool | ||
from .my_spark.calculator import MySpark | ||
from .ssdi.calculator import Ssdi | ||
from .low_wage_covid_relief.calculator import LowWageCovidRelief | ||
from .medicaid.child_with_disability.calculator import MedicaidChildWithDisability | ||
from .medicaid.adult_with_disability.calculator import MedicaidAdultWithDisability | ||
from .medicaid.emergency.calculator import EmergencyMedicaid | ||
from .medicare_savings.calculator import MedicareSavings | ||
from .basic_cash_assistance.calculator import BasicCashAssistance | ||
from .weatherization_assistance.calculator import WeatherizationAssistance | ||
from .tabor.calculator import Tabor | ||
from .trua.calculator import Trua | ||
from .utility_bill_pay.calculator import UtilityBillPay | ||
from .co import co_calculators | ||
from .federal import federal_calculators | ||
from .calc import ProgramCalculator | ||
from .rental_assistance_grant.calculator import RentalAssistanceGrant | ||
from .emergency_rental_assistance.calculator import EmergencyRentalAssistance | ||
|
||
calculators: dict[str, type[ProgramCalculator]] = { | ||
'rtdlive': RtdLive, | ||
'cccap': ChildCareAssistance, | ||
'mydenver': MyDenver, | ||
'cocb': CashBack, | ||
'leap': EnergyAssistance, | ||
'erc': EnergyResourceCenter, | ||
'omnisalud': OmniSalud, | ||
'cdhcs': DentalHealthCareSeniors, | ||
'rhc': ReproductiveHealthCare, | ||
'cfhc': ConnectForHealth, | ||
'fps': FamilyPlanningServices, | ||
'chs': HeadStart, | ||
'dpp': DenverPreschoolProgram, | ||
'ede': EveryDayEats, | ||
'cpcr': PropertyCreditRebate, | ||
'upk': UniversalPreschool, | ||
'myspark': MySpark, | ||
'ssdi': Ssdi, | ||
'lwcr': LowWageCovidRelief, | ||
'cwd_medicaid': MedicaidChildWithDisability, | ||
'awd_medicaid': MedicaidAdultWithDisability, | ||
'emergency_medicaid': EmergencyMedicaid, | ||
'medicare_savings': MedicareSavings, | ||
'bca': BasicCashAssistance, | ||
'cowap': WeatherizationAssistance, | ||
'tabor': Tabor, | ||
'trua': Trua, | ||
'ubp': UtilityBillPay, | ||
'rag': RentalAssistanceGrant, | ||
'erap': EmergencyRentalAssistance, | ||
**co_calculators, | ||
**federal_calculators | ||
} |
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,60 @@ | ||
from .rtdlive.calculator import RtdLive | ||
from .child_care_assistance.calculator import ChildCareAssistance | ||
from .mydenver.calculator import MyDenver | ||
from .cash_back.calculator import CashBack | ||
from .energy_assistance.calculator import EnergyAssistance | ||
from .energy_resource_center.calculator import EnergyResourceCenter | ||
from .omnisalud.calculator import OmniSalud | ||
from .dental_health_care_seniors.calculator import DentalHealthCareSeniors | ||
from .reproductive_health_care.calculator import ReproductiveHealthCare | ||
from .connect_for_health.calculator import ConnectForHealth | ||
from .medicaid.family_planning_services.calculator import FamilyPlanningServices | ||
from .denver_preschool_program.calculator import DenverPreschoolProgram | ||
from .every_day_eats.calculator import EveryDayEats | ||
from .property_credit_rebate.calculator import PropertyCreditRebate | ||
from .universal_preschool.calculator import UniversalPreschool | ||
from .my_spark.calculator import MySpark | ||
from .low_wage_covid_relief.calculator import LowWageCovidRelief | ||
from .medicaid.child_with_disability.calculator import MedicaidChildWithDisability | ||
from .medicaid.adult_with_disability.calculator import MedicaidAdultWithDisability | ||
from .medicaid.emergency.calculator import EmergencyMedicaid | ||
from .basic_cash_assistance.calculator import BasicCashAssistance | ||
from .weatherization_assistance.calculator import WeatherizationAssistance | ||
from .tabor.calculator import Tabor | ||
from .trua.calculator import Trua | ||
from .utility_bill_pay.calculator import UtilityBillPay | ||
from ..calc import ProgramCalculator | ||
from .rental_assistance_grant.calculator import RentalAssistanceGrant | ||
from .emergency_rental_assistance.calculator import EmergencyRentalAssistance | ||
|
||
|
||
co_calculators: dict[str, type[ProgramCalculator]] = { | ||
'rtdlive': RtdLive, | ||
'cccap': ChildCareAssistance, | ||
'mydenver': MyDenver, | ||
'cocb': CashBack, | ||
'leap': EnergyAssistance, | ||
'erc': EnergyResourceCenter, | ||
'omnisalud': OmniSalud, | ||
'cdhcs': DentalHealthCareSeniors, | ||
'rhc': ReproductiveHealthCare, | ||
'cfhc': ConnectForHealth, | ||
'fps': FamilyPlanningServices, | ||
'dpp': DenverPreschoolProgram, | ||
'ede': EveryDayEats, | ||
'cpcr': PropertyCreditRebate, | ||
'upk': UniversalPreschool, | ||
'myspark': MySpark, | ||
'lwcr': LowWageCovidRelief, | ||
'cwd_medicaid': MedicaidChildWithDisability, | ||
'awd_medicaid': MedicaidAdultWithDisability, | ||
'emergency_medicaid': EmergencyMedicaid, | ||
'bca': BasicCashAssistance, | ||
'cowap': WeatherizationAssistance, | ||
'tabor': Tabor, | ||
'trua': Trua, | ||
'ubp': UtilityBillPay, | ||
'rag': RentalAssistanceGrant, | ||
'erap': EmergencyRentalAssistance, | ||
} | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
44 changes: 44 additions & 0 deletions
44
programs/programs/co/emergency_rental_assistance/calculator.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,44 @@ | ||
from programs.programs.calc import Eligibility, ProgramCalculator | ||
import programs.programs.messages as messages | ||
from integrations.util.cache import Cache | ||
from programs.sheets import sheets_get_data | ||
from programs.co_county_zips import counties_from_zip | ||
|
||
|
||
class EmergencyRentalAssistanceIncomeLimitsCache(Cache): | ||
expire_time = 60 * 60 * 24 | ||
default = {} | ||
|
||
def update(self): | ||
spreadsheet_id = '1QHb-ZT0Y2oWjFMoeP_wy8ClveslINWdehb-CXhB8WSE' | ||
range_name = "'2022 80% AMI'!A2:I" | ||
sheet_values = sheets_get_data(spreadsheet_id, range_name) | ||
|
||
if not sheet_values: | ||
raise Exception('Sheet unavailable') | ||
|
||
data = {d[0].strip() + ' County': [int(v.replace(',', '')) for v in d[1:]] for d in sheet_values} | ||
|
||
return data | ||
|
||
|
||
class EmergencyRentalAssistance(ProgramCalculator): | ||
amount = 13_848 | ||
dependencies = ['income_amount', 'income_frequency', 'household_size', 'zipcode'] | ||
income_cache = EmergencyRentalAssistanceIncomeLimitsCache() | ||
income_limit_percent = .8 | ||
|
||
def eligible(self) -> Eligibility: | ||
e = Eligibility() | ||
|
||
# Income test | ||
counties = counties_from_zip(self.screen.zipcode) | ||
county_name = self.screen.county if self.screen.county is not None else counties[0] | ||
|
||
income = self.screen.calc_gross_income('yearly', ['all']) | ||
income_limits = EmergencyRentalAssistance.income_cache.fetch() | ||
income_limit = income_limits[county_name][self.screen.household_size - 1] * EmergencyRentalAssistance.income_limit_percent | ||
e.condition(income < income_limit, messages.income(income, income_limit)) | ||
|
||
return e | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,22 @@ | ||
import programs.programs.co.pe.tax as tax | ||
import programs.programs.co.pe.member as member | ||
from programs.programs.policyengine.calculators.base import PolicyEngineCalulator | ||
|
||
|
||
co_member_calculators = { | ||
'co_medicaid': member.CoMedicaid, | ||
'andcs': member.AidToTheNeedyAndDisabled, | ||
'oap': member.OldAgePension, | ||
'chp': member.Chp, | ||
} | ||
|
||
co_tax_unit_calculators = { | ||
'coeitc': tax.Coeitc, | ||
'coctc': tax.Coctc, | ||
} | ||
|
||
co_pe_calculators: dict[str, type[PolicyEngineCalulator]] = { | ||
**co_member_calculators, | ||
**co_tax_unit_calculators, | ||
} | ||
|
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,61 @@ | ||
from programs.programs.policyengine.calculators.base import PolicyEngineMembersCalculator | ||
from programs.programs.federal.pe.member import Medicaid | ||
import programs.programs.policyengine.calculators.dependencies as dependency | ||
|
||
|
||
class CoMedicaid(Medicaid): | ||
child_medicaid_average = 200 * 12 | ||
adult_medicaid_average = 310 * 12 | ||
aged_medicaid_average = 170 * 12 | ||
|
||
|
||
class AidToTheNeedyAndDisabled(PolicyEngineMembersCalculator): | ||
pe_name = 'co_state_supplement' | ||
pe_inputs = [ | ||
dependency.member.SsiCountableResourcesDependency, | ||
dependency.member.SsiReportedDependency, | ||
dependency.member.IsBlindDependency, | ||
dependency.member.IsDisabledDependency, | ||
dependency.member.SsiEarnedIncomeDependency, | ||
dependency.member.SsiUnearnedIncomeDependency, | ||
dependency.member.AgeDependency, | ||
dependency.member.TaxUnitSpouseDependency, | ||
dependency.member.TaxUnitHeadDependency, | ||
dependency.member.TaxUnitDependentDependency, | ||
] | ||
pe_outputs = [dependency.member.Andcs] | ||
|
||
|
||
class OldAgePension(PolicyEngineMembersCalculator): | ||
pe_name = 'co_oap' | ||
pe_inputs = [ | ||
dependency.member.SsiCountableResourcesDependency, | ||
dependency.member.SsiEarnedIncomeDependency, | ||
dependency.member.SsiUnearnedIncomeDependency, | ||
dependency.member.AgeDependency, | ||
dependency.member.TaxUnitSpouseDependency, | ||
dependency.member.TaxUnitHeadDependency, | ||
dependency.member.TaxUnitDependentDependency, | ||
] | ||
pe_outputs = [dependency.member.Oap] | ||
|
||
|
||
class Chp(PolicyEngineMembersCalculator): | ||
pe_name = 'co_chp' | ||
pe_inputs = [ | ||
dependency.member.AgeDependency, | ||
dependency.member.PregnancyDependency, | ||
*dependency.irs_gross_income, | ||
] | ||
pe_outputs = [dependency.member.ChpEligible] | ||
|
||
amount = 200 * 12 | ||
|
||
def value(self): | ||
total = 0 | ||
|
||
for _, pvalue in self.get_data().items(): | ||
if pvalue['co_chp_eligible'][self.pe_period] > 0 and self.screen.has_insurance_types(('none',)): | ||
total += self.amount | ||
|
||
return total |
File renamed without changes.
32 changes: 2 additions & 30 deletions
32
.../policyengine/calculators/programs/tax.py → programs/programs/co/pe/tax.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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,10 @@ | ||
from .ssdi.calculator import Ssdi | ||
from .head_start.calculator import HeadStart | ||
from .medicare_savings.calculator import MedicareSavings | ||
from ..calc import ProgramCalculator | ||
|
||
federal_calculators: dict[str, type[ProgramCalculator]] = { | ||
'ssdi': Ssdi, | ||
'chs': HeadStart, | ||
'medicare_savings': MedicareSavings, | ||
} |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
programs/programs/head_start/calculator.py → ...programs/federal/head_start/calculator.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
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
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,31 @@ | ||
import programs.programs.federal.pe.tax as tax | ||
import programs.programs.federal.pe.spm as spm | ||
import programs.programs.federal.pe.member as member | ||
from programs.programs.policyengine.calculators.base import PolicyEngineCalulator | ||
|
||
|
||
federal_member_calculators = { | ||
'wic': member.Wic, | ||
'pell_grant': member.PellGrant, | ||
'ssi': member.Ssi, | ||
} | ||
|
||
federal_spm_unit_calculators = { | ||
'acp': spm.Acp, | ||
'lifeline': spm.Lifeline, | ||
'nslp': spm.SchoolLunch, | ||
'snap': spm.Snap, | ||
'tanf': spm.Tanf, | ||
} | ||
|
||
federal_tax_unit_calculators = { | ||
'eitc': tax.Eitc, | ||
'ctc': tax.Ctc, | ||
} | ||
|
||
federal_pe_calculators: dict[str, type[PolicyEngineCalulator]] = { | ||
**federal_member_calculators, | ||
**federal_spm_unit_calculators, | ||
**federal_tax_unit_calculators, | ||
} | ||
|
Oops, something went wrong.