Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Properly assign representative income#1478

Merged
rajeee merged 13 commits into
developfrom
income_bin_fix
Aug 23, 2025
Merged

Properly assign representative income#1478
rajeee merged 13 commits into
developfrom
income_bin_fix

Conversation

@rajeee

@rajeee rajeee commented Aug 20, 2025

Copy link
Copy Markdown
Contributor

Pull Request Description

Assigned income based on lookup derived from 2019 5-yrs ACS PUMS, same dataset for income characterization
Minor revision to panel constraint determination

Related Pull Requests

[related PRs from different repositories]

Related Issues

[What issue(s) is the PR addressing]

Checklist

Required:

Optional (not all items may apply):


import sys

sys.path.append(str(Path(__file__).resolve().parents[1]))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I had to add this to import the income mapper. Maybe keep it until we have a default env for resstock? @rajeee

Comment thread postprocessing/resstockpostproc/income_mapper.py

out_space_col = "out.panel.constraint.breaker_space"
space_constraint = pl.when(pl.col(space_col) <= 0).then(True).otherwise(False).alias(out_space_col)
space_constraint = pl.when(pl.col(space_col) < 0).then(True).otherwise(False).alias(out_space_col)

@lixiliu lixiliu Aug 22, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 headroom is technically not a constraint, so revising the logic here.

If the panel's breaker space becomes fully occupied after the upgrade, it's a tight fit but no intervention is needed, so no constraint.

Comment thread postprocessing/tests/test_income_mapping.py Outdated
income_expr = income_expr.when(pl.col("in.income").str.contains("\+"))
income_expr = income_expr.then(
pl.col("in.income").str.extract(r"(\d+)\+", 1).cast(pl.Float64, strict=False)
# Reassign negative or zero dollar income to 1 dollar

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There's a bunch of changes to this file b/c I formatted it with black.

The core change is here. In addition to the income mapper, I reassign 0 and negative income to 1 so we can approximate energy burden. @rajeee

@rajeee rajeee merged commit ac52f62 into develop Aug 23, 2025
12 checks passed
@joseph-robertson joseph-robertson added this to the ResStock v2025_R1 milestone Sep 4, 2025
@rHorsey rHorsey deleted the income_bin_fix branch October 27, 2025 20:21
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.

4 participants