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

Interdependent recovery of residential buildings and households #606

Conversation

ylyangtw
Copy link
Contributor

@ylyangtw ylyangtw commented Jul 30, 2024

This PR is to support Lisa Wang's new analysis Interdependent recovery of residential buildings and households.

Two analyses have changes:

  1. Residential building recovery
    • Add 2 additional output datasets, which are the same as commercial building recovery
  2. Housing recovery sequential
    • Major idea is that zones can be generated based on either social vulnerability or household income.
    • Change sv_generator from hardcoded to 2 input datasets zone_def_sv and zone_dev_hhinc. To make sure analysis runs without inputs, default zone_def_sv and zone_dev_hhinc are provided.
    • Add one function to generate zones based on household income, and modify the model accordingly.

For testing, please run
test_residentialbuildingrecovery.py
test_housingrecoverysequential_sv.py
test_housingrecoverysequential_hhinc.py

Copy link
Member

@longshuicy longshuicy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code runs well besides the minor suggestions. Approved.

@ylyangtw ylyangtw self-assigned this Aug 14, 2024
start = timer()

# dev Joplin testbed
population_dislocation = Dataset.from_file(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this a dataset on dev? This is a pretty big file and is better served from the incore-dev and referenced by ID instead.

@navarroc
Copy link
Member

The test folder should match the analysis folder name. Since the folder is housingrecoverysequential, the test folder shouldn't be housingrecoveryserial it should be housingrecoverysequential. This looks like it was missed before. Can you rename that folder?

@navarroc
Copy link
Member

test_housingrecoverysequential_sv.py raises a value error about hhinc, is that expected?

@@ -352,6 +416,7 @@ def housing_serial_recovery_model(
result["guid"] = households_df["guid"]
result["huid"] = households_df["huid"]
result["Zone"] = households_df["Zone"]
result["Zone Indicator"] = households_df["Zone Indicator"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can probably be shortened to match the 10 char limit for dbf/shapefile. Maybe zone_indic?

@navarroc
Copy link
Member

Do we need to open issues to add new semantic types for the outputs from residential building recovery?

@navarroc
Copy link
Member

test_housingrecoverysequential_sv.py raises a value error about hhinc, is that expected?

@longshuicy Raising a value error if hhinc is not present prevents the analysis from running, should it do that? It looks like the population_dislocation dataset referenced in the test doesn't have that column, probably because the housing unit allocation dataset used to generate it didn't have that column. If hhinc should be there, then we should raise a value error and fix the dataset on dev. Since this isn't a test we execute as part of the pyincore testing, we could fix this later so we can get this merged.

@ylyangtw
Copy link
Contributor Author

ylyangtw commented Aug 28, 2024

test_housingrecoverysequential_sv.py raises a value error about hhinc, is that expected?

@longshuicy Raising a value error if hhinc is not present prevents the analysis from running, should it do that? It looks like the population_dislocation dataset referenced in the test doesn't have that column, probably because the housing unit allocation dataset used to generate it didn't have that column. If hhinc should be there, then we should raise a value error and fix the dataset on dev. Since this isn't a test we execute as part of the pyincore testing, we could fix this later so we can get this merged.

The original population_dislocation_block (Galveston) doesn't have hhinc and it calculates the zones using social vulnerability. To support Lisa Wang's analysis, Joplin population_dislocation_block has hhinc and zones are calculated using hhinc.

So we don't need to raise a value error if hhinc is not there since hhinc is not required. It's only a condition - If hhinc is there, then we add it to pop_dis_selectors

Sorry I didn't think it clearly and test properly when I made the changes.

@ylyangtw
Copy link
Contributor Author

Do we need to open issues to add new semantic types for the outputs from residential building recovery?

Just opened an issue #611

@ylyangtw
Copy link
Contributor Author

@navarroc I have addressed all the comments. Thank you!

Missing "#"
@longshuicy longshuicy merged commit a95904c into develop Aug 28, 2024
7 checks passed
@longshuicy longshuicy deleted the Interdependent-recovery-of-residential-buildings-and-households branch August 28, 2024 16:24
@navarroc navarroc added this to the 1.20.0 milestone Oct 8, 2024
@longshuicy longshuicy mentioned this pull request Oct 22, 2024
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

Successfully merging this pull request may close these issues.

3 participants