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

Skip to content

Gracefully handle failures in upgrades#1467

Merged
rajeee merged 5 commits into
developfrom
pp_fix
Aug 13, 2025
Merged

Gracefully handle failures in upgrades#1467
rajeee merged 5 commits into
developfrom
pp_fix

Conversation

@rajeee

@rajeee rajeee commented Aug 12, 2025

Copy link
Copy Markdown
Contributor

Pull Request Description

Currently, if there are failures in any building in any upgrades, we remove those buildings from all upgrades. This was fine when the failure rate was extremely small, but when failure is substantial, this unnecessarily removes perfectly good buildings from other upgrades just because of one "bad" upgrade. This PR changes the logic so that only the failures in baseline is removed from all upgrades. Failures in upgrades are treated as if the upgrade didn't apply, and we copy baseline results for that building. This approach also aligns with what is done in ComStock.

Related Pull Requests

NatLabRockies/buildstockbatch#513

Related Issues

[What issue(s) is the PR addressing]

Checklist

Required:

Optional (not all items may apply):

@rajeee rajeee changed the title Assume failures in upgrades as not applied. Gracefully handle failures in upgrades Aug 13, 2025
Comment thread .github/workflows/config.yml Outdated
OPENSTUDIO_EXT: deb
OPENSTUDIO_URL: https://github.com/NREL/OpenStudio/releases/download/v3.9.0
BUILDSTOCK_BRANCH: develop
BUILDSTOCK_BRANCH: pp_fix

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this need to get changed back before merging?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, will switch these back before merging.

print(f"Processing baseline file: {baseline_file}")
baseline_df = pl.scan_parquet(baseline_file)
failed_bldgs = (
baseline_df.filter(pl.col("completed_status") == "Fail")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does ResStock ever have situations where the status is blank or "Success" but there are no numbers in the results data? ComStock has weird failure modes sometimes that we have to catch. If you haven't seen that probably don't need to worry about it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, those three are the only values I have seen. For the GHP upgrade with lots of failures (and possible weird corner cases), that's all we have.

image

missing_bldgs_df = missing_bldgs_df.join(upgrade_name_df, how="cross")
upgrade = pl.concat([upgrade, missing_bldgs_df], how="diagonal_relaxed")
upgrade = upgrade.sort("bldg_id")
upgrade = add_saving_cols(upgrade, base)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this needs to be called on the baseline DF as well so that that schemas for baseline and upgrade files are the same. Even though the savings will be zero, this is easier for users.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We can do that change in another PR - there are bunch of other column changes we need to do as well.

Comment thread .github/workflows/config.yml Outdated
Revert back to develop branch.
@rajeee rajeee merged commit 7f1bedb into develop Aug 13, 2025
0 of 10 checks passed
@joseph-robertson joseph-robertson added this to the ResStock v2025_R1 milestone Sep 4, 2025
@rHorsey rHorsey deleted the pp_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