This package automates the common postprocessing tasks that are part of running ResStock. It is used by BuildStockBatch to transform the results to its final format.
To install the package, we recommend using uv for Python package management.
-
Install
uvif you don't have it already:# Mac wget -qO- https://astral.sh/uv/install.sh | sh # Windows Powershell powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
(More info: https://docs.astral.sh/uv/getting-started/installation/)
-
Create a new virtual environment and install dependencies using the following command: (If it fails the first time, try running
uv syncagain)cd path/to/postprocessing uv sync -
(Recommended) Install the shared
pre-commithooks so formatting, spelling, and lint checks run automatically before each commit. This is a must if you are going to contribute code:cd path/to/postprocessing uv run --group dev pre-commit install -
Run the scripts as desired
# Output the failure log cd path/to/postprocessing uv run resstockpostproc/get_failures.py <csv_path> --verbose # Export metadata and annual results from files on S3 uv run resstockpostproc/process_bsb_results.py "s3://res-sdr/testing-sdr-fy25/a_run" "C:/path/to/bsb/output/a_run_output" # Export metdata and annual results from local files # (It is faster to download the /baseline and /upgrades directories from S3 once instead of reading from S3 each time) uv run resstockpostproc/process_bsb_results.py "C:/path/to/bsb/output/a_run" "C:/path/to/bsb/output/a_run_output" # Export metdata and annual results to OEDI uv run resstockpostproc/process_bsb_results.py "C:/path/to/bsb/output/a_run" "s3://oedi-data-lake/nrel-pds-building-stock/end-use-load-profiles-for-us-building-stock/2025/resstock_amy2018_release_1"