Add AMI and FMR data from HUD#2450
Conversation
|
|
||
| class HUDUSER(PublicDataset): | ||
| name = "huduser" | ||
| is_openfisca_compatible = True |
There was a problem hiding this comment.
@nikhilwoodruff does this mean all the columns need to match variable/parameter names?
There was a problem hiding this comment.
discussed, will change to false
| # Load HUD data for FMR values (Update the path to the CSV file as needed) | ||
| hud_data = pd.read_csv("path_to/FMR_data.csv") | ||
|
|
||
| class FMR_0_bedroom(Variable): |
There was a problem hiding this comment.
discussed with @MaxGhenis ,
variable - fmr(input household, spmunit) etc.
variable ami (input spmunit/?)
should I map all data columns to parameter names then?
There was a problem hiding this comment.
No, I think we're fine loading from data.
There was a problem hiding this comment.
We could combine these into one variable hud_free_market_rent
nikhilwoodruff
left a comment
There was a problem hiding this comment.
So, the full process:
- Take a household
- Look up min(num bedrooms, num people) in the FMR table for the local area FIPS
...
| # Load HUD data for FMR values (Update the path to the CSV file as needed) | ||
| hud_data = pd.read_csv("path_to/FMR_data.csv") | ||
|
|
||
| class FMR_0_bedroom(Variable): |
There was a problem hiding this comment.
No, I think we're fine loading from data.
| RawHUDUSER.generate(year) | ||
|
|
||
| raw_data = RawHUDUSER.load(year) | ||
| huduser_data = h5py.File(HUDUSER.file(year), mode="w") |
There was a problem hiding this comment.
Discussed, no need to convert to H5, use csv/xls instead.
7926ec9 to
d2543dc
Compare
|
Closing: very old stale PR. If still relevant, please open a fresh PR against current master. |
🤖 Generated by Copilot at 7c7aaf1
Summary
🏠📊💵
This pull request adds the HUDUSER dataset and the HUD income limits and free market rent variables to the policyengine-us package. It creates the
policyengine_us.data.datasets.huduserpackage, which contains the modules for generating and loading the HUDUSER data from the HUD website. It also creates thepolicyengine_us.variables.gov.hudpackage, which contains the modules for defining the HUD-related variables based on the HUDUSER data and the household FIPS code.Walkthrough
raw_huduserandhudusermodules from thepolicyengine_us.data.datasets.huduserpackage (link)HUDUSERclass that inherits from thePublicDatasetclass and generates the HUDUSER dataset from the raw HUDUSER data (link)RawHUDUSERclass that inherits from thePublicDatasetclass and generates the raw HUDUSER data from the HUD website (link)FMR_0_bedroom,FMR_1_bedroom,FMR_2_bedroom,FMR_3_bedroom, andFMR_4_bedroomvariables that inherit from theVariableclass and calculate the free market rent for different bedroom sizes (link)HUDIncomeLimitsvariable that inherits from theVariableclass and calculates the HUD income limits for ELI, LI, and VLI for different household sizes (link)