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

Use a for loop for repealing benefits #19

Open
MaxGhenis opened this issue Jan 2, 2021 · 0 comments
Open

Use a for loop for repealing benefits #19

MaxGhenis opened this issue Jan 2, 2021 · 0 comments

Comments

@MaxGhenis
Copy link
Contributor

To condense these if statements:

us-calc/funding.py

Lines 214 to 236 in 36e9e34

if 'ssi' in benefits:
funding += (target_persons.incssi * target_persons.asecwt).sum()
target_persons.new_spm_resources -= target_persons.incssi
if 'unemp' in benefits:
funding += (target_persons.incunemp * target_persons.asecwt).sum()
target_persons.new_spm_resources -= target_persons.incunemp
if 'eitc' in benefits:
funding += (target_persons.eitcred * target_persons.asecwt).sum()
target_persons.new_spm_resources -= target_persons.spmeitc
if 'ctc' in benefits:
funding += (target_persons.ctc * target_persons.asecwt).sum()
target_persons.new_spm_resources -= target_persons.spmctc
if 'snap' in benefits:
funding += (target_persons.snap_pp * target_persons.asecwt).sum()
target_persons.new_spm_resources -= target_persons.snap_pp
if 'energy' in benefits:
funding += (target_persons.energy_pp * target_persons.asecwt).sum()
target_persons.new_spm_resources -= target_persons.energy_pp

@ngpsu22 ngpsu22 closed this as completed Jan 3, 2021
@MaxGhenis MaxGhenis reopened this Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants